Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version broke DI tests #106

Open
gdalle opened this issue Jan 17, 2025 · 1 comment
Open

Latest version broke DI tests #106

gdalle opened this issue Jan 17, 2025 · 1 comment

Comments

@gdalle
Copy link
Contributor

gdalle commented Jan 17, 2025

Hi @brianguenter,
Opening this to keep track until I can produce an MWE. The latest version of your package led to this CI failure: https://github.com/JuliaDiff/DifferentiationInterface.jl/actions/runs/12825528680/job/35763670206
It has to do with in-place operators and matrix variables (vectors work fine). Any idea where this could come from?

@gdalle
Copy link
Contributor Author

gdalle commented Jan 17, 2025

The operators concerned are hvp and derivative. Here is an MWE:

julia> using DifferentiationInterface

julia> import FastDifferentiation

julia> f(x) = sum(abs2, x)
f (generic function with 1 method)

julia> backend = AutoFastDifferentiation()
AutoFastDifferentiation()

julia> x, dx, dg = ones(2, 3), ones(2, 3), zeros(2, 3);

julia> hvp!(f, (dg,), backend, x, (dx,))
ERROR: ArgumentError: The in place result array does not have the expected size. Expected size: (6,). Actual size: (2, 3).
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/FastDifferentiation/7my9Z/src/CodeGeneration.jl:199 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/RuntimeGeneratedFunctions/M9ZX8/src/RuntimeGeneratedFunctions.jl:163 [inlined]
 [3] macro expansion
   @ ./none:0 [inlined]
 [4] generated_callfunc
   @ ./none:0 [inlined]
 [5] (::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{…})(::Matrix{…}, ::Vector{…})
   @ RuntimeGeneratedFunctions ~/.julia/packages/RuntimeGeneratedFunctions/M9ZX8/src/RuntimeGeneratedFunctions.jl:150
 [6] hvp!(f::Function, tg::Tuple{…}, prep::DifferentiationInterfaceFastDifferentiationExt.FastDifferentiationHVPPrep{…}, ::AutoFastDifferentiation, x::Matrix{…}, tx::Tuple{…})
   @ DifferentiationInterfaceFastDifferentiationExt ~/.julia/packages/DifferentiationInterface/7HVn3/ext/DifferentiationInterfaceFastDifferentiationExt/onearg.jl:441
 [7] hvp!(::typeof(f), ::Tuple{Matrix{Float64}}, ::AutoFastDifferentiation, ::Matrix{Float64}, ::Tuple{Matrix{Float64}})
   @ DifferentiationInterface ~/.julia/packages/DifferentiationInterface/7HVn3/src/fallbacks/no_prep.jl:139
 [8] top-level scope
   @ ~/Documents/GitHub/Julia/DifferentiationInterface.jl/DifferentiationInterface/test/playground.jl:7
Some type information was truncated. Use `show(err)` to see complete types.

(@di) pkg> st
Status `~/.julia/environments/di/Project.toml`
  [a0c0ee7d] DifferentiationInterface v0.6.29
  [eb9bf01b] FastDifferentiation v0.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant