Enzyme.jl icon indicating copy to clipboard operation
Enzyme.jl copied to clipboard

Utilities for splitting and unsplitting mode objects

Open gdalle opened this issue 1 year ago • 3 comments

Fix #1938

I can also add more tests for these mode modifiers in a separate PR, if you're interested

gdalle avatar Oct 17 '24 16:10 gdalle

:warning: Please install the 'codecov app svg image' 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:

codecov-commenter avatar Oct 17 '24 17:10 codecov-commenter

Silly question: do the tests of EnzymeCore ever run? Because that's where I put these new checks

gdalle avatar Oct 18 '24 12:10 gdalle

....good question. Probably we should just add a CI job for EnzymeCore

wsmoses avatar Oct 19 '24 19:10 wsmoses

See https://github.com/EnzymeAD/Enzyme.jl/pull/2009

gdalle avatar Oct 23 '24 08:10 gdalle

Since #2009 has been merged by @vchuravy, I have integrated the changes here and I think this one is good to go.

gdalle avatar Oct 23 '24 14:10 gdalle

Is anything more needed on my end?

gdalle avatar Oct 25 '24 11:10 gdalle

Gentle bump on this one @wsmoses

gdalle avatar Oct 31 '24 16:10 gdalle

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.

gdalle avatar Nov 16 '24 07:11 gdalle

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

wsmoses avatar Nov 16 '24 20:11 wsmoses

Re DI, perhaps in the interim you should throw an error in those cases (rather than risk incorrect results)

wsmoses avatar Nov 16 '24 20:11 wsmoses

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).

gdalle avatar Nov 16 '24 21:11 gdalle

@wsmoses I renamed split_mode to Split and combined_mode to Combined as requested. Do you still want to wait for @vchuravy?

gdalle avatar Nov 23 '24 09:11 gdalle

@wsmoses is this good to go?

gdalle avatar Nov 25 '24 20:11 gdalle

Thanks!

gdalle avatar Nov 26 '24 04:11 gdalle