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

Feasibility of combining Numba and Enzyme #71

Open
CreRecombinase opened this issue Oct 12, 2020 · 4 comments
Open

Feasibility of combining Numba and Enzyme #71

CreRecombinase opened this issue Oct 12, 2020 · 4 comments
Assignees

Comments

@CreRecombinase
Copy link

Because they're both based on LLVM, I was wondering what would be involved in integrating Numba with Enzyme, so that I could decorate a python function and get (optimized) gradients. I poked around the documentation a little but didn't see anything relevant.

@vchuravy
Copy link
Member

You could take a look of how the Julia frontend does things, https://github.com/wsmoses/Enzyme.jl
GPUCompiler works similar to Numba, and there is a C-API call for creating the enzyme pass.

Happy to chat about the detailed strategy, but I am not familiar enough with Numba to make any direct recommendations.

@wsmoses
Copy link
Member

wsmoses commented Oct 12, 2020

It definitely should be possible and I agree the Julia front end is likely a good place to start (also happy to video call next week and do some planning).

My bet as to the big things that will need to be done for Numba as a front end:

  • Load Enzyme as a plugin and call it as an optimization at the appropriate time (Julia has good example of)
  • Expose API for gradients in numba
  • Ensure Numba passes down all of the relevant bitcode
  • Ensure Numba passes down Type Information that can be understood (as TBAA)
  • Re-entry into Numba JIT if AD of non fully statically analzable code is desired

@ludgerpaehler ludgerpaehler self-assigned this Jan 13, 2022
@sebastienwood
Copy link

Hi !
Is there any news on this potential functionality ?
Thanks !

@FrothyB
Copy link

FrothyB commented Dec 12, 2023

Hi, would just like to add a +1 that this would be of great interest to me. Have any steps been made or anyone else taken a look in the last couple years?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants