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

Add defer_within_autodiff to EnzymeInterpreter #2254

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jumerckx
Copy link

@jumerckx jumerckx commented Jan 7, 2025

Together with Reactant pr: EnzymeAD/Reactant.jl#490

@@ -909,7 +949,7 @@ function abstract_call_known(

(; fargs, argtypes) = arginfo

if f === Enzyme.within_autodiff
if !(interp.defer_within_autodiff) && f === Enzyme.within_autodiff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? This fundamentally breaks this functionality?

Copy link
Author

@jumerckx jumerckx Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for a Reactant bug: EnzymeAD/Reactant.jl#442 (comment)
Reason being that Reactant uses EnzymeInterpreter as well, while not necessarily doing autodiff.

@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.35%. Comparing base (037dfed) to head (9f54068).
Report is 338 commits behind head on main.

Files with missing lines Patch % Lines
src/compiler/interpreter.jl 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2254      +/-   ##
==========================================
+ Coverage   67.50%   75.35%   +7.84%     
==========================================
  Files          31       56      +25     
  Lines       12668    16736    +4068     
==========================================
+ Hits         8552    12612    +4060     
- Misses       4116     4124       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wsmoses
Copy link
Member

wsmoses commented Jan 16, 2025

@vchuravy can you give this a review before merge

@vchuravy
Copy link
Member

Seems fine.

…_autodiff` to no return true during Reactant compilation.

When this flag is true, `interp.handler` is responsible for handling within_autodiff, or to toggle defer_within_autodiff to false somewhere down the call chain.
@vchuravy vchuravy force-pushed the deferred_within_autodiff branch from 3e37885 to 9f54068 Compare January 17, 2025 19:44
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.

4 participants