-
Notifications
You must be signed in to change notification settings - Fork 6
Can DifferentiationInterface.jl replace the AD backend extensions here? #26
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
Comments
Yes, I think it would be great to add API for that backend too, but I would be reluctant to replace existing ones since there may be user code out there using it. |
I'm not sure my question was clear, sorry.
The general idea is that many package developers have had to write such glue code, and if we put it in a single place it will be easier to maintain and optimize |
This would also allow a clean switch from symbol-based to ADTypes.jl-based backend specification, although symbols can still be supported if necessary. Related: |
LogDensityProblemsAD already supports ADTypes (this functionality is eg used by Turing). |
True, what I meant is that it supports ADTypes by falling back on symbols If you wanna give a shot to DifferentiationInterface, it would probably become the other way around, symbols being translated into ADTypes |
@gdalle: Again, I am happy to expose unifying interfaces in this package. We can even use it as a fallback under the hood by translating ADTypes. @devmotion: We probably should replace the examples in the README and the manual with ADTypes at some point. |
If you want I can open a demo PR changing one backend, so that you see what it would look like? E.g. ForwardDiff? |
Yes, PRs are always welcome. |
For the reason specified in my comment #29 (review) this would present issues for Enzyme users until DI supports multiple arguments and activity states. |
As you may know, @adrhill and I are putting the finishing touches to an AD interface package:
One of our goals is to make life easier for everyone who ever had to write one package extension per AD backend. It seems that this is the case for you @tpapp, and that LogDensityProblemsAD.jl falls into the spectrum of cases we cover (one array in, one scalar out).
Would you like to try it out as a potential tool for simplification? Happy to help if that's the case.
Related:
The text was updated successfully, but these errors were encountered: