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

Improve autodiff docs with DI + Enzyme #3852

Closed
gdalle opened this issue Oct 16, 2024 · 3 comments
Closed

Improve autodiff docs with DI + Enzyme #3852

gdalle opened this issue Oct 16, 2024 · 3 comments

Comments

@gdalle
Copy link
Contributor

gdalle commented Oct 16, 2024

In #3836 we discovered that DI causes a segfault when it tries to compute a Hessian with Enzyme.
This is due to JuMP forcing splatted arguments, and Base.splat leading to type instabilities (see EnzymeAD/Enzyme.jl#1942).

I recently made some changes to DI which allow better handling of StaticArrays. If we collect the input into an SVector instead of a Vector, the segfault disappears. Should we add this trick to the tutorial, or at least a warning that Enzyme behaves differently?

Ping @wsmoses

@odow
Copy link
Member

odow commented Oct 16, 2024

I'll review a PR, but I personally don't have any plans to modify the tutorial. If Enzyme doesn't work with DI, then users don't have to use it. We already include a section on how to use pure Enzyme. Adding hacks and static arrays and stuff just feels like it isn't JuMP or the user's problem.

@wsmoses
Copy link
Contributor

wsmoses commented Oct 17, 2024

I'll review a PR, but I personally don't have any plans to modify the tutorial. If Enzyme doesn't work with DI, then users don't have to use it. We already include a section on how to use pure Enzyme. Adding hacks and static arrays and stuff just feels like it isn't JuMP or the user's problem.

++

@gdalle
Copy link
Contributor Author

gdalle commented Oct 17, 2024

Alrighty

@gdalle gdalle closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants