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

Cache support with ForwardDiff #590

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Cache support with ForwardDiff #590

merged 2 commits into from
Oct 17, 2024

Conversation

gdalle
Copy link
Member

@gdalle gdalle commented Oct 17, 2024

Versions

  • Bump DI to v0.6.16

DI extensions

  • ForwardDiff:
    • Define translation mechanism to map Constant(c) to c and Cache(c) to an object like c full of Dual numbers. Use this translation in pushforward.
    • Restrict other operators to Vararg{Constant} instead of Vararg{Context} because putting caches in the closure fc leads to error. So if there is a Cache among the contexts, DI's fallback cascade will kick in.

DI source

  • Revamp Rewrap so that it doesn't force FLoat64 when Dual numbers are passed: it only remembers the annotation Cache or Constant and applies it. This is important for second-order ForwardDiff.

DI tests

  • ForwardDiff: Test cachified scenarios.

@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.63%. Comparing base (40b629d) to head (cff6e75).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #590      +/-   ##
==========================================
+ Coverage   97.55%   97.63%   +0.08%     
==========================================
  Files         110      110              
  Lines        5360     5377      +17     
==========================================
+ Hits         5229     5250      +21     
+ Misses        131      127       -4     
Flag Coverage Δ
DI 98.74% <100.00%> (+0.12%) ⬆️
DIT 95.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@gdalle gdalle merged commit 75f6abe into main Oct 17, 2024
43 checks passed
@gdalle gdalle deleted the gd/more_cache_support branch October 17, 2024 11:23
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