SciML / SciML/DiffEqGPU.jl

Support DynamicalODEFunction

Open
#109 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
Julia
Stars
327
Forks
42
Avg merge
14h 13m
Merged PRs (30d)
34

Description

See here. It is trying to get a field f from a DynamicalODEFunction (at least in my case) and this does not exist.

Looks like this particular object has f1 and f2 but not f, but I didn't dig any further than this.

Stack trace below.

julia> @btime solve(𝔢, EnsembleGPUArray(), trajectories=10^4);
ERROR: type DynamicalODEFunction has no field f
Stacktrace:
  [1] getproperty(x::Function, f::Symbol)
    @ Base ./Base.jl:33
  [2] generate_problem(prob::ODEProblem{ArrayPartition{Float32, Tuple{SVector{3, Float32}, SVector{3
, Float32}}}, Tuple{Float32, Float32}, false, SciMLBase.NullParameters, DynamicalODEFunction{false,
ODEFunction{false, DiffEqPhysics.var"#9#17"{var"#43#44", SVector{3, Float32}}, UniformScaling{Bool},
 Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, ODEFunction{false, DiffEqPhysics.var"#11#19"{
var"#43#44", SVector{3, Float32}}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing
, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED),
 Nothing}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Noth
ing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple
{(), Tuple{}}}, SciMLBase.StandardODEProblem}, u0::CUDA.CuArray{Float32, 2}, p::CUDA.CuArray{SciMLBa
se.NullParameters, 2}, jac_prototype::Nothing, colorvec::Nothing)
    @ DiffEqGPU ~/.julia/packages/DiffEqGPU/gGgMY/src/DiffEqGPU.jl:410
  [3] batch_solve_up(ensembleprob::EnsembleProblem{ODEProblem{ArrayPartition{Float32, Tuple{SVector{
3, Float32}, SVector{3, Float32}}}, Tuple{Float32, Float32}, false, SciMLBase.NullParameters, Dynami
calODEFunction{false, ODEFunction{false, DiffEqPhysics.var"#9#17"{var"#43#44", SVector{3, Float32}},
 UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothi
ng, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, ODEFunction{false, Diff
EqPhysics.var"#11#19"{var"#43#44", SVector{3, Float32}}, UniformScaling{Bool}, Nothing, Nothing, Not
hing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLB
ase.DEFAULT_OBSERVED), Nothing}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing,
Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{
}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, var"#7#9", var"#8#10", typeof(S
ciMLBase.DEFAULT_REDUCTION), Nothing}, probs::Vector{ODEProblem{ArrayPartition{Float32, Tuple{SVecto
r{3, Float32}, SVector{3, Float32}}}, Tuple{Float32, Float32}, false, SciMLBase.NullParameters, Dyna
micalODEFunction{false, ODEFunction{false, DiffEqPhysics.var"#9#17"{var"#43#44", SVector{3, Float32}
}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Not
hing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, ODEFunction{false, Di
ffEqPhysics.var"#11#19"{var"#43#44", SVector{3, Float32}}, UniformScaling{Bool}, Nothing, Nothing, N
othing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciM
LBase.DEFAULT_OBSERVED), Nothing}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing
, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Unio
n{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}}, alg::Nothing, ensemblealg::E
nsembleGPUArray, I::UnitRange{Int64}, u0::Matrix{Float32}, p::Matrix{SciMLBase.NullParameters}; kwar
gs::Base.Iterators.Pairs{Symbol, DiffEqGPU.var"#12#18", Tuple{Symbol}, NamedTuple{(:unstable_check,)
, Tuple{DiffEqGPU.var"#12#18"}}})
    @ DiffEqGPU ~/.julia/packages/DiffEqGPU/gGgMY/src/DiffEqGPU.jl:311
  [4] batch_solve(ensembleprob::EnsembleProblem{ODEProblem{ArrayPartition{Float32, Tuple{SVector{3,
Float32}, SVector{3, Float32}}}, Tuple{Float32, Float32}, false, SciMLBase.NullParameters, Dynamical
ODEFunction{false, ODEFunction{false, DiffEqPhysics.var"#9#17"{var"#43#44", SVector{3, Float32}}, Un
iformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing,
 Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, ODEFunction{false, DiffEqP
hysics.var"#11#19"{var"#43#44", SVector{3, Float32}}, UniformScaling{Bool}, Nothing, Nothing, Nothin
g, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase
.DEFAULT_OBSERVED), Nothing}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Not
hing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{},
Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, var"#7#9", var"#8#10", typeof(SciM
LBase.DEFAULT_REDUCTION), Nothing}, alg::Nothing, ensemblealg::EnsembleGPUArray, I::UnitRange{Int64}
; kwargs::Base.Iterators.Pairs{Symbol, DiffEqGPU.var"#12#18", Tuple{Symbol}, NamedTuple{(:unstable_c
heck,), Tuple{DiffEqGPU.var"#12#18"}}})
    @ DiffEqGPU ~/.julia/packages/DiffEqGPU/gGgMY/src/DiffEqGPU.jl:284
  [5] macro expansion
    @ ./timing.jl:287 [inlined]
  [6] __solve(ensembleprob::EnsembleProblem{ODEProblem{ArrayPartition{Float32, Tuple{SVector{3, Floa
t32}, SVector{3, Float32}}}, Tuple{Float32, Float32}, false, SciMLBase.NullParameters, DynamicalODEF
unction{false, ODEFunction{false, DiffEqPhysics.var"#9#17"{var"#43#44", SVector{3, Float32}}, Unifor
mScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Not
hing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, ODEFunction{false, DiffEqPhysi
cs.var"#11#19"{var"#43#44", SVector{3, Float32}}, UniformScaling{Bool}, Nothing, Nothing, Nothing, N
othing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEF
AULT_OBSERVED), Nothing}, UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing
, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}, Base.Iterators.Pairs{Union{}, Union{}, Tupl
e{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, var"#7#9", var"#8#10", typeof(SciMLBas
e.DEFAULT_REDUCTION), Nothing}, alg::Nothing, ensemblealg::EnsembleGPUArray; trajectories::Int64, ba
tch_size::Int64, unstable_check::Function, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, N
amedTuple{(), Tuple{}}})
    @ DiffEqGPU ~/.julia/packages/DiffEqGPU/gGgMY/src/DiffEqGPU.jl:201
  [7] #solve#61
    @ ~/.julia/packages/DiffEqBase/oe7VF/src/solve.jl:94 [inlined]
  [8] var"##core#311"()
    @ Main ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:479
  [9] var"##sample#312"(__params::BenchmarkTools.Parameters)
    @ Main ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:485
 [10] _run(b::BenchmarkTools.Benchmark, p::BenchmarkTools.Parameters; verbose::Bool, pad::String, kw
args::Base.Iterators.Pairs{Symbol, Integer, NTuple{4, Symbol}, NamedTuple{(:samples, :evals, :gctria
l, :gcsample), Tuple{Int64, Int64, Bool, Bool}}})
    @ BenchmarkTools ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:98
 [11] #invokelatest#2
    @ ./essentials.jl:710 [inlined]
 [12] #run_result#45
    @ ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:33 [inlined]
 [13] run(b::BenchmarkTools.Benchmark, p::BenchmarkTools.Parameters; progressid::Nothing, nleaves::F
loat64, ndone::Float64, kwargs::Base.Iterators.Pairs{Symbol, Integer, NTuple{5, Symbol}, NamedTuple{
(:verbose, :samples, :evals, :gctrial, :gcsample), Tuple{Bool, Int64, Int64, Bool, Bool}}})
    @ BenchmarkTools ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:116
 [14] #warmup#54
    @ ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:168 [inlined]
 [15] warmup(item::BenchmarkTools.Benchmark)
    @ BenchmarkTools ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:168
 [16] top-level scope
    @ ~/.julia/packages/BenchmarkTools/Rqvks/src/execution.jl:565

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/DiffEqGPU.jl:410 in generate_problem, where the stack trace shows the unsupported field access, and inspect how DynamicalODEFunction exposes f1 and f2. Reproduce the EnsembleGPUArray solve shown in the issue; done means that this problem type no longer fails with a missing-field error.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.