-
-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Description
using OrdinaryDiffEq
using DiffEqSensitivity
function fb(du,u,p,t)
du[1] = dx = p[1]*u[1] - p[2]*u[1]*u[2]*t
du[2] = dy = -p[3]*u[2] + t*p[4]*u[1]*u[2]
end
p = [1.5,1.0,3.0,1.0]; u0 = [1.0;1.0]
prob = ODEProblem(fb,u0,(0.0,10.0),p)
sol = solve(prob,Tsit5(),abstol=1e-14,reltol=1e-14)
t = 0.0:0.5:10.0
function dg(out,u,p,t,i)
(out.=2.0.-u)
end
_,easy_res3 = adjoint_sensitivities(sol,Tsit5(),dg,t,abstol=1e-14,
reltol=1e-14,
sensealg=InterpolatingAdjoint(autojacvec=DiffEqSensitivity.EnzymeVJP())) #works
_,easy_res3 = adjoint_sensitivities(sol,Tsit5(),dg,t,abstol=1e-14,
reltol=1e-14,
sensealg=InterpolatingAdjoint(autodiff=false)) #crashes to desktop
_,easy_res3 = adjoint_sensitivities(sol,Tsit5(),dg,t,abstol=1e-14,
reltol=1e-14,
sensealg=InterpolatingAdjoint(autojacvec=false)) #crashes to desktop
When I step through it with a debugger it works fine.
It then does not go into this branch as Chris suggested
https://github.com/SciML/DiffEqSensitivity.jl/blob/master/src/adjoint_common.jl#L125
julia> versioninfo()
Julia Version 1.7.0-beta3.0
Commit e76c9dad42 (2021-07-07 08:12 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: AMD Ryzen 9 5900X 12-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.0 (ORCJIT, znver3)
Environment:
JULIA_PKG_DEVDIR = C:/Users/arno/Koofr/dev
JULIA_EDITOR = code
JULIA_NUM_THREADS = 12
Metadata
Metadata
Assignees
Labels
No labels