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

DifferentiationInterface instead of individual backends? #258

Open
gdalle opened this issue Nov 26, 2024 · 3 comments
Open

DifferentiationInterface instead of individual backends? #258

gdalle opened this issue Nov 26, 2024 · 3 comments

Comments

@gdalle
Copy link

gdalle commented Nov 26, 2024

Following our conversation with @lxvm today, opening this issue to keep track of a potential DI integration here (pun intended). What would be the major hurdles?

@ChrisRackauckas
Copy link
Member

I don't think DI has a rules system that applies rules to all backends?

@gdalle
Copy link
Author

gdalle commented Nov 26, 2024

No, for that we would still borrow individual rule systems. But inside of these rules we compute derivatives, and it can be with an arbitrary backend, not only the one we define the rule inside

@lxvm
Copy link
Collaborator

lxvm commented Nov 26, 2024

As @gdalle said, we would have to implement rules in each rules system, such as ChainRules.jl, but perhaps these could all call a single implementation of the pullback/pushforward. Then I would have to implement the pushback/pullforward using DI with a backend selected with the pre-existing sensealg keyword in the init function. As for hurdles, I think they include implementing the Leibniz integral rule for derivatives w.r.t. parameters and the limits of integration for all the integral function APIs. Few of the algorithms support a discretize then differentiate approach, and the rest only work with differentiate then discretize. Our broken derivative tests are a good place to track progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants