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

Improve type stability tests, better use of AutoZero backends #437

Merged
merged 5 commits into from
Sep 1, 2024

Conversation

gdalle
Copy link
Member

@gdalle gdalle commented Sep 1, 2024

Idea

  • In DI, we test correctness and performance of the differentiation mechanism
    • correctness for backends from primitive
    • type stability and weird arrays for zero backends
  • In DIT, we test correctness of the tests themselves
    • correctness for ForwardDiff
    • weird arrays for appropriate backends
    • type stability for zero backends

DI source

  • Add zero backends (AutoZeroForward and AutoZeroReverse) alongside backends from primitive (AutoForwardFromPrimitive and AutoReverseFromPrimitive)
  • Replace Returns(y) with a custom ReturnZero(y) to generate a new output every time

DI tests

  • Add type stability tests and weird array tests for zero backends
  • Remove type stability tests for backends from primitive

DIT source

  • Remove zero backends
  • Rename scenario_to_zero into Base.zero
  • Remove conditionals in type stability tests: pushforward activated even if Bool(pushforward_performance) is false and same for pullback
  • Adjust type stability tests and benchmarks so that they work on scenarios with Tangents

DIT tests

  • Remove some correctness tests for zero backends

@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.84%. Comparing base (7c60378) to head (9a62f3f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #437      +/-   ##
==========================================
+ Coverage   93.63%   96.84%   +3.21%     
==========================================
  Files         102      103       +1     
  Lines        4885     4884       -1     
==========================================
+ Hits         4574     4730     +156     
+ Misses        311      154     -157     
Flag Coverage Δ
DI 99.39% <100.00%> (+0.12%) ⬆️
DIT 93.37% <100.00%> (+7.04%) ⬆️

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 Move zero backends to DI itself Improve type stability tests, move AutoZero backends to DI Sep 1, 2024
@gdalle gdalle changed the title Improve type stability tests, move AutoZero backends to DI Improve type stability tests, move AutoZero backends from DIT to DI Sep 1, 2024
@gdalle gdalle changed the title Improve type stability tests, move AutoZero backends from DIT to DI Improve type stability tests, better use of AutoZero backends Sep 1, 2024
@gdalle gdalle marked this pull request as ready for review September 1, 2024 20:28
@gdalle gdalle merged commit ea46769 into main Sep 1, 2024
105 checks passed
@gdalle gdalle deleted the gd/autozero branch September 7, 2024 07:08
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