Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enzyme execution failed in zygote tests #1036

Closed
leios opened this issue Sep 1, 2023 · 2 comments
Closed

Enzyme execution failed in zygote tests #1036

leios opened this issue Sep 1, 2023 · 2 comments

Comments

@leios
Copy link

leios commented Sep 1, 2023

I'm posting here, but intend to dig a bit further into this one. I ran into an error when testing Molly (shown below).

It seems to be with the parallel runtests and running on a single thread works fine.

Error:

Differentiable simulation: Error During Test at /home/leios/projects/CESMIX/Molly.jl/test/zygote.jl:30
  Got exception outside of a @test
  Enzyme execution failed.
  Mismatched activity for:   store {} addrspace(10)* %8, {} addrspace(10)** %.fca.0.4.gep, align 8, !dbg !198, !noalias !185 const val: {} addrspace(10)* %8
  Type tree: {[-1]:Pointer, [-1,0]:Integer, [-1,1]:Integer, [-1,2]:Integer, [-1,3]:Integer, [-1,4]:Integer, [-1,5]:Integer, [-1,6]:Integer, [-1,7]:Integer, [-1,8]:Pointer, [-1,8,0]:Pointer, [-1,8,0,0]:Integer, [-1,8,0,1]:Integer, [-1,8,0,2]:Integer, [-1,8,0,3]:Integer, [-1,8,0,4]:Integer, [-1,8,0,5]:Integer, [-1,8,0,6]:Integer, [-1,8,0,7]:Integer, [-1,8,0,8]:Integer, [-1,8,8]:Integer, [-1,8,9]:Integer, [-1,8,10]:Integer, [-1,8,11]:Integer, [-1,8,12]:Integer, [-1,8,13]:Integer, [-1,8,14]:Integer, [-1,8,15]:Integer, [-1,8,16]:Integer, [-1,8,17]:Integer, [-1,8,18]:Integer, [-1,8,19]:Integer, [-1,8,20]:Integer, [-1,8,21]:Integer, [-1,8,22]:Integer, [-1,8,23]:Integer, [-1,8,24]:Integer, [-1,8,25]:Integer, [-1,8,26]:Integer, [-1,8,27]:Integer, [-1,8,28]:Integer, [-1,8,29]:Integer, [-1,8,30]:Integer, [-1,8,31]:Integer, [-1,8,32]:Integer, [-1,8,33]:Integer, [-1,8,34]:Integer, [-1,8,35]:Integer, [-1,8,36]:Integer, [-1,8,37]:Integer, [-1,8,38]:Integer, [-1,8,39]:Integer}
  You may be using a constant variable as temporary storage for active memory (https://enzyme.mit.edu/julia/stable/#Activity-of-temporary-storage). If not, please open an issue, and either rewrite this variable to not be conditionally active or use Enzyme.API.runtimeActivity!(true) as a workaround for now
  
  Stacktrace:
   [1] macro expansion
     @ ./threadingconstructs.jl:199
   [2] forces_pair_spec!
     @ ~/projects/CESMIX/Molly.jl/src/force.jl:200
   [3] forces_pair_spec!
     @ ~/projects/CESMIX/Molly.jl/src/force.jl:0
  
  Stacktrace:
    [1] throwerr(cstr::Cstring)
      @ Enzyme.Compiler ~/.julia/packages/Enzyme/gS4lp/src/compiler.jl:2924
    [2] macro expansion
      @ ~/.julia/packages/Enzyme/gS4lp/src/compiler.jl:9559 [inlined]
    [3] enzyme_call
      @ ~/.julia/packages/Enzyme/gS4lp/src/compiler.jl:9247 [inlined]
    [4] CombinedAdjointThunk
      @ ~/.julia/packages/Enzyme/gS4lp/src/compiler.jl:9210 [inlined]
    [5] autodiff
      @ ~/.julia/packages/Enzyme/gS4lp/src/Enzyme.jl:205 [inlined]
    [6] autodiff
      @ ~/.julia/packages/Enzyme/gS4lp/src/Enzyme.jl:214 [inlined]
    [7] (::Molly.var"#forces_pair_spec_pullback#485"{Float64, Vector{SVector{3, Float64}}, Vector{Atom{Float64, Float64, Float64, Float64}}, Tuple{}, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}}, Tuple{InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}}, Tuple{InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, CubicBoundary{Float64}, Unitful.FreeUnits{(), NoDims, nothing}, NeighborList{Vector{Tuple{Int32, Int32, Bool}}}, Int64})(d_forces::Vector{SVector{3, Float64}})
      @ Molly ~/projects/CESMIX/Molly.jl/src/chain_rules.jl:227
    [8] (::Zygote.ZBack{Molly.var"#forces_pair_spec_pullback#485"{Float64, Vector{SVector{3, Float64}}, Vector{Atom{Float64, Float64, Float64, Float64}}, Tuple{}, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}}, Tuple{InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}}, Tuple{InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, CubicBoundary{Float64}, Unitful.FreeUnits{(), NoDims, nothing}, NeighborList{Vector{Tuple{Int32, Int32, Bool}}}, Int64}})(dy::Vector{SVector{3, Float64}})
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/chainrules.jl:211
    [9] Pullback
      @ ~/projects/CESMIX/Molly.jl/src/force.jl:149 [inlined]
   [10] (::Zygote.Pullback{Tuple{Molly.var"##forces#110", Int64, typeof(forces), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, NeighborList{Vector{Tuple{Int32, Int32, Bool}}}}, Any})(Δ::Vector{SVector{3, Float64}})
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface2.jl:0
   [11] Pullback
      @ ~/projects/CESMIX/Molly.jl/src/force.jl:140 [inlined]
   [12] (::Zygote.Pullback{Tuple{typeof(Core.kwcall), NamedTuple{(:n_threads,), Tuple{Int64}}, typeof(forces), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, NeighborList{Vector{Tuple{Int32, Int32, Bool}}}}, Any})(Δ::Vector{SVector{3, Float64}})
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface2.jl:0
   [13] Pullback
      @ ~/projects/CESMIX/Molly.jl/src/force.jl:24 [inlined]
   [14] (::Zygote.Pullback{Tuple{Molly.var"##accelerations#109", Int64, typeof(accelerations), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, NeighborList{Vector{Tuple{Int32, Int32, Bool}}}}, Tuple{Zygote.Pullback{Tuple{Type{NamedTuple{(:n_threads,)}}, Tuple{Int64}}, Tuple{Zygote.Pullback{Tuple{Type{NamedTuple{(:n_threads,), Tuple{Int64}}}, Tuple{Int64}}, Tuple{Zygote.var"#2224#back#315"{Zygote.Jnew{NamedTuple{(:n_threads,), Tuple{Int64}}, Nothing, true}}}}}}, Zygote.Pullback{Tuple{typeof(Core.kwcall), NamedTuple{(:n_threads,), Tuple{Int64}}, typeof(forces), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, NeighborList{Vector{Tuple{Int32, Int32, Bool}}}}, Any}, Zygote.Pullback{Tuple{typeof(Base.Broadcast.materialize), Vector{SVector{3, Float64}}}, Tuple{}}, Zygote.Pullback{Tuple{typeof(Base.Broadcast.broadcasted), typeof(/), Vector{SVector{3, Float64}}, Vector{Float64}}, Tuple{Zygote.var"#2017#back#204"{typeof(identity)}, Zygote.var"#2881#back#688"{Zygote.var"#map_back#682"{typeof(Base.Broadcast.broadcastable), 1, Tuple{Tuple{}}, Tuple{Val{0}}, Tuple{}}}, Zygote.var"#2173#back#293"{Zygote.var"#291#292"{Tuple{Tuple{Nothing, Nothing}, Tuple{}}, Zygote.var"#combine_styles_pullback#1182"{Tuple{Nothing, Nothing, Nothing}}}}, Zygote.var"#2173#back#293"{Zygote.var"#291#292"{Tuple{NTuple{4, Nothing}, Tuple{}}, Molly.var"#1322#back#753"{Molly.var"#bc_fwd_back#527"{3, Float64, Vector{SVector{3, Float64}}, Vector{Float64}, Vector{SVector{3, ForwardDiff.Dual{Nothing, Float64, 4}}}}}}}, Zygote.Pullback{Tuple{typeof(Base.Broadcast.broadcastable), Vector{Float64}}, Tuple{}}, Zygote.Pullback{Tuple{typeof(Base.Broadcast.broadcastable), Vector{SVector{3, Float64}}}, Tuple{}}, Zygote.var"#2017#back#204"{typeof(identity)}}}, Zygote.Pullback{Tuple{typeof(masses), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}}, Tuple{Zygote.var"#2184#back#303"{Zygote.var"#back#302"{:masses, Zygote.Context{false}, System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, Vector{Float64}}}}}, Zygote.var"#2017#back#204"{typeof(identity)}}})(Δ::Vector{SVector{3, Float64}})
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface2.jl:0
   [15] Pullback
      @ ~/projects/CESMIX/Molly.jl/src/force.jl:23 [inlined]
   [16] (::Zygote.Pullback{Tuple{typeof(Core.kwcall), NamedTuple{(:n_threads,), Tuple{Int64}}, typeof(accelerations), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, NeighborList{Vector{Tuple{Int32, Int32, Bool}}}}, Any})(Δ::Vector{SVector{3, Float64}})
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface2.jl:0
   [17] Pullback
      @ ~/projects/CESMIX/Molly.jl/src/simulators.jl:147 [inlined]
   [18] (::Zygote.Pullback{Tuple{Molly.var"##simulate!#202", Int64, Bool, typeof(simulate!), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, VelocityVerlet{Float64, RescaleThermostat{Float64}}, Int64}, Any})(Δ::Nothing)
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface2.jl:0
   [19] Pullback
      @ ~/projects/CESMIX/Molly.jl/src/simulators.jl:128 [inlined]
   [20] (::Zygote.Pullback{Tuple{typeof(Core.kwcall), NamedTuple{(:n_threads,), Tuple{Int64}}, typeof(simulate!), System{3, false, Float64, Vector{Atom{Float64, Float64, Float64, Float64}}, Vector{SVector{3, Float64}}, CubicBoundary{Float64}, Vector{SVector{3, Float64}}, Vector{Any}, Nothing, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Tuple{InteractionList2Atoms{Vector{Int32}, Vector{HarmonicBond{Float32, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}}, Tuple{}, Tuple{}, DistanceNeighborFinder{BitMatrix, Float64}, Tuple{}, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}, Vector{Float64}}, VelocityVerlet{Float64, RescaleThermostat{Float64}}, Int64}, Any})(Δ::Nothing)
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface2.jl:0
   [21] Pullback
      @ ~/projects/CESMIX/Molly.jl/test/zygote.jl:151 [inlined]
   [22] (::Zygote.Pullback{Tuple{var"#loss#41"{Bool, Bool, Bool, Bool, Bool, DistanceNeighborFinder{BitMatrix, Float64}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, Vector{Float64}, Vector{Int32}, Vector{Int32}, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Vector{SVector{3, ForwardDiff.Dual{Nothing, Float64, 1}}}, Vector{SVector{3, ForwardDiff.Dual{Nothing, Float64, 1}}}, Vector{SVector{3, Float64}}, Vector{SVector{3, Float64}}, VelocityVerlet{Float64, RescaleThermostat{Float64}}, CubicBoundary{Float64}, Float64, Int64, Int64, var"#mean_min_separation#30"{var"#abs2_vec#29"}}, Float64, Float64}, Any})(Δ::Float64)
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface2.jl:0
   [23] (::Zygote.var"#75#76"{Zygote.Pullback{Tuple{var"#loss#41"{Bool, Bool, Bool, Bool, Bool, DistanceNeighborFinder{BitMatrix, Float64}, InteractionList4Atoms{Vector{Int32}, Vector{PeriodicTorsion{6, Float64, Float64}}}, InteractionList3Atoms{Vector{Int32}, Vector{HarmonicAngle{Float64, Float64}}}, Vector{Float64}, Vector{Int32}, Vector{Int32}, Tuple{LennardJones{false, DistanceCutoff{Float64, Float64, Float64}, Int64, Int64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}, CoulombReactionField{Float64, Float64, Int64, Float64, Unitful.FreeUnits{(), NoDims, nothing}, Unitful.FreeUnits{(), NoDims, nothing}}}, Vector{SVector{3, ForwardDiff.Dual{Nothing, Float64, 1}}}, Vector{SVector{3, ForwardDiff.Dual{Nothing, Float64, 1}}}, Vector{SVector{3, Float64}}, Vector{SVector{3, Float64}}, VelocityVerlet{Float64, RescaleThermostat{Float64}}, CubicBoundary{Float64}, Float64, Int64, Int64, var"#mean_min_separation#30"{var"#abs2_vec#29"}}, Float64, Float64}, Any}})(Δ::Float64)
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface.jl:45
   [24] gradient(::Function, ::Float64, ::Vararg{Float64})
      @ Zygote ~/.julia/packages/Zygote/4rucm/src/compiler/interface.jl:97
   [25] macro expansion
      @ ~/projects/CESMIX/Molly.jl/test/zygote.jl:200 [inlined]
   [26] macro expansion
      @ ~/builds/julia-1.9.2/share/julia/stdlib/v1.9/Test/src/Test.jl:1498 [inlined]
   [27] top-level scope
      @ ~/projects/CESMIX/Molly.jl/test/zygote.jl:31
   [28] include(fname::String)
      @ Base.MainInclude ./client.jl:478
   [29] top-level scope
      @ ~/projects/CESMIX/Molly.jl/test/runtests.jl:96
   [30] include(fname::String)
      @ Base.MainInclude ./client.jl:478
   [31] top-level scope
      @ none:6
   [32] eval
      @ ./boot.jl:370 [inlined]
   [33] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:280
   [34] _start()
      @ Base ./client.jl:522
Test Summary:             | Pass  Error  Total     Time
Differentiable simulation |   16      1     17  2m38.5s
ERROR: LoadError: Some tests did not pass: 16 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /home/leios/projects/CESMIX/Molly.jl/test/zygote.jl:30
@wsmoses
Copy link
Member

wsmoses commented Sep 3, 2023

That error indicates that the closure being created for the parallel for body contains both differentiable data, and non-differentiable data, and is therefore possible to emit the wrong answer, unless you turn on the flag (which does reduce performance slightly).

Earlier versions of Enzyme could have the incorrect behavior there, but no error -- and thus we added the error.

@jgreener64
Copy link
Contributor

I just fixed this in the Molly tests (JuliaMolSim/Molly.jl@35a482e).

@wsmoses wsmoses closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants