-
Notifications
You must be signed in to change notification settings - Fork 70
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 + KernelAbstractions: KA syntax changes and differentiating multiple kernels #896
Comments
For 0.9 we deprecated KernelGradients (albeit it shouldn't be impossible to add it back) Long-term our intent is to finish JuliaGPU/KernelAbstractions.jl#382 and allow you to differentiate directly using the normal Enzyme API |
Thanks a lot for the quick clarifications!! Are there options besides KernelAbstractions to make Enzyme work on GPUs with a vectorized code? And can you already give a very rough time estimate for the long-term plan to support KA? Thanks! |
Honestly it's just a matter of the linked PR getting merged into KA. That itself shouldn't be hard -- probably just a matter of @vchuravy and I sitting down together. The one potential blocker is that we've been waiting to cut a new release of Enzyme (which may be necessary) until we figure out the GC issue currently in CI. Sadly we've failed to reproduce that on any local systems, but some folks from Pernosco are looking to add their amazing omniscient debugger to our repo CI, which we've historically used locally to debug such issues. My guess is ~2 months, with the above reasons being the actual blockers that I'm just guessing re timeline on. |
I will also point out that KernelGradients was never more than https://github.com/JuliaGPU/KernelAbstractions.jl/blob/release-0.8/lib/KernelGradients/src/KernelGradients.jl and I think that definition should mostly still work. |
Okay I see. Thanks a lot again, that's very helpful to know. |
CC: @jlk9 |
FYI the Forward mode (for any backend) EnzymeRules for KA as landed, as well as CPU reverse mode |
As the remaining reverse mode backends has a KA issue (JuliaGPU/KernelAbstractions.jl#408), closing here |
Hi, I have two questions regarding the use of Enzyme with KernelAbstractions.
(1) How can we differentiate a kernel with the new KernelAbstractions version (>=0.9.4)? An example in the old syntax would be:
It is not clear to me how this can be done with the new syntax and the following does not work:
Gives the error:
(2) How can a wrapper function for a kernel be differentiated? Which might also include multiple kernels, and how derivatives of (multiple) kernels can be composed with Enzyme, so that derivatives of larger models on GPU can be written. E.g. a wrapper function might look something like this (old KA syntax):
which throws the error:
Any help would be very much appreciated!
The text was updated successfully, but these errors were encountered: