feat: Add reverse/forward counterparts#1036
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1036 +/- ##
==========================================
+ Coverage 98.21% 98.94% +0.72%
==========================================
Files 138 117 -21
Lines 8131 5955 -2176
==========================================
- Hits 7986 5892 -2094
+ Misses 145 63 -82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gdalle
left a comment
There was a problem hiding this comment.
Thank you for getting this started!
Most test failures are a red herring (test CI runs by forcing the highest possible version of each package, which here leads to incompatibilities between the recent OrderedCollections v2.0 and the not-yet-updated DataFrames)
|
I think I addressed everything:
Let me know if anything needs further adjustment! |
|
okay think i got everything again |
gdalle
left a comment
There was a problem hiding this comment.
LGTM except
- the warnings to remove
- the test failures for Zygote and ReverseDiff
- the missing coverage
gdalle
left a comment
There was a problem hiding this comment.
Thanks, sorry for the long-winded review!
| function DI.forward_counterpart( | ||
| ::AutoEnzyme{ | ||
| <:ReverseMode{ | ||
| ReturnPrimal, RuntimeActivity, StrongZero, ABI, Holomorphic, ErrIfFuncWritten, |
There was a problem hiding this comment.
There was a problem hiding this comment.
I can author an upstream PR -- that work for you @gdalle?
There was a problem hiding this comment.
Yeah I have already mentioned it above in the PR, but DI uses these internals at other points cause it definitely needs them. We'll upstream all we can to EnzymeCore, feel free to get the ball rolling @rsenne and I'll follow up
PR to add the forward/backward counterparts discussed. I wasn't sure if for a generic backend if there was no reasonable counterpart to return e.g., if one did
reverse_counterpart(AutoForwardDiff)if the code should throw an ArgumentError or if it should just return the backend. I opted for the formerResolves #1025.