Closed yadmtr closed 2 years ago
This line https://github.com/SciML/DiffEqSensitivity.jl/blob/70f61d8a69d8cfd05beb257b93fceef9462c5f91/src/concrete_solve.jl#L72 seems to call isgpu
defined here https://github.com/SciML/DiffEqSensitivity.jl/blob/3a6cad542aa8143a76e2a6e928ad90e98f361a55/src/require.jl#L1 which looks pretty boolean.
If I run the example locally, I get a different line number: In fact it's line 92 above, too.
julia> Flux.train!(loss, Flux.params(deq), ((X, Y),), opt)y
ERROR: TypeError: non-boolean (Nothing) used in boolean context
Stacktrace:
[1] _concrete_solve_adjoint(::SteadyStateProblem{Matrix{Float32}, false, Vector{Float32}, ODEFunction{false, var"#dudt#8"{DeepEquilibriumNetwork{Chain{Tuple{Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}, Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}, Vector{Float32}, Flux.var"#64#66"{Chain{Tuple{Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}, Dense{typeof(identity), Matrix{Float32}, Vector{Float32}}}}}, Tuple{DynamicSS{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, Float32, Float32, Float64}}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}, Matrix{Float32}}, 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{}}}}, ::DynamicSS{Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, Float32, Float32, Float64}, ::Nothing, ::Matrix{Float32}, ::Vector{Float32}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ DiffEqSensitivity ~/.julia/packages/DiffEqSensitivity/Kg0cc/src/concrete_solve.jl:92
[2] _concrete_solve_adjoint
@ ~/.julia/packages/DiffEqSensitivity/Kg0cc/src/concrete_solve.jl:72 [inlined]
which is this https://github.com/SciML/DiffEqSensitivity.jl/blob/70f61d8a69d8cfd05beb257b93fceef9462c5f91/src/concrete_solve.jl#L92 , and ez
is defined just above by an if
statement that can return nothing
:
julia> ez = if false
try
Enzyme.autodiff(Enzyme.Duplicated(du, du),
u0,p,prob.tspan[1]) do out,u,_p,t
f(out, u, _p, t)
nothing
end
true
catch
false
end
end
julia> ez === nothing
true
So that's the issue, I presume.
Thanks for the report. This was fixed in https://github.com/SciML/DiffEqSensitivity.jl/pull/551 with a bunch of new tests.
Please help me to understand the cause of the error when running the DEQ example from Julia's blog (Deep Equilibrium Models)
this code
throws the following error on line (
JuliaFlux.train!(loss, Flux.params(deq), ((X, Y),), opt)
)Operating System: Windows 10 Julia 1.6.5 VScode 1.63.2 Pkg.status