Fix GPU compat of sparse dae solvers#3073
Conversation
|
This should get rebased for the new GPU testing infra |
7f7cfa5 to
7d1d6a1
Compare
|
I rebased. Still waiting for the merge in CUDA though. Is there anything else to do for the "new GPU testing infra" or did you just mean the different ENV variable based testset selection? |
|
Rebase, I had to spend a bit of time fixing the machines. It should all be good now though. |
|
CUDA PR was merged. Now we still need:
Even with those fixes locally applied I see new problems with this PR (forward diff incompatible f? weird). Will investigate parallel to the listed todos... |
|
ArrayInterface tagged. |
Preserve in-progress GPU DAE test harness before merging upstream/master.
# Conflicts: # lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl # lib/OrdinaryDiffEqCore/test/runtests.jl # lib/OrdinaryDiffEqRosenbrock/src/OrdinaryDiffEqRosenbrock.jl # lib/OrdinaryDiffEqSDIRK/src/OrdinaryDiffEqSDIRK.jl # lib/OrdinaryDiffEqSDIRK/src/sdirk_caches.jl # test/gpu/Project.toml
After the upstream SDIRK rewrite unified ImplicitEuler into the _PureSDIRKAlg alg_cache, algebraic_vars was computed via `[all(iszero, x) for x in eachcol(f.mass_matrix)]`, which triggers scalar indexing on GPU arrays and errors. Replace with the GPU-safe, Diagonal-aware find_algebraic_vars_eqs (behavior-preserving on CPU). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- CUDSS compat 0.6.7 -> 0.7,0.8 (CUDSS >=0.7 targets modular CUDA 6.2; the whole external stack now resolves clean from the registry: CUDA 6.2, CUDSS 0.7, LinearSolve 3.87 with the modular cuSPARSE fix) - list all in-repo OrdinaryDiffEq* libs + DiffEqBase under [deps]+[sources] so the env instantiates from paths without manual Pkg.develop - drop redundant test/gpu/simple_dae.jl (superseded by dae_tests.jl) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7d1d6a1 to
e3e6434
Compare
|
Heads up: the GPU tests this PR adds/edits live in the root I opened #3813 to restore a top-level
Either way, since #3813 turns the lane back on, please double-check the |
|
Rebase onto latest master for #3813 |
otherwise the first failing GPU test file will prevent others from beeing run
testfiles dependet on more broad exports from OrdinaryDiffEq, imports now explicit
|
Full testset runs through now, other GPU tests are failing though. My debuggin tests took ~20 Minutes (mainly compiling of many different algs). Is that fine for CI or should i thin it down to 1-2 solvers per class? |
|
A few things to note: this PR moves That requirement is what led me to add There are also a few failing CIs, all of which look unrelated / pre-existing:
|
|
This needs a rebase for the explicit imports QA changes. I can handle it on Friday if you don't get around to it. |
|
The test seemed to work, it just needs the new docker so the machine won't segfault, but I'll merge given it was working. |
This PR attempts to make (most) of the sparse DAE solvers GPU compatible. The main changes are:
find_algebraic_vars_eqsfunction to OrdinaryDiffEqCoreThis PR needs JuliaGPU/CUDA.jl#3032 to slice into the sparse jacobians.
The tests in the
simple_dae.jlscript in the GPU tests. Currently, those are more like a debug script. I define a custom test-system and execute it with all kinds of algorithms. The tests compare:Diagonalmass matrices (non-diagonal are much harder to support)I would like input by the maintainers on how the tests should look like. Currently I see several problems:
CUDSSonly supports LU factorization on CSR. So the tests currently compare CSC to CPU with Krylov and CSR to CPU with default linsolve.Algorithm overview
Fully working
ROS2, ROS3, ROS3PRL, ROS3PRL2, Rodas3, Scholz4_7, ROS34PW3, RosShamp4, Veldd4, Velds4, GRK4T, GRK4A,
Ros4LStab, Rodas4, Rodas42, Rodas4P, Rodas4P2, ROK4a, Rodas5, Rodas5P, Rodas5Pe, Rodas5Pr, Rodas6P,
ImplicitEuler, SDIRK2, ABDF2, QNDF1, QBDF1, Trapezoid
CSC path with elevated errors (Krylov vs direct LU accuracy)
These pass but need relaxed
csc_tol. The dense andCSRjacobian paths are fine:Rosenbrock23, ROS2PR, ROS2S, ROS34PW2, ROS34PRw, Cash4, Hairer4, Hairer42, QNDF2, QBDF2
Working, but solver is a poor fit for this DAE problem
GPU correctly reproduces the CPU result, but the solver itself diverges from the Rodas5P reference:
ROS3PR, ROS3P, ROS34PW1a, ROS34PW1b, QBDF1
Special case: Rosenbrock32/CSC: GPU and CPU Krylov agree, but the combination gives catastrophic
errors vs the reference. Effectively unusable with CSC.
Not yet working (require code changes)
The following algorithms fail and I consider them out of scope of this PR since they'd require substantial work
Rodas23W,Rodas3PScalar indexing incalculate_interpoldiff!QNDF,QBDFDeviceMemory error in LinAlg (somemul!call within the step)FBDFScalar indexing inreinitFBDF!RadauIIA3/5/9,AdaptiveRadaulots of problemsChecklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Add any other context about the problem here.