Skip to content

EnzymeExt ignores runtime activity #115

Closed
@ptiede

Description

@ptiede

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

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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions