SciML / SciMLSensitivity.jl

A component of the DiffEq ecosystem for enabling sensitivity analysis for scientific machine learning (SciML). Optimize-then-discretize, discretize-then-optimize, adjoint methods, and more for ODEs, SDEs, DDEs, DAEs, etc.
https://docs.sciml.ai/SciMLSensitivity/stable/
Other
333 stars 70 forks source link

ReverseDiffAdjoint fails on implicit solvers #581

Closed frankschae closed 6 months ago

frankschae commented 2 years ago

MWE:

using OrdinaryDiffEq, Zygote
using DiffEqSensitivity, Test, ForwardDiff

p = rand(3)

function dudt(u, p, t)
    u .* p
end

function loss(p)
    prob = ODEProblem(dudt, [3.0, 2.0, 1.0], (0.0, 1.0), p)
    sol = solve(prob, RadauIIA5(), dt=0.01, sensealg=ReverseDiffAdjoint())
    sum(abs2, Array(sol))
end
Zygote.gradient(loss, p)

Stacktrace:

Click to expand ``` ERROR: MethodError: ReverseDiff.TrackedReal{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ReverseDiff.TrackedArray{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}}}(::ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}) is ambiguous. Candidates: (T::Type{<:Real})(x::ForwardDiff.Dual) in Tracker at /Users/frank/.julia/packages/Tracker/9xWLl/src/lib/real.jl:110 ReverseDiff.TrackedReal{V, D, O}(value) where {V, D, O} in ReverseDiff at /Users/frank/.julia/packages/ReverseDiff/c21a6/src/tracked.jl:56 Possible fix, define ReverseDiff.TrackedReal{V, D, O}(::ForwardDiff.Dual) where {V, D, O} Stacktrace: [1] convert(#unused#::Type{ReverseDiff.TrackedReal{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ReverseDiff.TrackedArray{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}}}}, x::Int64) @ ReverseDiff ~/.julia/packages/ReverseDiff/c21a6/src/tracked.jl:264 [2] oftype(x::ReverseDiff.TrackedReal{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ReverseDiff.TrackedArray{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}}}, y::Int64) @ Base ./essentials.jl:396 [3] zero(x::ReverseDiff.TrackedReal{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ReverseDiff.TrackedArray{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ReverseDiff.TrackedReal{Float64, Float64, Nothing}, 3}}}}) @ Base ./number.jl:296 [4] partials @ ~/.julia/packages/ForwardDiff/wAaVJ/src/dual.jl:100 [inlined] [5] partials @ ~/.julia/packages/ForwardDiff/wAaVJ/src/dual.jl:105 [inlined] [6] (::ForwardDiff.var"#partials_wrap#102"{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{.. @ ForwardDiff ~/.julia/packages/ForwardDiff/wAaVJ/src/jacobian.jl:118 [7] _broadcast_getindex_evalf @ ./broadcast.jl:670 [inlined] [8] _broadcast_getindex @ ./broadcast.jl:643 [inlined] [9] getindex @ ./broadcast.jl:597 [inlined] [10] macro expansion @ ./broadcast.jl:961 [inlined] [11] macro expansion @ ./simdloop.jl:77 [inlined] [12] copyto! @ ./broadcast.jl:960 [inlined] [13] copyto! @ ./broadcast.jl:913 [inlined] [14] materialize! @ ./broadcast.jl:871 [inlined] [15] materialize! @ ./broadcast.jl:868 [inlined] [16] extract_jacobian!(#unused#::Type{ForwardDiff.Tag{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vec... @ ForwardDiff ~/.julia/packages/ForwardDiff/wAaVJ/src/jacobian.jl:119 [17] vector_mode_jacobian(f::SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,.. @ ForwardDiff ~/.julia/packages/ForwardDiff/wAaVJ/src/jacobian.jl:151 [18] jacobian @ ~/.julia/packages/ForwardDiff/wAaVJ/src/jacobian.jl:21 [inlined] [19] jacobian @ ~/.julia/packages/ForwardDiff/wAaVJ/src/jacobian.jl:19 [inlined] [20] #forwarddiff_color_jacobian#16 @ ~/.julia/packages/SparseDiffTools/JTyJq/src/differentiation/compute_jacobian_ad.jl:113 [inlined] [21] jacobian_autodiff(f::Function, x::ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, odefun::Function, alg::RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/JNTZN/src/derivative_wrappers.jl:55 [22] jacobian @ ~/.julia/packages/OrdinaryDiffEq/JNTZN/src/derivative_wrappers.jl:84 [inlined] [23] calc_J @ ~/.julia/packages/OrdinaryDiffEq/JNTZN/src/derivative_utils.jl:110 [inlined] [24] perform_step!(integrator::OrdinaryDiffEq.ODEIntegrator{RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Nothing, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Float64, Float64, Float64, Float64, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, 2, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ODEProblem{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, OrdinaryDiffEq.InterpolationData{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, DiffEqBase.DEStats}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, Float64, OrdinaryDiffEq.PredictiveController, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, OrdinaryDiffEq.DefaultInit}, cache::OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, repeat_step::Bool) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/JNTZN/src/perform_step/firk_perform_step.jl:353 [25] perform_step!(integrator::OrdinaryDiffEq.ODEIntegrator{RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Nothing, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Float64, Float64, Float64, Float64, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, 2, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ODEProblem{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, OrdinaryDiffEq.InterpolationData{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, DiffEqBase.DEStats}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, Float64, OrdinaryDiffEq.PredictiveController, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, OrdinaryDiffEq.DefaultInit}, cache::OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/JNTZN/src/perform_step/firk_perform_step.jl:337 [26] solve!(integrator::OrdinaryDiffEq.ODEIntegrator{RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Nothing, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Float64, Float64, Float64, Float64, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ODESolution{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, 2, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, ODEProblem{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, OrdinaryDiffEq.InterpolationData{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Vector{Float64}, Vector{Vector{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}, OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}}, DiffEqBase.DEStats}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.RadauIIA5ConstantCache{SciMLBase.UDerivativeWrapper{ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, OrdinaryDiffEq.RadauIIA5Tableau{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Matrix{ReverseDiff.TrackedReal{Float64, Float64, Nothing}}}, OrdinaryDiffEq.DEOptions{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Float64, Float64, OrdinaryDiffEq.PredictiveController, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, DataStructures.BinaryHeap{Float64, DataStructures.FasterForward}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}, Nothing, OrdinaryDiffEq.DefaultInit}) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/JNTZN/src/solve.jl:477 [27] __solve(::ODEProblem{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::RadauIIA5{3, true, LinearSolve.GenericLUFactorization{LinearAlgebra.RowMaximum}, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}}) @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/JNTZN/src/solve.jl:5 [28] #solve_call#28 @ ~/.julia/packages/DiffEqBase/vJ79G/src/solve.jl:388 [inlined] [29] solve_up(prob::ODEProblem{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, Tuple{Float64, Float64}, false, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ODEFunction{false, DiffEqSensitivity.var"#_f#281"{ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, sensealg::SensitivityADPassThrough, u0::ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, p::ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, args::RadauIIA5{0, true, Nothing, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}}) @ DiffEqBase ~/.julia/packages/DiffEqBase/vJ79G/src/solve.jl:416 [30] #solve#29 @ ~/.julia/packages/DiffEqBase/vJ79G/src/solve.jl:400 [inlined] [31] (::DiffEqSensitivity.var"#reversediff_adjoint_forwardpass#280"{Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, RadauIIA5{0, true, Nothing, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, ReverseDiffAdjoint, Tuple{}})(_u0::ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, _p::ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}) @ DiffEqSensitivity ~/.julia/dev/DiffEqSensitivity/src/concrete_solve.jl:656 [32] ReverseDiff.GradientTape(f::Function, input::Tuple{Vector{Float64}, Vector{Float64}}, cfg::ReverseDiff.GradientConfig{Tuple{ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}}) @ ReverseDiff ~/.julia/packages/ReverseDiff/c21a6/src/api/tape.jl:207 [33] GradientTape @ ~/.julia/packages/ReverseDiff/c21a6/src/api/tape.jl:204 [inlined] [34] _concrete_solve_adjoint(::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::RadauIIA5{0, true, Nothing, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}, ::ReverseDiffAdjoint, ::Vector{Float64}, ::Vector{Float64}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}}) @ DiffEqSensitivity ~/.julia/dev/DiffEqSensitivity/src/concrete_solve.jl:666 [35] #_solve_adjoint#52 @ ~/.julia/packages/DiffEqBase/vJ79G/src/solve.jl:750 [inlined] [36] #rrule#50 @ ~/.julia/packages/DiffEqBase/vJ79G/src/solve.jl:713 [inlined] [37] chain_rrule_kw @ ~/.julia/packages/Zygote/DkIUK/src/compiler/chainrules.jl:229 [inlined] [38] macro expansion @ ~/.julia/packages/Zygote/DkIUK/src/compiler/interface2.jl:0 [inlined] [39] _pullback @ ~/.julia/packages/Zygote/DkIUK/src/compiler/interface2.jl:9 [inlined] [40] _apply @ ./boot.jl:814 [inlined] [41] adjoint @ ~/.julia/packages/Zygote/DkIUK/src/lib/lib.jl:204 [inlined] [42] _pullback @ ~/.julia/packages/ZygoteRules/AIbCs/src/adjoint.jl:65 [inlined] [43] _pullback @ ~/.julia/packages/DiffEqBase/vJ79G/src/solve.jl:400 [inlined] [44] _pullback(::Zygote.Context, ::DiffEqBase.var"##solve#29", ::ReverseDiffAdjoint, ::Nothing, ::Nothing, ::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:dt,), Tuple{Float64}}}, ::typeof(solve), ::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::RadauIIA5{0, true, Nothing, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}) @ Zygote ~/.julia/packages/Zygote/DkIUK/src/compiler/interface2.jl:0 [45] _apply(::Function, ::Vararg{Any}) @ Core ./boot.jl:814 [46] adjoint @ ~/.julia/packages/Zygote/DkIUK/src/lib/lib.jl:204 [inlined] [47] _pullback @ ~/.julia/packages/ZygoteRules/AIbCs/src/adjoint.jl:65 [inlined] [48] _pullback @ ~/.julia/packages/DiffEqBase/vJ79G/src/solve.jl:395 [inlined] [49] _pullback(::Zygote.Context, ::CommonSolve.var"#solve##kw", ::NamedTuple{(:dt, :sensealg), Tuple{Float64, ReverseDiffAdjoint}}, ::typeof(solve), ::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, false, Vector{Float64}, ODEFunction{false, typeof(dudt), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ::RadauIIA5{0, true, Nothing, typeof(OrdinaryDiffEq.DEFAULT_PRECS), Val{:forward}, true, nothing, Nothing, Rational{Int64}, Rational{Int64}}) @ Zygote ~/.julia/packages/Zygote/DkIUK/src/compiler/interface2.jl:0 [50] _pullback @ ~/Dropbox (MIT)/SciML_issues/DiffEqSensitivity/579/implicit_solver.jl:143 [inlined] [51] _pullback(ctx::Zygote.Context, f::typeof(loss), args::Vector{Float64}) @ Zygote ~/.julia/packages/Zygote/DkIUK/src/compiler/interface2.jl:0 [52] _pullback(f::Function, args::Vector{Float64}) @ Zygote ~/.julia/packages/Zygote/DkIUK/src/compiler/interface.jl:34 [53] pullback(f::Function, args::Vector{Float64}) @ Zygote ~/.julia/packages/Zygote/DkIUK/src/compiler/interface.jl:40 [54] gradient(f::Function, args::Vector{Float64}) @ Zygote ~/.julia/packages/Zygote/DkIUK/src/compiler/interface.jl:75 ```
ChrisRackauckas commented 2 years ago

