Conversation
| Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl). | ||
|
|
||
| !!! warning | ||
| `AutoEnzyme` can be used by [DifferentiationInterface.jl](https://github.com/JuliaDiff/DifferentiationInterface.jl) to access a restricted subset of Enzyme.jl functionality. |
There was a problem hiding this comment.
This feels like the wrong place to have it, since sciml uses ADTypes (created the package), and calls Enzyme directly
There was a problem hiding this comment.
My reasoning is that high-level users often don't make the call to DI themselves, but they do provide an AutoEnzyme (or AutoForwardDiff, etc.) object to whatever package they are calling. That's why putting a warning in ADTypes makes sense to me, because it is the entry point that users actually control about derivative computation.
I also plan on making the corresponding Enzyme warning in the DI docs more prominent. And I will let you have the final word in any Enzyme-related discussion on Discourse, Slack and other platforms, instead of piling up about what DI can or can't do. As long as users are aware they can try both options, I'm good with that. Consider this an olive branch :)
There was a problem hiding this comment.
Yeah but this still feels like the wrong place for this to happen, since ADTypes often directly calls enzyme and doesn’t go through DI.
As mentioned in the other thread I’m working on trying to make the errors throw only if called within DI
There was a problem hiding this comment.
I thought this would be a good addition for the many packages who do call Enzyme through DI, without hurting the others, but I'll leave it up to you. Feel free to revive this PR if you change your mind, I'm setting it as a draft for the time being.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Calling Enzyme through DI can introduce errors or slowdowns compared to Enzyme's native API. However, end users are unlikely to check out either the DI docs or the Enzyme docs when investigating what happened, especially when derivatives are deep in the call stack.
On the other hand, end users usually provide the
AutoEnzymeobject to whatever package they are using. Thus, adding a warning there seems like a good way to raise awareness.@wsmoses what do you think? You could also write a page for the Enzyme docs with examples of what can go wrong when going through DI, and we could link it from here and from the DI docs.
Related: