-
-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
In Enzyme 0.13 runtime activity is now enabled in the ReverseMode
type explicitly. For instance with ADtypes it would be done with
OptimizationFunction(f, AutoEnzyme(;mode=set_runtime_activity(Reverse)))
However, this isn't being respected in OptimizationEnzymeExt
where Reverse
and Forward
are hardcoded.
For example
OptimizationBase.jl/ext/OptimizationEnzymeExt.jl
Lines 98 to 113 in 1ebca6f
if g == true && f.grad === nothing | |
function grad(res, θ, p = p) | |
Enzyme.make_zero!(res) | |
Enzyme.autodiff(Enzyme.Reverse, | |
Const(firstapply), | |
Active, | |
Const(f.f), | |
Enzyme.Duplicated(θ, res), | |
Const(p) | |
) | |
end | |
elseif g == true | |
grad = (G, θ, p = p) -> f.grad(G, θ, p) | |
else | |
grad = nothing | |
end |
forces Enzyme.Reverse
regardless of the passed mode.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working