-
Notifications
You must be signed in to change notification settings - Fork 25
Labels
backendRelated to one or more autodiff backendsRelated to one or more autodiff backends
Description
In the Enzyme setups https://github.com/gdalle/DifferentiationInterface.jl/blob/main/DifferentiationInterface/ext/DifferentiationInterfaceEnzymeExt/forward_onearg.jl#L13 it looks like you're using the raw f
. This omits the handling of any memory associated with caches, particularly within closures. To fix this is rather straightforward though, you can just copy SciMLSensitivity. You just do a duplicated on the f
https://github.com/SciML/SciMLSensitivity.jl/blob/master/src/derivative_wrappers.jl#L697 where the duplicated part is just an f_cache = Enzyme.make_zero(f)
copy. To make this safe for repeated application, you need to add a call Enzyme.make_zero!(f_cache)
so its duplicated values are always zero if you reuse it.
gdalle
Metadata
Metadata
Assignees
Labels
backendRelated to one or more autodiff backendsRelated to one or more autodiff backends