You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added a GPU + ClimaCore test in the CI. It works when the below code block is inside a function (i.e. the way it is currently written). However if instead you just try to execute
ERROR: LoadError: InvalidIRError: compiling MethodInstance for ClimaCoreCUDAExt.knl_copyto!(::ClimaCore.DataLayouts.VIJFH{…}, ::Base.Broadcast.Broadcasted{…}, ::ClimaCore.DataLayouts.UniversalSize{…}) resulted in invalid LLVM IR
Reason: unsupported dynamic function invocation (call to _broadcast_getindex_evalf(f::Tf, args::Vararg{Any, N}) where {Tf, N} @ Base.Broadcast broadcast.jl:709)
This looks like the same error I'm getting in ClimaAtmos when trying to add the cloud sedimentation CliMA/ClimaAtmos.jl#3442. Maybe it will be easier to debug here?
The text was updated successfully, but these errors were encountered:
This is because we create a tuple of tuple of objects (((params.liquid, ), (params.Ch2022.rain, ))), and the compiler struggles to infer unwrapping this object.
This limitation may be fixed in later versions of Julia (e.g., this PR), so I'd rather not suggest we change the way terminal_velocity is defined, that should work just fine.
The reason there is a difference between the posted code working and not working inside and outside a function (respectively) is likely due to inference being a heuristic-- other things can impact inference (and on the GPU that translates to the function working or not).
One simple (albeit a bit inconvenient) solution is to require users to define a wrapper function. We can change:
I have added a GPU + ClimaCore test in the CI. It works when the below code block is inside a function (i.e. the way it is currently written). However if instead you just try to execute
it fails with
Here is the full test: https://github.com/CliMA/CloudMicrophysics.jl/blob/main/test/gpu_clima_core_test.jl
This looks like the same error I'm getting in
ClimaAtmos
when trying to add the cloud sedimentation CliMA/ClimaAtmos.jl#3442. Maybe it will be easier to debug here?The text was updated successfully, but these errors were encountered: