Skip to content

Conversation

@avik-pal
Copy link
Collaborator

@avik-pal avik-pal commented Nov 3, 2025

fixes #1821

src/Enzyme.jl Outdated
mode::CMode, f::FA, args::Vararg{Annotation,Nargs}
) where {CMode<:Mode,FA<:Annotation,Nargs}
# need to guess the correct activity here. Execute the function, we will DCE it
res = call_with_reactant(f.val, [x.val for x in args]...)
Copy link
Member

Choose a reason for hiding this comment

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

er, not always -- if f mutates this is wrong

Copy link
Member

Choose a reason for hiding this comment

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

the slightly more ideal case would be calling like https://github.com/EnzymeAD/Enzyme.jl/blob/bc031934aa2deefdcd3be139e4ad9a28e3692d14/src/typeutils/inference.jl#L73, except with our interpreter

@avik-pal avik-pal force-pushed the ap/fix_enzyme_lowering_mlir branch from 3eeb45d to 072cc89 Compare November 3, 2025 21:56
@avik-pal avik-pal marked this pull request as draft November 3, 2025 22:08
avik-pal added a commit to LuxDL/Lux.jl that referenced this pull request Nov 3, 2025
@avik-pal avik-pal force-pushed the ap/fix_enzyme_lowering_mlir branch 2 times, most recently from 58275d7 to be74bb5 Compare November 6, 2025 22:55
@avik-pal avik-pal force-pushed the ap/fix_enzyme_lowering_mlir branch from be74bb5 to 5ab6391 Compare November 7, 2025 02:27
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.

Incorrect activity guessed for ForwardMode

3 participants