Skip to content

Implement Cache for Enzyme reverse mode #783

@gdalle

Description

@gdalle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRelated to one or more autodiff backends

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions