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

Add AutoChainRules(ruleconfig) #21

Merged
merged 3 commits into from
Mar 8, 2024
Merged

Add AutoChainRules(ruleconfig) #21

merged 3 commits into from
Mar 8, 2024

Conversation

gdalle
Copy link
Collaborator

@gdalle gdalle commented Mar 8, 2024

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

This PR adds an AutoChainRules AD type. It is built from a RuleConfig to allow calling back into AD with frule_via_ad or rrule_via_ad (see https://juliadiff.org/ChainRulesCore.jl/stable/rule_author/superpowers/ruleconfig.html).
It does not inherit from AbstractForwardMode or AbstractReverseMode because it can be both.

A similar pattern was used in AbstractDifferentiation.jl

https://github.com/JuliaDiff/AbstractDifferentiation.jl/blob/2bc18d07eb5038c997a7f9253bc3f1457124710e/src/backends.jl#L64-L66

@Vaibhavdixit02 Vaibhavdixit02 merged commit 8684021 into SciML:main Mar 8, 2024
3 checks passed
@gdalle gdalle deleted the chainrules branch March 8, 2024 21:20
@gdalle gdalle mentioned this pull request Mar 9, 2024
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

Successfully merging this pull request may close these issues.

2 participants