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

Properly set within_autodiff (#442) #490

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jumerckx
Copy link
Collaborator

@jumerckx jumerckx commented Jan 7, 2025

fixes #442
needs Enzyme.jl: EnzymeAD/Enzyme.jl#2254

I had to introduce a new function call_with_reactant_within_autodiff to smuggle the within_autodiff in the call_with_reactant_generator through the self argument.
I also tried doing things through set_reactant_abi but that didn't seem to suffice (first commit).
Perhaps the extra code in set_reactant_abi isn't strictly necessary now so I can try removing it again if wanted.

jumerckx and others added 3 commits January 7, 2025 13:23
… === overload_autodiff`.

This doesn't work for some reason, the function within overload autodiff uses the original interpreter (?)
…mlir_fn. In order to pass this information from make_mlir_fn to call_with_reactant_generator, I introduced a new function `call_with_reactant_within_autodiff` which allows detection by looking at `self`.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Enzyme.within_autodiff returns true inside compile
1 participant