I'm not sure this one is fixable without big changes to ReverseDiff.jl. We should probably just find a good way to throw an informative error.

ThummeTo commented 8 months ago

Two little updates on that:

(1) this currently fails with a conversion error from Vector{TrackedReal} to TrackedArray:

Stacktrace ``` ERROR: MethodError: Cannot `convert` an object of type Vector{ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}}} to an object of type ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}} Closest candidates are: convert(::Type{T}, ::T) where T<:ReverseDiff.TrackedArray @ ReverseDiff C:\Users\thummeto\.julia\packages\ReverseDiff\UJhiD\src\tracked.jl:270 convert(::Type{T}, ::T) where T @ Base Base.jl:84 convert(::Type{T}, ::LinearAlgebra.Factorization) where T<:AbstractArray @ LinearAlgebra C:\Users\thummeto\AppData\Local\Programs\Julia-1.10.0\share\julia\stdlib\v1.10\LinearAlgebra\src\factorization.jl:108 ... Stacktrace: [1] setproperty!(x::OrdinaryDiffEq.RadauIIA5ConstantCache{…}, f::Symbol, v::Vector{…}) @ Base .\Base.jl:40 [2] perform_step!(integrator::OrdinaryDiffEq.ODEIntegrator{…}, cache::OrdinaryDiffEq.RadauIIA5ConstantCache{…}, repeat_step::Bool) @ OrdinaryDiffEq C:\Users\thummeto\.julia\packages\OrdinaryDiffEq\EQy59\src\perform_step\firk_perform_step.jl:376 [3] perform_step!(integrator::OrdinaryDiffEq.ODEIntegrator{…}, cache::OrdinaryDiffEq.RadauIIA5ConstantCache{…}, repeat_step::Bool) @ OrdinaryDiffEq C:\Users\thummeto\.julia\packages\OrdinaryDiffEq\EQy59\src\perform_step\firk_perform_step.jl:344 [inlined] [4] solve!(integrator::OrdinaryDiffEq.ODEIntegrator{…}) @ OrdinaryDiffEq C:\Users\thummeto\.julia\packages\OrdinaryDiffEq\EQy59\src\solve.jl:520 [5] __solve(::ODEProblem{…}, ::RadauIIA5{…}; kwargs::@Kwargs{…}) @ OrdinaryDiffEq C:\Users\thummeto\.julia\packages\OrdinaryDiffEq\EQy59\src\solve.jl:6 [6] __solve @ OrdinaryDiffEq C:\Users\thummeto\.julia\packages\OrdinaryDiffEq\EQy59\src\solve.jl:1 [inlined] [7] #solve_call#34 @ DiffEqBase C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:559 [inlined] [8] solve_up(prob::ODEProblem{…}, sensealg::SensitivityADPassThrough, u0::ReverseDiff.TrackedArray{…}, p::ReverseDiff.TrackedArray{…}, args::RadauIIA5{…}; kwargs::@Kwargs{…}) @ DiffEqBase C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:1020 [9] solve_up @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:993 [inlined] [10] solve(prob::ODEProblem{…}, args::RadauIIA5{…}; sensealg::SensitivityADPassThrough, u0::Nothing, p::Nothing, wrap::Val{…}, kwargs::@Kwargs{…}) @ DiffEqBase C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:930 [11] solve @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:920 [inlined] [12] (::DiffEqSensitivity.var"#reversediff_adjoint_forwardpass#293"{…})(_u0::ReverseDiff.TrackedArray{…}, _p::ReverseDiff.TrackedArray{…}) @ DiffEqSensitivity C:\Users\thummeto\.julia\packages\DiffEqSensitivity\Pn9H4\src\concrete_solve.jl:784 [13] ReverseDiff.GradientTape(f::Function, input::Tuple{Vector{…}, Vector{…}}, cfg::ReverseDiff.GradientConfig{Tuple{…}}) @ ReverseDiff C:\Users\thummeto\.julia\packages\ReverseDiff\UJhiD\src\api\tape.jl:207 [14] ReverseDiff.GradientTape(f::Function, input::Tuple{Vector{…}, Vector{…}}, cfg::ReverseDiff.GradientConfig{Tuple{…}}) @ ReverseDiff C:\Users\thummeto\.julia\packages\ReverseDiff\UJhiD\src\api\tape.jl:204 [inlined] [15] _concrete_solve_adjoint(::ODEProblem{…}, ::RadauIIA5{…}, ::ReverseDiffAdjoint, ::Vector{…}, ::Vector{…}, ::SciMLBase.ChainRulesOriginator; kwargs::@Kwargs{…}) @ DiffEqSensitivity C:\Users\thummeto\.julia\packages\DiffEqSensitivity\Pn9H4\src\concrete_solve.jl:794 [16] _concrete_solve_adjoint @ C:\Users\thummeto\.julia\packages\DiffEqSensitivity\Pn9H4\src\concrete_solve.jl:747 [inlined] [17] #_solve_adjoint#67 @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:1447 [inlined] [18] _solve_adjoint @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:1416 [inlined] [19] #rrule#65 @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:1400 [inlined] [20] rrule @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:1396 [inlined] [21] rrule @ C:\Users\thummeto\.julia\packages\ChainRulesCore\DOJhJ\src\rules.jl:140 [inlined] [22] chain_rrule_kw @ C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\chainrules.jl:235 [inlined] [23] macro expansion @ C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [inlined] [24] _pullback @ C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:81 [inlined] [25] _apply(::Function, ::Vararg{Any}) @ Core .\boot.jl:838 [inlined] [26] adjoint @ C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\lib\lib.jl:203 [inlined] [27] _pullback @ C:\Users\thummeto\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:67 [inlined] [28] #solve#40 @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:930 [inlined] [29] _pullback(::Zygote.Context{…}, ::DiffEqBase.var"##solve#40", ::ReverseDiffAdjoint, ::Nothing, ::Nothing, ::Val{…}, ::@Kwargs{…}, ::typeof(solve), ::ODEProblem{…}, ::RadauIIA5{…}) @ Zygote C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [30] _apply(::Function, ::Vararg{Any}) @ Core .\boot.jl:838 [31] adjoint @ C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\lib\lib.jl:203 [inlined] [32] _pullback @ C:\Users\thummeto\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:67 [inlined] [33] solve @ C:\Users\thummeto\.julia\packages\DiffEqBase\s433k\src\solve.jl:920 [inlined] [34] _pullback(::Zygote.Context{…}, ::typeof(Core.kwcall), ::@NamedTuple{…}, ::typeof(solve), ::ODEProblem{…}, ::RadauIIA5{…}) @ Zygote C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [35] loss @ c:\Users\thummeto\Desktop\test.jl:12 [inlined] [36] _pullback(ctx::Zygote.Context{false}, f::typeof(loss), args::Vector{Float64}) @ Zygote C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [37] pullback(f::Function, cx::Zygote.Context{false}, args::Vector{Float64}) @ Zygote C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface.jl:90 [38] pullback @ Zygote C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface.jl:88 [inlined] [39] gradient(f::Function, args::Vector{Float64}) @ Zygote C:\Users\thummeto\.julia\packages\Zygote\jxHJc\src\compiler\interface.jl:147 [40] top-level scope @ c:\Users\thummeto\Desktop\test.jl:15 Some type information was truncated. Use `show(err)` to see complete types. ```

