Skip to content

[BREAKING] Force use of Tangents in pushforward, pullback and hvp#455

Merged
gdalle merged 12 commits intomainfrom
gd/tangent
Sep 7, 2024
Merged

[BREAKING] Force use of Tangents in pushforward, pullback and hvp#455
gdalle merged 12 commits intomainfrom
gd/tangent

Conversation

@gdalle
Copy link
Copy Markdown
Member

@gdalle gdalle commented Sep 7, 2024

Warning

Breaking change:

  • The operators pushforward, pullback and hvp no longer accept plain objects as dx or dy: this argument must now be wrapped into Tangents.

Tip

Since Tangents becomes part of the public API, this also allows users to leverage batch mode directly. At the moment it is only useful with ForwardDiff, but we're working on adding Enzyme support.

DI source

  • Force pushforward, pullback and hvp to use Tangents and remove the fallbacks.
  • Change the Tangents constructor so that it accepts Vararg, also modify its second type parameter
  • Add tuple-like functionalities to Tangents like indexing and map

DI extensions

  • Adapt operators for each backend to the new Tangents constructor

DI docs

  • Make Tangents part of the public API, enabling users to access batch mode

DIT source

  • Modify Scenario constructors so that they only accept Tangents for pushforward, pullback and hvp
  • Adapt all scenarios and scenario modifiers accordingly

@gdalle gdalle linked an issue Sep 7, 2024 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.52%. Comparing base (b2dcdef) to head (3b8537b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #455      +/-   ##
==========================================
- Coverage   98.53%   98.52%   -0.01%     
==========================================
  Files         107      106       -1     
  Lines        4287     4265      -22     
==========================================
- Hits         4224     4202      -22     
  Misses         63       63              
Flag Coverage Δ
DI 98.67% <100.00%> (-0.02%) ⬇️
DIT 98.21% <100.00%> (ø)

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 changed the title Force use of Tangents [BREAKING] Force use of Tangents in pushforward, pullback and hvp Sep 7, 2024
@gdalle gdalle marked this pull request as ready for review September 7, 2024 15:11
@gdalle gdalle merged commit ccf5247 into main Sep 7, 2024
@gdalle gdalle deleted the gd/tangent branch September 7, 2024 15:21
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.

Force use of Tangents for pushforward, pullback and hvp

2 participants