gdalle / DifferentiationInterface.jl

An interface to various automatic differentiation backends in Julia.

Home Page:https://gdalle.github.io/DifferentiationInterface.jl/DifferentiationInterface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing dispatch for `prepare_pullback_aux`?

Vaibhavdixit02 opened this issue · comments

In my testing currently, FastDifferentitation backend throws

ERROR: MethodError: no method matching prepare_pullback_aux(::OptimizationDIExt.var"#28#40"{}, ::AutoFastDifferentiation, ::Vector{…}, ::DifferentiationInterface.PullbackFast)

Closest candidates are:
  prepare_pullback_aux(::Any, ::Any, ::Any, ::Any, ::DifferentiationInterface.PullbackSlow)
   @ DifferentiationInterface ~/.julia/packages/DifferentiationInterface/6jgZI/src/pullback.jl:34
  prepare_pullback_aux(::Any, ::Any, ::Any, ::DifferentiationInterface.PullbackSlow)
   @ DifferentiationInterface ~/.julia/packages/DifferentiationInterface/6jgZI/src/pullback.jl:30

Stacktrace:
  [1] prepare_pullback(f::Function, backend::AutoFastDifferentiation, x::Vector{Float64})
    @ DifferentiationInterface ~/.julia/packages/DifferentiationInterface/6jgZI/src/pullback.jl:23
  [2] prepare_gradient(f::Function, backend::AutoFastDifferentiation, x::Vector{Float64})
    @ DifferentiationInterface ~/.julia/packages/DifferentiationInterface/6jgZI/src/gradient.jl:22

(this is prepare_gradient call)

I presumably missed a spot somewhere when I deactivated pullbacks for FastDifferentiation.
Once #131 is fixed I can reactivate them, in the meantime this particular bug will be fixed on main in an hour or so

Can you give me a fuller code example? It's weird this doesn't get caught in tests

Yeah I cannot reproduce, gonna need a more detailed example

julia> using DifferentiationInterface

julia> import FastDifferentiation

julia> prepare_gradient(sum, AutoFastDifferentiation(), [1.0]);  # this works

Closing, if you have a MWE feel free to open a new issue