(2) Wasn't the original error only related to implicit solvers that use autodiff=true (well yes, that's the default)? So Jacobian via ForwardDiff. Otherwise, by passing autodiff=false, finite differences are used and it should have worked? Of course AD would be the preferable and faster option for systems with many states.

So a check in solve could look like this:

if sensealg == ReverseDiffAdjoint() &&
   isimplicit(solver) &&
   alg_autodiff(solver) isa AutoForwardDiff
         # error!
end
ChrisRackauckas commented 8 months ago

That could be a ReverseDiff bug? We manually wrap the user's OOP f function https://github.com/SciML/SciMLSensitivity.jl/blob/master/src/concrete_solve.jl#L1265 to do a reduce(vcat, prob.f(args...)) because reduce(vcat, ::Array{TrackedReal})::TrackedArray is supposed to be an AoS -> SoA conversion. If that broke then we should either fix ReverseDiff or find a new way to do that.

ThummeTo commented 8 months ago

The conversion with reduce seems to work as to expect:

using ReverseDiff

a = collect(ReverseDiff.TrackedReal(0.0, 0.0) for i in 1:3) # Vector{ReverseDiff.TrackedReal} (AoS)
b = reduce(vcat, a) # TrackedArray (SoA)

Is it possible that the reduce(vcat, ...) just doesn't get called? Because this is on parameter sensitivity level, it could also be that there is no matching rule in DiffEqBase, but that's just a guess: https://github.com/SciML/DiffEqBase.jl/blob/61041fd00b058e4b6671455ae125f2ccffbc2693/ext/DiffEqBaseReverseDiffExt.jl#L129

