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

Implement DifferentiateWith to translate between backends #218

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

gdalle
Copy link
Member

@gdalle gdalle commented Apr 26, 2024

Core

  • Define DifferentiateWith(f, backend) to force differentiation with a given backend (exported but unstable API)
  • Rename backend_string into backend_str

Extensions

  • Add ChainRules for DifferentiateWith based on value_and_pushforward + value_and_pullback_split

Tests

  • Improve structure of test set and progress logging (group by scenario type)
  • Add utility for swapping the function inside a scenario
  • Use that to define Zygote-breaking scenarios from the default_scenarios()
  • Check that those scenarios don't error when we use AutoZygote() as an outer backend on DifferentiateWith(f, AutoForwardDiff())

Documentation

  • Document DifferentiateWith (docstring with example + overview)

@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 81.35593% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 95.60%. Comparing base (fac64b7) to head (340bb95).

Files Patch % Lines
...erentiationInterfaceTest/src/scenarios/scenario.jl 33.33% 6 Missing ⚠️
...onInterfaceChainRulesCoreExt/differentiate_with.jl 55.55% 4 Missing ⚠️
DifferentiationInterface/src/utils/exceptions.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #218      +/-   ##
==========================================
- Coverage   95.83%   95.60%   -0.24%     
==========================================
  Files          70       73       +3     
  Lines        3792     3820      +28     
==========================================
+ Hits         3634     3652      +18     
- Misses        158      168      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gdalle gdalle merged commit 66f1fdc into main Apr 26, 2024
5 checks passed
@gdalle gdalle deleted the gd/differentiatewith branch April 26, 2024 06:43
@adrhill
Copy link
Collaborator

adrhill commented Apr 26, 2024

This one is a hit!

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.

3 participants