Utilities for splitting and unsplitting mode objects
Fix #1938
I can also add more tests for these mode modifiers in a separate PR, if you're interested
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
Project coverage is 69.75%. Comparing base (
037dfed) to head (16ca52b). Report is 238 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| lib/EnzymeCore/src/EnzymeCore.jl | 90.90% | 1 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #1979 +/- ##
==========================================
+ Coverage 67.50% 69.75% +2.24%
==========================================
Files 31 44 +13
Lines 12668 15971 +3303
==========================================
+ Hits 8552 11140 +2588
- Misses 4116 4831 +715
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
- Flaky Tests Detection - Detect and resolve failed and flaky tests
Silly question: do the tests of EnzymeCore ever run? Because that's where I put these new checks
....good question. Probably we should just add a CI job for EnzymeCore
See https://github.com/EnzymeAD/Enzyme.jl/pull/2009
Since #2009 has been merged by @vchuravy, I have integrated the changes here and I think this one is good to go.
Is anything more needed on my end?
Gentle bump on this one @wsmoses
Hi @wsmoses @vchuravy, any updates on this? It got two approvals already but then more changes were requested every time.
Sorry to be insistent, it is just important for DI. Some operators use split mode instead of combined mode (e.g. pullback when the output is not a number). At the moment, for lack of translating utilities, DI completely disregards the mode information provided by the user in the backend. So even when they give a mode like set_runtime_activity(Reverse), DI will fall back on the default ReverseSplitNoPrimal. It's not ideal but since backend type parameters are Enzyme internals, the only thing I can do is wait for mode translators to be part of your API.
I think we’re still waiting for feedback from Valentin here.
otherwise I personally say change it to be consistent with WithPrimal then merge it
Re DI, perhaps in the interim you should throw an error in those cases (rather than risk incorrect results)
I can't easily throw an error in these cases. Indeed, detecting these cases would require accessing the mode's type parameters, which are Enzyme internals (that's why we made the mode setters in the first place).
@wsmoses I renamed split_mode to Split and combined_mode to Combined as requested. Do you still want to wait for @vchuravy?
@wsmoses is this good to go?
Thanks!