HeSchatz commented 8 months ago

When using a scalar/1-element vector state variable, the same type of conversion error also occurs for explicit solvers.

MWE:

using OrdinaryDiffEq, Zygote
using SciMLSensitivity, Test, ForwardDiff

p = rand(1)

function dudt(u, p, t)
    u .* p
end

function loss(p)
    prob = ODEProblem(dudt, [3.0], (0.0, 1.0), p)
    sol = solve(prob, Tsit5(), dt=0.01, sensealg=ReverseDiffAdjoint())
    sum(abs2, Array(sol))
end
Zygote.gradient(loss, p)
Stacktrace ``` ERROR: MethodError: Cannot `convert` an object of type ReverseDiff.TrackedReal{Float64, Float64, ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}}} to an object of type ReverseDiff.TrackedArray{Float64, Float64, 1, Vector{Float64}, Vector{Float64}} Closest candidates are: convert(::Type{T}, ::T) where T<:ReverseDiff.TrackedArray @ ReverseDiff C:\Users\Schatz\.julia\packages\ReverseDiff\UJhiD\src\tracked.jl:270 convert(::Type{T}, ::T) where T @ Base Base.jl:84 convert(::Type{T}, ::LinearAlgebra.Factorization) where T<:AbstractArray @ LinearAlgebra C:\Users\Schatz\.julia\juliaup\julia-1.10.1+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\factorization.jl:108 ... Stacktrace: [1] setproperty!(x::OrdinaryDiffEq.ODEIntegrator{…}, f::Symbol, v::ReverseDiff.TrackedReal{…}) @ Base .\Base.jl:40 [2] initialize!(integrator::OrdinaryDiffEq.ODEIntegrator{…}, cache::OrdinaryDiffEq.Tsit5ConstantCache) @ OrdinaryDiffEq C:\Users\Schatz\.julia\packages\OrdinaryDiffEq\5mSPQ\src\perform_step\low_order_rk_perform_step.jl:726 [3] __init(prob::ODEProblem{…}, alg::Tsit5{…}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{…}; saveat::Tuple{}, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Float64, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{…}, abstol::Nothing, reltol::Nothing, qmin::Rational{…}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, beta1::Nothing, beta2::Nothing, qoldinit::Rational{…}, controller::Nothing, fullnormalize::Bool, failfactor::Int64, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(LinearAlgebra.opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), progress_id::Symbol, userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::@Kwargs{}) @ OrdinaryDiffEq C:\Users\Schatz\.julia\packages\OrdinaryDiffEq\5mSPQ\src\solve.jl:512 [4] __init (repeats 5 times) @ C:\Users\Schatz\.julia\packages\OrdinaryDiffEq\5mSPQ\src\solve.jl:10 [inlined] [5] #__solve#756 @ C:\Users\Schatz\.julia\packages\OrdinaryDiffEq\5mSPQ\src\solve.jl:5 [inlined] [6] __solve @ C:\Users\Schatz\.julia\packages\OrdinaryDiffEq\5mSPQ\src\solve.jl:1 [inlined] [7] solve_call(_prob::ODEProblem{…}, args::Tsit5{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{…}) @ DiffEqBase C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:612 [8] solve_call @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:569 [inlined] [9] #solve_up#42 @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:1064 [inlined] [10] solve_up @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:1050 [inlined] [11] #solve#40 @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:987 [inlined] [12] (::SciMLSensitivity.var"#reversediff_adjoint_forwardpass#378"{…})(_u0::ReverseDiff.TrackedArray{…}, _p::ReverseDiff.TrackedArray{…}) @ SciMLSensitivity C:\Users\Schatz\.julia\packages\SciMLSensitivity\Jk0Zp\src\concrete_solve.jl:1284 [13] ReverseDiff.GradientTape(f::Function, input::Tuple{Vector{…}, Vector{…}}, cfg::ReverseDiff.GradientConfig{Tuple{…}}) @ ReverseDiff C:\Users\Schatz\.julia\packages\ReverseDiff\UJhiD\src\api\tape.jl:207 [14] GradientTape @ C:\Users\Schatz\.julia\packages\ReverseDiff\UJhiD\src\api\tape.jl:204 [inlined] [15] #_concrete_solve_adjoint#374 @ C:\Users\Schatz\.julia\packages\SciMLSensitivity\Jk0Zp\src\concrete_solve.jl:1296 [inlined] [16] _concrete_solve_adjoint @ C:\Users\Schatz\.julia\packages\SciMLSensitivity\Jk0Zp\src\concrete_solve.jl:1215 [inlined] [17] #_solve_adjoint#64 @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:1521 [inlined] [18] _solve_adjoint @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:1494 [inlined] [19] #rrule#6 @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\ext\DiffEqBaseChainRulesCoreExt.jl:26 [inlined] [20] rrule @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\ext\DiffEqBaseChainRulesCoreExt.jl:22 [inlined] [21] rrule @ C:\Users\Schatz\.julia\packages\ChainRulesCore\hsloW\src\rules.jl:140 [inlined] [22] chain_rrule_kw @ C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\chainrules.jl:235 [inlined] [23] macro expansion @ C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [inlined] [24] _pullback(::Zygote.Context{…}, ::typeof(Core.kwcall), ::@NamedTuple{…}, ::typeof(DiffEqBase.solve_up), ::ODEProblem{…}, ::ReverseDiffAdjoint, ::Vector{…}, ::Vector{…}, ::Tsit5{…}) @ Zygote C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:81 [25] _apply(::Function, ::Vararg{Any}) @ Core .\boot.jl:838 [26] adjoint @ C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\lib\lib.jl:203 [inlined] [27] _pullback @ C:\Users\Schatz\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:67 [inlined] [28] #solve#40 @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:987 [inlined] [29] _pullback(::Zygote.Context{…}, ::DiffEqBase.var"##solve#40", ::ReverseDiffAdjoint, ::Nothing, ::Nothing, ::Val{…}, ::@Kwargs{…}, ::typeof(solve), ::ODEProblem{…}, ::Tsit5{…}) @ Zygote C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [30] _apply(::Function, ::Vararg{Any}) @ Core .\boot.jl:838 [31] adjoint @ C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\lib\lib.jl:203 [inlined] [32] _pullback @ C:\Users\Schatz\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:67 [inlined] [33] solve @ C:\Users\Schatz\.julia\packages\DiffEqBase\4084R\src\solve.jl:977 [inlined] [34] _pullback(::Zygote.Context{…}, ::typeof(Core.kwcall), ::@NamedTuple{…}, ::typeof(solve), ::ODEProblem{…}, ::Tsit5{…}) @ Zygote C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [35] loss @ c:\Users\Schatz\Documents\Promotion\Julia\mwe_reversediff_implicit.jl:12 [inlined] [36] _pullback(ctx::Zygote.Context{false}, f::typeof(loss), args::Vector{Float64}) @ Zygote C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface2.jl:0 [37] pullback(f::Function, cx::Zygote.Context{false}, args::Vector{Float64}) @ Zygote C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface.jl:90 [38] pullback @ C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface.jl:88 [inlined] [39] gradient(f::Function, args::Vector{Float64}) @ Zygote C:\Users\Schatz\.julia\packages\Zygote\jxHJc\src\compiler\interface.jl:147 [40] top-level scope @ c:\Users\Schatz\Documents\Promotion\Julia\mwe_reversediff_implicit.jl:15 Some type information was truncated. Use `show(err)` to see complete types. ```
ThummeTo commented 8 months ago

I haven't had a single-state NeuralODE for a long time, but I can reproduce this: Fails for single-state, works for two (and more) states.