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

Segmentation fault, Bijectors.RadialLayer #2036

Closed
mhauru opened this issue Oct 31, 2024 · 2 comments
Closed

Segmentation fault, Bijectors.RadialLayer #2036

mhauru opened this issue Oct 31, 2024 · 2 comments

Comments

@mhauru
Copy link
Contributor

mhauru commented Oct 31, 2024

MWE:

module MWE
import Bijectors, Enzyme, StableRNGs
rng = StableRNGs.StableRNG(23)

function wrap()
   b = Bijectors.RadialLayer(3)
   binv = Bijectors.inverse(b)
   f(x) = sum(b(binv(x)))
   x = randn(rng, 3)
   Enzyme.gradient(Enzyme.Forward, Enzyme.Const(f), x)
   Enzyme.gradient(Enzyme.Reverse, Enzyme.Const(f), x)
end

wrap()
end

Output:

┌ Warning: Using fallback BLAS replacements for (["dasum_64_"]), performance may be degraded
└ @ Enzyme.Compiler ~/.julia/packages/GPUCompiler/GnbhK/src/utils.jl:59
┌ Warning: Using fallback BLAS replacements for (["dasum_64_"]), performance may be degraded
└ @ Enzyme.Compiler ~/.julia/packages/GPUCompiler/GnbhK/src/utils.jl:59

[81422] signal (11.2): Segmentation fault: 11
in expression starting at REPL[1]:14
getindex at ./essentials.jl:13 [inlined]
macro expansion at ./reduce.jl:264 [inlined]
macro expansion at ./simdloop.jl:77 [inlined]
mapreduce_impl at ./reduce.jl:263
macro expansion at /Users/mhauru/projects/Enzyme.jl/src/compiler.jl:8163 [inlined]
enzyme_call at /Users/mhauru/projects/Enzyme.jl/src/compiler.jl:7729 [inlined]
CombinedAdjointThunk at /Users/mhauru/projects/Enzyme.jl/src/compiler.jl:7502 [inlined]
autodiff at /Users/mhauru/projects/Enzyme.jl/src/Enzyme.jl:491 [inlined]
macro expansion at /Users/mhauru/projects/Enzyme.jl/src/Enzyme.jl:1720 [inlined]
gradient at /Users/mhauru/projects/Enzyme.jl/src/Enzyme.jl:1661 [inlined]
wrap at ./REPL[1]:11
unknown function (ip: 0x310d94193)
ijl_apply_generic at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
do_call at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
eval_body at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
jl_interpret_toplevel_thunk at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
jl_toplevel_eval_flex at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
jl_toplevel_eval_flex at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
jl_toplevel_eval_flex at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
jl_toplevel_eval_flex at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
jl_toplevel_eval_flex at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
ijl_toplevel_eval_in at /Users/mhauru/.julia/juliaup/julia-1.10.5+0.aarch64.apple.darwin14/lib/julia/libjulia-internal.1.10.5.dylib (unknown line)
Segmentation fault: 11

I seem to indeterministically get slightly different errors, which I don't understand since I've fixed the seed. Here's another example:

[81787] signal (11.2): Segmentation fault: 11
in expression starting at REPL[1]:14
getindex at ./essentials.jl:13 [inlined]
macro expansion at ./reduce.jl:264 [inlined]
macro expansion at ./simdloop.jl:77 [inlined]
mapreduce_impl at ./reduce.jl:263
macro expansion at /Users/mhauru/projects/Enzyme.jl/src/compiler.jl:8163 [inlined]
enzyme_call at /Users/mhauru/projects/Enzyme.jl/src/compiler.jl:7729 [inlined]
CombinedAdjointThunk at /Users/mhauru/projects/Enzyme.jl/src/compiler.jl:7502 [inlined]
autodiff at /Users/mhauru/projects/Enzyme.jl/src/Enzyme.jl:491 [inlined]
macro expansion at /Users/mhauru/projects/Enzyme.jl/src/Enzyme.jl:1720 [inlined]
gradient at /Users/mhauru/projects/Enzyme.jl/src/Enzyme.jl:1661
unknown function (ip: 0x3100bc127)

[81787] signal (4.1): Illegal instruction: 4
in expression starting at REPL[1]:14

[81787] signal (6): Abort trap: 6
in expression starting at REPL[1]:14
Abort trap: 6

Enzyme main, Julia v1.10.5.

@wsmoses
Copy link
Member

wsmoses commented Nov 1, 2024

Needs minimization

@wsmoses
Copy link
Member

wsmoses commented Nov 3, 2024

Didn't segfault when I tested out on my local dev branch (#2047), closing.

Please reopen if it persists.

@wsmoses wsmoses closed this as completed Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants