-
Notifications
You must be signed in to change notification settings - Fork 69
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 inexact error #1294
Comments
Yeah LLVM.jl had an accidentally breaking release (eg no Enzyme code change caused). This should be fixed in the latest release though? |
I can cause this error on Enzyme v0.11.4 and LLVM v6.5.0, I'm not sure which LLVM had the problem though. Edit to add that it also happens on Enzyme v0.11.15 and LLVM v6.5.0 |
You need enzyme 11.15 which was released yesterday with this fix |
I tried with both 0.11.5 and 0.11.5#main and it still seemed to happen |
Can you paste the result of st |
|
Can you try the latest release and not main
…On Wed, Feb 14, 2024 at 3:06 PM Sarah Williamson ***@***.***> wrote:
Status `~/Documents/GitHub/ShallowWaters.jl/my_scripts/Project.toml`
[eb46d486] Checkpointing v0.8.3 `https://github.com/Argonne-National-Laboratory/Checkpointing.jl.git#main` <https://github.com/Argonne-National-Laboratory/Checkpointing.jl.git#main>
[35d6a980] ColorSchemes v3.24.0
[717857b8] DSP v0.7.9
[7da242da] Enzyme v0.11.15 `https://github.com/EnzymeAD/Enzyme.jl.git#main` <https://github.com/EnzymeAD/Enzyme.jl.git#main>
[7a1cc6ca] FFTW v1.8.0
[a98d9a8b] Interpolations v0.15.1
[033835bb] JLD2 v0.4.45
[929cbde3] LLVM v6.5.0
[b964fa9f] LaTeXStrings v1.3.1
[30363a11] NetCDF v0.11.7
[d96e819e] Parameters v0.12.3
[91a5bcdd] Plots v1.40.1
[90137ffa] StaticArrays v1.9.2
[ade2ca70] Dates
[de0858da] Printf
[2f01184e] SparseArrays v1.10.0
—
Reply to this email directly, view it on GitHub
<#1294 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTUXFHWH3YPLNMO2YL6NDYTUKLZAVCNFSM6AAAAABDIYZPDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUGUYDSNJTGU>
.
You are receiving this because you commented.Message ID: <EnzymeAD/Enzyme.
***@***.***>
|
(my_scripts) pkg> st
Status `~/Documents/GitHub/ShallowWaters.jl/my_scripts/Project.toml`
[eb46d486] Checkpointing v0.8.3 `https://github.com/Argonne-National-Laboratory/Checkpointing.jl.git#main`
[35d6a980] ColorSchemes v3.24.0
[717857b8] DSP v0.7.9
[7da242da] Enzyme v0.11.15
[7a1cc6ca] FFTW v1.8.0
[a98d9a8b] Interpolations v0.15.1
[033835bb] JLD2 v0.4.45
[929cbde3] LLVM v6.5.0
[b964fa9f] LaTeXStrings v1.3.1
[30363a11] NetCDF v0.11.7
[d96e819e] Parameters v0.12.3
[91a5bcdd] Plots v1.40.1
[90137ffa] StaticArrays v1.9.2
[ade2ca70] Dates
[de0858da] Printf
[2f01184e] SparseArrays v1.10.0
julia> include("run_checkpointing.jl")
WARNING: replacing module ShallowWaters.
[ Info: Revolve: Number of checkpoints: 9
[ Info: Revolve: Number of steps: 88
[ Info: Prediction:
[ Info: Forward steps : 198
[ Info: Overhead factor : 2.2247191011235956
ERROR: LoadError: InexactError: check_top_bit(UInt32, -1)
Stacktrace:
[1] throw_inexacterror(f::Symbol, ::Type{UInt32}, val::Int32)
@ Core ./boot.jl:634
[2] check_top_bit
@ Core ./boot.jl:648 [inlined]
[3] toUInt32
@ Core ./boot.jl:747 [inlined]
[4] UInt32
@ Core ./boot.jl:788 [inlined]
[5] Integer
@ CEnum ~/.julia/packages/CEnum/B6ahP/src/CEnum.jl:19 [inlined]
[6] cconvert
@ CEnum ~/.julia/packages/CEnum/B6ahP/src/CEnum.jl:20 [inlined]
[7] LLVMAddCallSiteAttribute(C::LLVM.CallInst, Idx::LLVM.API.__JL_Ctag_85, A::LLVM.StringAttribute)
@ LLVM.API ~/.julia/packages/LLVM/ycL7C/lib/15/libLLVM.jl:2536
[8] check_ir!(job::GPUCompiler.CompilerJob{…}, errors::Vector{…}, imported::Set{…}, inst::LLVM.CallInst, calls::Vector{…})
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:515
[9] check_ir!(job::GPUCompiler.CompilerJob{…}, errors::Vector{…}, imported::Set{…}, f::LLVM.Function)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:208
[10] check_ir!(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, errors::Vector{Tuple{…}}, mod::LLVM.Module)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:178
[11] check_ir
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:157 [inlined]
[12] codegen(output::Symbol, job::GPUCompiler.CompilerJob{…}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, toplevel::Bool, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:4384
[13] codegen
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:4348 [inlined]
[14] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, postopt::Bool) (repeats 2 times)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5362
[15] cached_compilation
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5396 [inlined]
[16] (::Enzyme.Compiler.var"#509#510"{DataType, DataType, DataType, Enzyme.API.CDerivativeMode, Tuple{…}, Int64, Bool, Bool, UInt64, DataType})(ctx::LLVM.Context)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5462
[17] JuliaContext(f::Enzyme.Compiler.var"#509#510"{DataType, DataType, DataType, Enzyme.API.CDerivativeMode, Tuple{…}, Int64, Bool, Bool, UInt64, DataType})
@ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:47
[18] #s1056#508
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5414 [inlined]
[19]
@ Enzyme.Compiler ./none:0
[20] (::Core.GeneratedFunctionStub)(::UInt64, ::LineNumberNode, ::Any, ::Vararg{Any})
@ Core ./boot.jl:602
[21] autodiff
@ Enzyme ~/.julia/packages/Enzyme/KJgKj/src/Enzyme.jl:209 [inlined]
[22] autodiff(::ReverseMode{…}, ::Const{…}, ::Duplicated{…}, ::Revolve{…})
@ Enzyme ~/.julia/packages/Enzyme/KJgKj/src/Enzyme.jl:238
[23] autodiff
@ ~/.julia/packages/Enzyme/KJgKj/src/Enzyme.jl:224 [inlined]
[24] run_checkpointing()
@ Main ~/Documents/GitHub/ShallowWaters.jl/my_scripts/run_checkpointing.jl:412
[25] macro expansion
@ ./timing.jl:279 [inlined]
[26] top-level scope
@ ~/Documents/GitHub/ShallowWaters.jl/my_scripts/run_checkpointing.jl:269
[27] include(fname::String)
@ Base.MainInclude ./client.jl:489
[28] top-level scope
@ REPL[39]:1
in expression starting at /Users/swilliamson/Documents/GitHub/ShallowWaters.jl/my_scripts/run_checkpointing.jl:458
Some type information was truncated. Use `show(err)` to see complete types.
|
So the line it errs on has the fix so I’m deeply confused
https://github.com/EnzymeAD/Enzyme.jl/blob/3e5ceeb14f9ae942f158b8de3286524628277c1c/src/compiler/validation.jl#L515
cc @vchuravy
…On Wed, Feb 14, 2024 at 3:08 PM Sarah Williamson ***@***.***> wrote:
(my_scripts) pkg> st
Status `~/Documents/GitHub/ShallowWaters.jl/my_scripts/Project.toml`
[eb46d486] Checkpointing v0.8.3 `https://github.com/Argonne-National-Laboratory/Checkpointing.jl.git#main`
[35d6a980] ColorSchemes v3.24.0
[717857b8] DSP v0.7.9
[7da242da] Enzyme v0.11.15
[7a1cc6ca] FFTW v1.8.0
[a98d9a8b] Interpolations v0.15.1
[033835bb] JLD2 v0.4.45
[929cbde3] LLVM v6.5.0
[b964fa9f] LaTeXStrings v1.3.1
[30363a11] NetCDF v0.11.7
[d96e819e] Parameters v0.12.3
[91a5bcdd] Plots v1.40.1
[90137ffa] StaticArrays v1.9.2
[ade2ca70] Dates
[de0858da] Printf
[2f01184e] SparseArrays v1.10.0
julia> include("run_checkpointing.jl")
WARNING: replacing module ShallowWaters.
[ Info: Revolve: Number of checkpoints: 9
[ Info: Revolve: Number of steps: 88
[ Info: Prediction:
[ Info: Forward steps : 198
[ Info: Overhead factor : 2.2247191011235956
ERROR: LoadError: InexactError: check_top_bit(UInt32, -1)
Stacktrace:
[1] throw_inexacterror(f::Symbol, ::Type{UInt32}, val::Int32)
@ Core ./boot.jl:634
[2] check_top_bit
@ Core ./boot.jl:648 [inlined]
[3] toUInt32
@ Core ./boot.jl:747 [inlined]
[4] UInt32
@ Core ./boot.jl:788 [inlined]
[5] Integer
@ CEnum ~/.julia/packages/CEnum/B6ahP/src/CEnum.jl:19 [inlined]
[6] cconvert
@ CEnum ~/.julia/packages/CEnum/B6ahP/src/CEnum.jl:20 [inlined]
[7] LLVMAddCallSiteAttribute(C::LLVM.CallInst, Idx::LLVM.API.__JL_Ctag_85, A::LLVM.StringAttribute)
@ LLVM.API ~/.julia/packages/LLVM/ycL7C/lib/15/libLLVM.jl:2536
[8] check_ir!(job::GPUCompiler.CompilerJob{…}, errors::Vector{…}, imported::Set{…}, inst::LLVM.CallInst, calls::Vector{…})
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:515
[9] check_ir!(job::GPUCompiler.CompilerJob{…}, errors::Vector{…}, imported::Set{…}, f::LLVM.Function)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:208
[10] check_ir!(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, errors::Vector{Tuple{…}}, mod::LLVM.Module)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:178
[11] check_ir
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler/validation.jl:157 [inlined]
[12] codegen(output::Symbol, job::GPUCompiler.CompilerJob{…}; libraries::Bool, deferred_codegen::Bool, optimize::Bool, toplevel::Bool, strip::Bool, validate::Bool, only_entry::Bool, parent_job::Nothing)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:4384
[13] codegen
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:4348 [inlined]
[14] _thunk(job::GPUCompiler.CompilerJob{Enzyme.Compiler.EnzymeTarget, Enzyme.Compiler.EnzymeCompilerParams}, postopt::Bool) (repeats 2 times)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5362
[15] cached_compilation
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5396 [inlined]
[16] (::Enzyme.Compiler.var"#509#510"{DataType, DataType, DataType, Enzyme.API.CDerivativeMode, Tuple{…}, Int64, Bool, Bool, UInt64, DataType})(ctx::LLVM.Context)
@ Enzyme.Compiler ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5462
[17] JuliaContext(f::Enzyme.Compiler.var"#509#510"{DataType, DataType, DataType, Enzyme.API.CDerivativeMode, Tuple{…}, Int64, Bool, Bool, UInt64, DataType})
@ GPUCompiler ~/.julia/packages/GPUCompiler/U36Ed/src/driver.jl:47
[18] #s1056#508
@ ~/.julia/packages/Enzyme/KJgKj/src/compiler.jl:5414 [inlined]
[19]
@ Enzyme.Compiler ./none:0
[20] (::Core.GeneratedFunctionStub)(::UInt64, ::LineNumberNode, ::Any, ::Vararg{Any})
@ Core ./boot.jl:602
[21] autodiff
@ Enzyme ~/.julia/packages/Enzyme/KJgKj/src/Enzyme.jl:209 [inlined]
[22] autodiff(::ReverseMode{…}, ::Const{…}, ::Duplicated{…}, ::Revolve{…})
@ Enzyme ~/.julia/packages/Enzyme/KJgKj/src/Enzyme.jl:238
[23] autodiff
@ ~/.julia/packages/Enzyme/KJgKj/src/Enzyme.jl:224 [inlined]
[24] run_checkpointing()
@ Main ~/Documents/GitHub/ShallowWaters.jl/my_scripts/run_checkpointing.jl:412
[25] macro expansion
@ ./timing.jl:279 [inlined]
[26] top-level scope
@ ~/Documents/GitHub/ShallowWaters.jl/my_scripts/run_checkpointing.jl:269
[27] include(fname::String)
@ Base.MainInclude ./client.jl:489
[28] top-level scope
@ REPL[39]:1
in expression starting at /Users/swilliamson/Documents/GitHub/ShallowWaters.jl/my_scripts/run_checkpointing.jl:458
Some type information was truncated. Use `show(err)` to see complete types.
—
Reply to this email directly, view it on GitHub
<#1294 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTUXASTJK6HG7ETDQZYTDYTUKTBAVCNFSM6AAAAABDIYZPDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUGUYTCOJZGA>
.
You are receiving this because you commented.Message ID: <EnzymeAD/Enzyme.
***@***.***>
|
Trust me when I say I'm also deeply confused, this worked yesterday 😢 |
Can you remove all manifest.toml files and retry |
That worked (fingers crossed), thank you! |
With or without the checkpointing lines in this script I'm getting the following error when trying to run
autodiff
:I had this happen on Enzyme v0.11.14, v0.11.15, and v0.11.15#main. The code ran on Enzyme v0.11.14 based on my Github history
The text was updated successfully, but these errors were encountered: