JuliaDiff / JuliaDiff/DifferentiationInterface.jl

Implement `Cache` for Enzyme reverse mode

Open
#783 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backend
Dominant language
Julia
Stars
313
Forks
35
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Enzyme reverse-mode scenario in the reported test_differentiation call and the playground.jl location shown in the stack trace. Reproduce the failure with logging enabled, then verify that the cachified scenario succeeds without leaving Julia's REPL unable to resolve get_binding_type.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.