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 failure #1260

Closed
swilliamson7 opened this issue Jan 29, 2024 · 3 comments
Closed

Enzyme execution failure #1260

swilliamson7 opened this issue Jan 29, 2024 · 3 comments

Comments

@swilliamson7
Copy link
Collaborator

With some code I have I'm hitting the following error:

julia> S, dS = run_energy_checkpointing()
[ Info: Revolve: Number of checkpoints: 286
[ Info: Revolve: Number of steps: 81912
[ Info: Prediction:
[ Info: Forward steps   : 204120
[ Info: Overhead factor : 2.4919121506964705
warning: didn't implement memmove, using memcpy as fallback which can result in errors
ERROR: Enzyme execution failed.
Mismatched activity for:   store atomic {} addrspace(10)* %302, {} addrspace(10)* addrspace(11)* %12 release, align 8, !dbg !171, !tbaa !108, !alias.scope !112, !noalias !115 const val:   %302 = call noalias nonnull {} addrspace(10)* @ijl_box_int64(i64 signext %301) #106, !dbg !171
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}
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
   @ ~/.julia/packages/UnPack/EkESO/src/UnPack.jl:101
 [2] checkpointed_time_integration
   @ ~/Documents/GitHub/ShallowWaters.jl/src/time_integration.jl:953

Stacktrace:
  [1] throwerr(cstr::Cstring)
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/jOGYG/src/compiler.jl:1317
  [2] macro expansion
    @ ~/.julia/packages/UnPack/EkESO/src/UnPack.jl:101 [inlined]
  [3] checkpointed_time_integration
    @ ~/Documents/GitHub/ShallowWaters.jl/src/time_integration.jl:953 [inlined]
  [4] diffejulia_checkpointed_time_integration_4677wrap
    @ ~/Documents/GitHub/ShallowWaters.jl/src/time_integration.jl:0
  [5] macro expansion
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/jOGYG/src/compiler.jl:5306 [inlined]
  [6] enzyme_call
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/jOGYG/src/compiler.jl:4984 [inlined]
  [7] CombinedAdjointThunk
    @ Enzyme.Compiler ~/.julia/packages/Enzyme/jOGYG/src/compiler.jl:4926 [inlined]
  [8] autodiff
    @ Enzyme ~/.julia/packages/Enzyme/jOGYG/src/Enzyme.jl:215 [inlined]
  [9] autodiff(::ReverseMode{true, FFIABI}, ::Const{typeof(Main.ShallowWaters.checkpointed_time_integration)}, ::Duplicated{Main.ShallowWaters.ModelSetup{Float32, Float32}}, ::Revolve{Main.ShallowWaters.ModelSetup})
    @ Enzyme ~/.julia/packages/Enzyme/jOGYG/src/Enzyme.jl:238
 [10] autodiff
    @ Main ~/.julia/packages/Enzyme/jOGYG/src/Enzyme.jl:224 [inlined]
 [11] run_energy_checkpointing()
    @ Main ~/Documents/GitHub/ShallowWaters.jl/my_scripts/averaged_energy_optimization.jl:36
 [12] top-level scope
    @ REPL[28]:1

Per advice posting it here without a MWE

@vchuravy
Copy link
Member

Have you tried running with Enzyme.API.runtimeActivity!(true) as the error message recommends (maybe we need a better error message).

What is ShallowWaters.jl/src/time_integration.jl:953?

@swilliamson7
Copy link
Collaborator Author

I did indeed, adding that line led to a rather large GC error

@wsmoses
Copy link
Member

wsmoses commented Feb 10, 2024

The first errors should hopefully be fixed by #1278 (and if not reopen).

Can you oepn a different issue for the segfault?

@wsmoses wsmoses closed this as completed Feb 10, 2024
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