Replies: 2 comments
-
Here is a first list of upstreaming ideas:
Note however that, by definition, there will be things that DI users do with Enzyme which are not directly implemented with Enzyme calls. For instance, reverse-mode Jacobians, second derivatives, HVPs or Hessians currently use DI's generic machinery until they land on gradients, pushforwards or pullbacks. This is the whole point of the interface, so the idea is to shore up the set of basic functions in order to confidently build upon them. |
Beta Was this translation helpful? Give feedback.
-
We definitely should start with those, but in phase 2 I think we should move the higher level ones to call directly into Enzyme calls. For one thing Enzyme does implement many of them (like reverse mode Jacobian, though perhaps not to the spec of DI), and in doing so it’s able to take advantage of enzyme specific information that lets it be more efficient. For ones that don’t exist we should make such a function, and build off it as a baseline. at the end of the day this will hopefully mean that we can have reasonable confidence that the perf engineered ones in Enzyme are being called well, and that there isn’t a substantial overhead from DI itself |
Beta Was this translation helpful? Give feedback.
-
Hey @wsmoses,
I'm starting this discussion as a more permanent location than Slack for exchanging ideas.
The main question we have been debating is where DI's Enzyme bindings and tests - let's call this code
DI+Enzyme
- should live, and who should maintain them. In general, given packages A and B, there's no definitive rule on where glue code for A+B belongs. The question is made more thorny here becauseDI+Enzyme
relies on internals of both packages.On the one hand, DI does define a generic interface which AD backends can implement. In an ideal world, each backend would be responsible for how the interface is implemented, and DI would be extension-free. But in practice, it is unlikely to work that way anytime soon, for a variety of reasons:
As a result, I am against a blanket copy, like the one suggested in EnzymeAD/Enzyme.jl#2301. However, I agree that the more functionality we upstream to Enzyme, the more reliable DI becomes. So let's discuss which parts can be upstreamed and to where!
Beta Was this translation helpful? Give feedback.
All reactions