-
Notifications
You must be signed in to change notification settings - Fork 194
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
Some type stabilization to get a new gradient from Enzyme #3360
Conversation
Latest error: ERROR: LoadError: task switch not allowed from inside staged nor pure functions
Stacktrace:
[1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
@ Base ./task.jl:921
[2] wait()
@ Base ./task.jl:995
[3] uv_write(s::Base.TTY, p::Ptr{UInt8}, n::UInt64)
@ Base ./stream.jl:1048
[4] unsafe_write(s::Base.TTY, p::Ptr{UInt8}, n::UInt64)
@ Base ./stream.jl:1120
[5] write
@ Base ./strings/io.jl:248 [inlined]
[6] print
@ Base ./strings/io.jl:250 [inlined]
[7] print(::Base.TTY, ::String, ::String, ::Vararg{String})
@ Base ./strings/io.jl:46
[8] println(::Base.TTY, ::String, ::Vararg{String})
@ Base ./strings/io.jl:75
[9] println(::String, ::String)
@ Base ./coreio.jl:4
[10] calling_conv_fixup(builder::LLVM.IRBuilder, val::LLVM.AddrSpaceCastInst, tape::LLVM.PointerType, prev::LLVM.UndefValue, lidxs::Vector{…}, ridxs::Vector{…})
@ Enzyme.Compiler ~/Projects/Enzyme.jl/src/compiler/utils.jl:270
[11] calling_conv_fixup (repeats 2 times)
@ Enzyme.Compiler ~/Projects/Enzyme.jl/src/compiler/utils.jl:183 [inlined]
[12] calling_conv_fixup(builder::LLVM.IRBuilder, val::LLVM.AddrSpaceCastInst, tape::LLVM.PointerType)
@ Enzyme.Compiler ~/Projects/Enzyme.jl/src/compiler/utils.jl:183
[13] enzyme_custom_common_rev(forward::Bool, B::LLVM.IRBuilder, orig::LLVM.CallInst, gutils::Enzyme.Compiler.GradientUtils, normalR::Ptr{…}, shadowR::Ptr{…}, tape::LLVM.ExtractValueInst)
@ Enzyme.Compiler ~/Projects/Enzyme.jl/src/compiler.jl:4610
[14] enzyme_custom_rev(B::LLVM.IRBuilder, orig::LLVM.CallInst, gutils::Enzyme.Compiler.GradientUtils, tape::LLVM.ExtractValueInst)
@ Enzyme.Compiler ~/Projects/Enzyme.jl/src/compiler.jl:4770 |
That is ironically an error in the error printer. Can you convert that to an assertion so we can see the actual error message? |
you mean like this?
I guess we don't hit any of the |
@jlk9 might take up this work 😏 we'll see if I convinced him |
above now fixed, now we get back to our favorite tuples
|
Do you know how to oimplement the "ntuple trick" @jlk9 ? I can help |
…ad of parameter itself
src/TurbulenceClosures/turbulence_closure_implementations/scalar_diffusivity.jl
Outdated
Show resolved
Hide resolved
@glwagner the Enzyme CI appears to pass here whereas failures appear unrelated. |
[[deps.Enzyme]] | ||
deps = ["CEnum", "EnzymeCore", "Enzyme_jll", "GPUCompiler", "LLVM", "Libdl", "LinearAlgebra", "ObjectFile", "Preferences", "Printf", "Random"] | ||
git-tree-sha1 = "ae881b2f107e3c01444edbaa0bf3b73f461539f6" | ||
repo-rev = "main" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's better to depend on a tagged version of a package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah, let's change that to the latest
@@ -11,6 +11,7 @@ CubedSphere = "7445602f-e544-4518-8976-18f8e8ae6cdb" | |||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | |||
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" | |||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | |||
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so now Enzyme is both a normal and a weak dependendcy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand how that works, did we do it wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I'm not sure if it was accidental or on purpose. But adding it there implies that's a core dependency of Oceananigans. I'll have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x-ref #3452
with @wsmoses and @jlk9
Also defines
__groupsize(cm)
for our special CompilerMetadata / KernelAbstractions extension cc @simone-silvestri