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

Add some EnzymeRules #21

Open
MasonProtter opened this issue Oct 26, 2023 · 3 comments
Open

Add some EnzymeRules #21

MasonProtter opened this issue Oct 26, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@MasonProtter
Copy link
Owner

Currently, Enzyme.jl's reverse mode autodiff doesn't work correctly with Bumper.jl because if you give it a Duplicated buffer, it'll += accumulate results into the duplicated buffer making the answer depend on the state of the buffer at the start of the program.

It'd be good if we could set up some EnzymeRules to explicitly teach Enzyme how to handle Bumper.jl allocations and deallocations. I don't really know how to do this though, so if anyone wants to take it on, or work on it together please do.

@MasonProtter MasonProtter added enhancement New feature or request help wanted Extra attention is needed labels Oct 26, 2023
@MilesCranmer
Copy link

MilesCranmer commented Jan 29, 2024

Just so I understand, you could still use bump allocation internal to a differentiated function, right? You are basically wondering if it could also be done with bump allocation wrapping an enzyme call?

@MasonProtter
Copy link
Owner Author

MasonProtter commented Jan 29, 2024

I'm pretty sure it'll not work even if you do it internally (unless you manually zero out your buffer)

@sefffal
Copy link

sefffal commented Oct 29, 2024

I checked, and yes Enzyme fails to autodiff a function that uses Bumper internally, so I think rules are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants