Skip to content

Commit 15257f9

Browse files
ChrisRackauckas-ClaudeChrisRackauckasclaude
authored
Fix mass-matrix Rosenbrock test and raise downgrade compat floors (#462)
The CPU/JLArrays/OpenCL/QA test groups all errored on the first test, test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl, with a `Cannot convert StaticWOperator{Float64} to StaticWOperator{Float32}` MethodError. The reference CPU bench solve used `dt = 0.1` (Float64) on an otherwise all-Float32 problem (u0, p, tspan, tolerances are Float32, and the GPU solve already uses `dt = 0.1f0`). OrdinaryDiffEqRosenbrock's JacReuseState types its `cached_W` slot from the state eltype (Float32), but with a Float64 dt `calc_W` builds a Float64 StaticWOperator that cannot be stored, erroring at OrdinaryDiffEqDifferentiation derivative_utils.jl:922 (`jac_reuse.cached_W = W`). Use a type-consistent `dt = 0.1f0` for the bench solve; the GPU-vs-reference tolerance assertions are unchanged. Verified locally on Julia 1.12 with GROUP=CPU: the mass-matrix safetestset passes 2/2. Also raise three compat floors so the Downgrade job can get past the ModelingToolkit unsatisfiability it currently hits (StaticArrays was pinned to its 1.9 floor at downgrade, which forced MTK below v11 while the test pins MTK >= 11.17): - StaticArrays 1.9 -> 1.9.14 (MTK 10.18-11 needs StaticArrays >= 1.9.14) - SciMLBase 3 -> 3.1 (lowest MTK compatible with SciMLBase 3 is 11.22; JumpProcesses 9.25.1+ needs SciMLBase >= 3.1.0, excluding 3.0.0) - ModelingToolkit 11.17.0 -> 11.23.0 (test; lowest MTK consistent with the SciMLBase 3.1 and OrdinaryDiffEqRosenbrock 2 floors) Verified the floor set resolves on Julia 1.10 (SciMLBase 3.1.0 / MTK 11.23.0 / StaticArrays 1.9.14 / OrdinaryDiffEqRosenbrock 2.0.0) and that normal latest-version resolution is unaffected (SciMLBase 3.21, MTK 11.28, StaticArrays 1.9.18). The Downgrade job may still hit the pre-existing, maintainer-noted ForwardDiff/LogExpFunctions strict-floor wall, which is an upstream issue tracked separately. Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 373f5b7 commit 15257f9

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ MuladdMacro = "0.2"
5959
OpenCL = "0.10"
6060
Parameters = "0.12, 0.13"
6161
RecursiveArrayTools = "4"
62-
SciMLBase = "3"
62+
SciMLBase = "3.1"
6363
Setfield = "1"
6464
SimpleDiffEq = "1.11"
6565
SimpleNonlinearSolve = "2"
66-
StaticArrays = "1.9"
66+
StaticArrays = "1.9.14"
6767
TOML = "1"
6868
ZygoteRules = "0.2.7"
6969
julia = "1.10"

test/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ForwardDiff = "1"
4141
GPUArraysCore = "0.2"
4242
JLArrays = "0.3"
4343
KernelAbstractions = "0.9"
44-
ModelingToolkit = "11.17.0"
44+
ModelingToolkit = "11.23.0"
4545
OpenCL = "0.10"
4646
Optimization = "5"
4747
OptimizationOptimisers = "0.3"
@@ -50,8 +50,8 @@ OrdinaryDiffEqRosenbrock = "2"
5050
OrdinaryDiffEqSDIRK = "2"
5151
OrdinaryDiffEqStabilizedRK = "2"
5252
SafeTestsets = "0.1"
53-
SciMLBase = "3"
54-
StaticArrays = "1.9"
53+
SciMLBase = "3.1"
54+
StaticArrays = "1.9.14"
5555
Statistics = "1"
5656
StochasticDiffEq = "7"
5757
TOML = "1"

test/gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ monteprob = EnsembleProblem(prob, safetycopy = false)
3535

3636
alg = GPURosenbrock23()
3737

38+
# dt must match the Float32 eltype of u0/p. A Float64 dt makes calc_W build a
39+
# Float64 StaticWOperator that OrdinaryDiffEqRosenbrock's JacReuseState (typed
40+
# from the Float32 state) cannot store, erroring in the cached_W assignment.
3841
bench_sol = solve(
39-
prob, Rosenbrock23(), dt = 0.1, abstol = 1.0f-5, reltol = 1.0f-5,
42+
prob, Rosenbrock23(), dt = 0.1f0, abstol = 1.0f-5, reltol = 1.0f-5,
4043
initializealg = BrownFullBasicInit()
4144
)
4245

0 commit comments

Comments
 (0)