DifferentiationInterface.jl icon indicating copy to clipboard operation
DifferentiationInterface.jl copied to clipboard

Implement `Cache` for Enzyme reverse mode

Open gdalle opened this issue 5 months ago • 0 comments

At the moment this seems to break the REPL:

using DifferentiationInterface, DifferentiationInterfaceTest
import DifferentiationInterfaceTest as DIT
using Enzyme: Enzyme

scens = filter(
    s -> (
        DIT.function_place(s) == :out &&
            DIT.operator_place(s) == :in &&
            DIT.operator(s) == :pullback &&
            s.x isa Vector &&
            s.y isa Vector &&
            length(s.x) == 1 &&
            s.tang isa NTuple{2}
    ),
    default_scenarios(;
        include_normal=false, include_constantified=false, include_cachified=true
    ),
)
test_differentiation(AutoEnzyme(; mode=Enzyme.Reverse), scens; logging=true)  # fails

After I run it, the behavior of Julia itself is altered:

julia> a = 1
ERROR: UndefVarError: `get_binding_type` not defined in `Core`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] top-level scope
   @ ~/Documents/GitHub/Julia/DifferentiationInterface.jl/DifferentiationInterface/test/Back/Enzyme/playground.jl:21

gdalle avatar May 06 '25 09:05 gdalle