You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sensitivity for an ODE solve using a Rosenbrock method fails with either sensealg = InterpolatingAdjoint(checkpointing=true) or sensealg = GaussAdjoint(checkpointing=true)
Expected behavior
I expect the combination of options to be compatible; the bug is related to the first call to the time gradient (which is why it only fails for the Rosenbrock methods).
Minimal Reproducible Example 👇
using Zygote, SciMLSensitivity
using OrdinaryDiffEq, Enzyme, Test
p =rand(3)
functiondudt(u, p, t)
u .* p
endfunctionloss(p)
prob =ODEProblem(dudt, [3.0, 2.0, 1.0], (0.0, 1.0), p)
sol =solve(prob, Rodas5(), dt =0.01, saveat =0.1, abstol =1e-5, reltol =1e-5)
sum(abs2, Array(sol))
end
dp = Zygote.gradient(loss, p)[1]
functionloss(p, solver, sensealg)
prob =ODEProblem(dudt, [3.0, 2.0, 1.0], (0.0, 1.0), p)
sol =solve(prob, solver, dt =0.01, saveat =0.1, sensealg = sensealg,
abstol =1e-5, reltol =1e-5)
sum(abs2, Array(sol))
end
dp1 = Zygote.gradient(p ->loss(p, Tsit5(), InterpolatingAdjoint()), p)[1]
dp2 = Zygote.gradient(p ->loss(p, Tsit5(), InterpolatingAdjoint(checkpointing =true)), p)[1]
dp3 = Zygote.gradient(p ->loss(p, Rodas4(), InterpolatingAdjoint()), p)[1]
dp4 = Zygote.gradient(p ->loss(p, Rodas4(), InterpolatingAdjoint(checkpointing =true)), p)[1] #FAILS: ERROR: First call to automatic differentiation for time gradient failed.
dp5 = Zygote.gradient(p ->loss(p, Rodas4(), BacksolveAdjoint()), p)[1]
dp6 = Zygote.gradient(p ->loss(p, Rodas4(), BacksolveAdjoint(checkpointing =true)), p)[1]
dp7 = Zygote.gradient(p ->loss(p, Rodas4(), GaussAdjoint()), p)[1]
dp8 = Zygote.gradient(p ->loss(p, Rodas4(), GaussAdjoint(checkpointing =true)), p)[1] #FAILS: ERROR: First call to automatic differentiation for time gradient failed.
dp9 = Zygote.gradient(p ->loss(p, Tsit5(), GaussAdjoint(checkpointing =true)), p)[1]
@test dp≈dp1 rtol=1e-2@test dp≈dp2 rtol=1e-2@test dp≈dp3 rtol=1e-2@test dp≈dp5 rtol=1e-2@test dp≈dp6 rtol=1e-2@test dp≈dp7 rtol=1e-2@test dp≈dp9 rtol=1e-2
Error & Stacktrace ⚠️
┌ Warning: Automatic AD choice of autojacvec failed in ODE adjoint, failing back to ODE adjoint + numerical vjp
└ @ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\sensitivity_interface.jl:396
ERROR: First call to automatic differentiation for time gradient
failed. This means that the user `f`function is not compatible
with automatic differentiation. Methods to fix this include:1. Turn off automatic differentiation (e.g. Rosenbrock23() becomes
Rosenbrock23(autodiff=false)). More details can be found at
https://docs.sciml.ai/DiffEqDocs/stable/features/performance_overloads/2. Improving the compatibility of `f` with ForwardDiff.jl automatic
differentiation (using tools like PreallocationTools.jl). More details
can be found at https://docs.sciml.ai/DiffEqDocs/stable/basics/faq/#Autodifferentiation-and-Dual-Numbers3. Defining analytical Jacobians and time gradients. More details can be
found at https://docs.sciml.ai/DiffEqDocs/stable/types/ode_types/#SciMLBase.ODEFunction
Note 1: this failure occurred inside of the time gradient function. These
time gradients are only required by Rosenbrock methods (`Rosenbrock23`,
`Rodas4`, etc.) are are done by automatic differentiation w.r.t. the
argument `t`. If your function is compatible with automatic differentiation
w.r.t. `u`, i.e. for Jacobian generation, another way to work around this
issue is to switch to a non-Rosenbrock method.
Note 2: turning off automatic differentiation tends to have a very minimal
performance impact (for this use case, because it's forward mode for a
square Jacobian. This is different from optimization gradient scenarios).
However, one should be careful as some methods are more sensitive to
accurate gradients than others. Specifically, Rodas methods like `Rodas4`
and `Rodas5P` require accurate Jacobians in order to have good convergence,
while many other methods like BDF (`QNDF`, `FBDF`), SDIRK (`KenCarp4`),
and Rosenbrock-W (`Rosenbrock23`) do not. Thus ifusing an algorithm which
is sensitive to autodiff and solving at a low tolerance, please change the
algorithm as well.
MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 1})
Closest candidates are:
(::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat
@ Base rounding.jl:207
(::Type{T})(::T) where T<:Number
@ Core boot.jl:792Float64(::IrrationalConstants.Twoπ)
@ IrrationalConstants C:\Users\Matt Bossart\.julia\packages\IrrationalConstants\vp5v4\src\macro.jl:112...
Stacktrace:
[1] derivative!(df::Vector{…}, f::SciMLBase.TimeGradientWrapper{…}, x::Float64, fx::Vector{…}, integrator::OrdinaryDiffEq.ODEIntegrator{…}, grad_config::Vector{…})
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\derivative_wrappers.jl:97
[2] calc_tderivative!(integrator::OrdinaryDiffEq.ODEIntegrator{…}, cache::OrdinaryDiffEq.Rodas4Cache{…}, dtd1::Float64, repeat_step::Bool)
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\derivative_utils.jl:33
[3] calc_rosenbrock_differentiation!
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\derivative_utils.jl:818 [inlined]
[4] perform_step!(integrator::OrdinaryDiffEq.ODEIntegrator{…}, cache::OrdinaryDiffEq.Rodas4Cache{…}, repeat_step::Bool)
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\perform_step\rosenbrock_perform_step.jl:1891
[5] perform_step!
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\perform_step\rosenbrock_perform_step.jl:1856 [inlined]
[6] solve!(integrator::OrdinaryDiffEq.ODEIntegrator{…})
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\solve.jl:557
[7] #__solve#560
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\solve.jl:7 [inlined]
[8] __solve
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\solve.jl:1 [inlined]
[9] solve_call(_prob::ODEProblem{…}, args::Rodas4{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{…})
@ DiffEqBase C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:612
[10] solve_up(prob::ODEProblem{…}, sensealg::Nothing, u0::Vector{…}, p::Vector{…}, args::Rodas4{…}; kwargs::@Kwargs{…})
@ DiffEqBase C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1080
[11] solve_up
@ C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1066 [inlined]
[12] solve(prob::ODEProblem{…}, args::Rodas4{…}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{…}, kwargs::@Kwargs{…})
@ DiffEqBase C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1003
[13] _adjoint_sensitivities(sol::ODESolution{…}, sensealg::InterpolatingAdjoint{…}, alg::Rodas4{…}; t::StepRangeLen{…}, dgdu_discrete::Function, dgdp_discrete::Nothing, dgdu_continuous::Nothing, dgdp_continuous::Nothing, g::Nothing, abstol::Float64, reltol::Float64, checkpoints::Vector{…}, corfunc_analytical::Nothing, callback::Nothing, kwargs::@Kwargs{…})
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\sensitivity_interface.jl:448
[14] _adjoint_sensitivities
@ C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\sensitivity_interface.jl:405 [inlined]
[15] adjoint_sensitivities(sol::ODESolution{…}, args::Rodas4{…}; sensealg::InterpolatingAdjoint{…}, verbose::Bool, kwargs::@Kwargs{…})
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\sensitivity_interface.jl:397
[16] (::SciMLSensitivity.var"#adjoint_sensitivity_backpass#308"{…})(Δ::ODESolution{…})
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\concrete_solve.jl:625
[17] ZBack
@ C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\chainrules.jl:211 [inlined]
[18] (::Zygote.var"#kw_zpullback#53"{…})(dy::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\chainrules.jl:237
[19] #291
@ C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\lib\lib.jl:206 [inlined]
[20] (::Zygote.var"#2169#back#293"{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:72
[21] #solve#51
@ C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1003 [inlined]
[22] (::Zygote.Pullback{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[23] #291
@ C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\lib\lib.jl:206 [inlined]
[24] (::Zygote.var"#2169#back#293"{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:72
[25] solve
@ C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:993 [inlined]
[26] (::Zygote.Pullback{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[27] loss
@ c:\Users\Matt Bossart\OneDrive - UCB-O365\Desktop\temp_for_mwe\mwe_checkpointing\mwe.jl:18 [inlined]
[28] (::Zygote.Pullback{Tuple{…}, Tuple{…}})(Δ::Float64)
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[29] #63
@ c:\Users\Matt Bossart\OneDrive - UCB-O365\Desktop\temp_for_mwe\mwe_checkpointing\mwe.jl:26 [inlined]
[30] (::Zygote.Pullback{Tuple{…}, Tuple{…}})(Δ::Float64)
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[31] (::Zygote.var"#75#76"{Zygote.Pullback{Tuple{…}, Tuple{…}}})(Δ::Float64)
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface.jl:91
[32] gradient(f::Function, args::Vector{Float64})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface.jl:148
[33] top-level scope
@ c:\Users\Matt Bossart\OneDrive - UCB-O365\Desktop\temp_for_mwe\mwe_checkpointing\mwe.jl:26
caused by: MethodError: no method matching Float64(::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 1})
Closest candidates are:
(::Type{T})(::Real, ::RoundingMode) where T<:AbstractFloat
@ Base rounding.jl:207
(::Type{T})(::T) where T<:Number
@ Core boot.jl:792Float64(::IrrationalConstants.Twoπ)
@ IrrationalConstants C:\Users\Matt Bossart\.julia\packages\IrrationalConstants\vp5v4\src\macro.jl:112...
Stacktrace:
[1] convert(::Type{Float64}, x::ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 1})
@ Base .\number.jl:7
[2] setindex!(A::Vector{Float64}, x::ForwardDiff.Dual{ForwardDiff.Tag{…}, Float64, 1}, i1::Int64)
@ Base .\array.jl:1021
[3] macro expansion
@ C:\Users\Matt Bossart\.julia\packages\FastBroadcast\lSD0E\src\FastBroadcast.jl:162 [inlined]
[4] macro expansion
@ .\simdloop.jl:77 [inlined]
[5] __fast_materialize!
@ C:\Users\Matt Bossart\.julia\packages\FastBroadcast\lSD0E\src\FastBroadcast.jl:161 [inlined]
[6] _fast_materialize!
@ C:\Users\Matt Bossart\.julia\packages\FastBroadcast\lSD0E\src\FastBroadcast.jl:195 [inlined]
[7] fast_materialize!
@ C:\Users\Matt Bossart\.julia\packages\FastBroadcast\lSD0E\src\FastBroadcast.jl:276 [inlined]
[8] _ode_interpolant!(out::Vector{…}, Θ::ForwardDiff.Dual{…}, dt::Float64, y₀::Vector{…}, y₁::Vector{…}, k::Vector{…}, cache::OrdinaryDiffEq.Rodas4ConstantCache{…}, idxs::Nothing, T::Type{…}, differential_vars::Nothing)
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\dense\rosenbrock_interpolants.jl:167
[9] ode_interpolant!
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\dense\generic_dense.jl:961 [inlined]
[10] ode_interpolation!(out::Vector{…}, tval::ForwardDiff.Dual{…}, id::OrdinaryDiffEq.InterpolationData{…}, idxs::Nothing, deriv::Type{…}, p::Vector{…}, continuity::Symbol)
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\dense\generic_dense.jl:897
[11] InterpolationData
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\interp_func.jl:172 [inlined]
[12] #_#474
@ C:\Users\Matt Bossart\.julia\packages\SciMLBase\rR75x\src\solutions\ode_solutions.jl:181 [inlined]
[13] AbstractODESolution (repeats 2 times)
@ C:\Users\Matt Bossart\.julia\packages\SciMLBase\rR75x\src\solutions\ode_solutions.jl:179 [inlined]
[14] split_states(du::Vector{…}, u::Vector{…}, t::ForwardDiff.Dual{…}, S::SciMLSensitivity.ODEInterpolatingAdjointSensitivityFunction{…}; update::Bool)
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\interpolating_adjoint.jl:237
[15] split_states
@ C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\interpolating_adjoint.jl:162 [inlined]
[16] (::SciMLSensitivity.ODEInterpolatingAdjointSensitivityFunction{…})(du::Vector{…}, u::Vector{…}, p::Vector{…}, t::ForwardDiff.Dual{…})
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\interpolating_adjoint.jl:125
[17] ODEFunction
@ C:\Users\Matt Bossart\.julia\packages\SciMLBase\rR75x\src\scimlfunctions.jl:2297 [inlined]
[18] TimeGradientWrapper
@ C:\Users\Matt Bossart\.julia\packages\SciMLBase\rR75x\src\function_wrappers.jl:17 [inlined]
[19] derivative!(df::Vector{…}, f::SciMLBase.TimeGradientWrapper{…}, x::Float64, fx::Vector{…}, integrator::OrdinaryDiffEq.ODEIntegrator{…}, grad_config::Vector{…})
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\derivative_wrappers.jl:95
[20] calc_tderivative!(integrator::OrdinaryDiffEq.ODEIntegrator{…}, cache::OrdinaryDiffEq.Rodas4Cache{…}, dtd1::Float64, repeat_step::Bool)
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\derivative_utils.jl:33
[21] calc_rosenbrock_differentiation!
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\derivative_utils.jl:818 [inlined]
[22] perform_step!(integrator::OrdinaryDiffEq.ODEIntegrator{…}, cache::OrdinaryDiffEq.Rodas4Cache{…}, repeat_step::Bool)
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\perform_step\rosenbrock_perform_step.jl:1891
[23] perform_step!
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\perform_step\rosenbrock_perform_step.jl:1856 [inlined]
[24] solve!(integrator::OrdinaryDiffEq.ODEIntegrator{…})
@ OrdinaryDiffEq C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\solve.jl:557
[25] #__solve#560
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\solve.jl:7 [inlined]
[26] __solve
@ C:\Users\Matt Bossart\.julia\packages\OrdinaryDiffEq\HQ92J\src\solve.jl:1 [inlined]
[27] solve_call(_prob::ODEProblem{…}, args::Rodas4{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{…})
@ DiffEqBase C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:612
[28] solve_up(prob::ODEProblem{…}, sensealg::Nothing, u0::Vector{…}, p::Vector{…}, args::Rodas4{…}; kwargs::@Kwargs{…})
@ DiffEqBase C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1080
[29] solve_up
@ C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1066 [inlined]
[30] solve(prob::ODEProblem{…}, args::Rodas4{…}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{…}, kwargs::@Kwargs{…})
@ DiffEqBase C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1003
[31] _adjoint_sensitivities(sol::ODESolution{…}, sensealg::InterpolatingAdjoint{…}, alg::Rodas4{…}; t::StepRangeLen{…}, dgdu_discrete::Function, dgdp_discrete::Nothing, dgdu_continuous::Nothing, dgdp_continuous::Nothing, g::Nothing, abstol::Float64, reltol::Float64, checkpoints::Vector{…}, corfunc_analytical::Nothing, callback::Nothing, kwargs::@Kwargs{…})
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\sensitivity_interface.jl:448
[32] _adjoint_sensitivities
@ C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\sensitivity_interface.jl:405 [inlined]
[33] adjoint_sensitivities(sol::ODESolution{…}, args::Rodas4{…}; sensealg::InterpolatingAdjoint{…}, verbose::Bool, kwargs::@Kwargs{…})
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\sensitivity_interface.jl:397
[34] (::SciMLSensitivity.var"#adjoint_sensitivity_backpass#308"{…})(Δ::ODESolution{…})
@ SciMLSensitivity C:\Users\Matt Bossart\.julia\packages\SciMLSensitivity\4YtYh\src\concrete_solve.jl:625
[35] ZBack
@ C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\chainrules.jl:211 [inlined]
[36] (::Zygote.var"#kw_zpullback#53"{…})(dy::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\chainrules.jl:237
[37] #291
@ C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\lib\lib.jl:206 [inlined]
[38] (::Zygote.var"#2169#back#293"{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:72
[39] #solve#51
@ C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:1003 [inlined]
[40] (::Zygote.Pullback{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[41] #291
@ C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\lib\lib.jl:206 [inlined]
[42] (::Zygote.var"#2169#back#293"{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\ZygoteRules\M4xmc\src\adjoint.jl:72
[43] solve
@ C:\Users\Matt Bossart\.julia\packages\DiffEqBase\c8MAQ\src\solve.jl:993 [inlined]
[44] (::Zygote.Pullback{…})(Δ::ODESolution{…})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[45] loss
@ c:\Users\Matt Bossart\OneDrive - UCB-O365\Desktop\temp_for_mwe\mwe_checkpointing\mwe.jl:18 [inlined]
[46] (::Zygote.Pullback{Tuple{…}, Tuple{…}})(Δ::Float64)
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[47] #63
@ c:\Users\Matt Bossart\OneDrive - UCB-O365\Desktop\temp_for_mwe\mwe_checkpointing\mwe.jl:26 [inlined]
[48] (::Zygote.Pullback{Tuple{…}, Tuple{…}})(Δ::Float64)
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface2.jl:0
[49] (::Zygote.var"#75#76"{Zygote.Pullback{Tuple{…}, Tuple{…}}})(Δ::Float64)
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface.jl:91
[50] gradient(f::Function, args::Vector{Float64})
@ Zygote C:\Users\Matt Bossart\.julia\packages\Zygote\nsBv0\src\compiler\interface.jl:148
Environment (please complete the following information):
Describe the bug 🐞
The sensitivity for an ODE solve using a Rosenbrock method fails with either
sensealg = InterpolatingAdjoint(checkpointing=true)
orsensealg = GaussAdjoint(checkpointing=true)
Expected behavior
I expect the combination of options to be compatible; the bug is related to the first call to the time gradient (which is why it only fails for the Rosenbrock methods).
Minimal Reproducible Example 👇
Error & Stacktrace⚠️
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
The text was updated successfully, but these errors were encountered: