Repository navigation
Float32 kernel DAE initialization without Float64 (needs SimpleNonlinearSolve 2.14.6) - #562
Conversation
The in-kernel DAE initialization used `SimpleTrustRegion()` (Float64 hyperparameter defaults) and, in the fixed-step kernel, `1.0e-6` Float64 tolerances. A Float32 problem therefore compiled double loads and truncations into the kernel, which fp64-less devices (oneAPI) reject with "Unsupported use of double value". Build the default algorithm with `eltype(u0)` hyperparameters and convert the fixed-step tolerances. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JbJS6cQK5XUwhDpYPQcsM6 Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
Documentation is red on this PR, but the failure isn't caused by this PR. The fix is in its own PR, #563, which turns the two internal-helper docstrings into comments. I kept it separate so this PR stays focused. I didn't re-run the job, since it fails deterministically until #563 is merged. (AI-generated: Claude Code cloud session, model claude-opus-5-5, on behalf of @ChrisRackauckas.) Generated by Claude Code |
|
CUDA Tests (Julia 1) is also red, and this PR didn't cause it either. The only error is in (AI-generated: Claude Code cloud session, model claude-opus-5-5, on behalf of @ChrisRackauckas.) Generated by Claude Code |
| T = eltype(initprob.u0) | ||
| return SimpleTrustRegion(; | ||
| max_trust_radius = zero(T), initial_trust_radius = zero(T), | ||
| step_threshold = T(1.0e-4), expand_factor = T(2) |
There was a problem hiding this comment.
this should instead be fixed upstream
There was a problem hiding this comment.
Done in c55fa85. I dropped the initialization_algorithm workaround, so the file is back to master and the kernels pass plain SimpleTrustRegion() again. SimpleNonlinearSolve compat is now 2.14.6, the version that SciML/NonlinearSolve.jl#1342 now bumps to with the upstream fix. The one DiffEqGPU-side change left is the fixed-step kernel's 1.0e-6 initialization tolerances, which are DiffEqGPU's own Float64 literals.
This PR's CI can't resolve until SimpleNonlinearSolve 2.14.6 is registered. Locally, with both branches dev'd, the new test fails without the upstream change (2 pass / 1 fail) and passes with it (3/3). GROUP=CPU passes in full.
(AI-generated: Claude Code cloud session, model claude-opus-5-5, on behalf of @ChrisRackauckas.)
Generated by Claude Code
Per review, drop the Float32-typed `initialization_algorithm` workaround and require SimpleNonlinearSolve 2.14.6, whose `SimpleTrustRegion()` defaults carry no Float64 (SciML/NonlinearSolve.jl#1342). The fixed-step kernel still converts its `1.0e-6` initialization tolerances to `eltype(u0)`; that Float64 literal is DiffEqGPU's own. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JbJS6cQK5XUwhDpYPQcsM6 Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
|
oneAPI result for the approach. Buildkite build https://buildkite.com/julialang/diffeqgpu-dot-jl/builds/1742 ran on the previous head
Both oneAPI jobs were red on #553 and on master, with "Unsupported use of double value". So making the trust-region hyperparameters and the tolerances Float32 clears oneAPI. The current head gets the same Float32 hyperparameters from upstream (#1342 / SimpleNonlinearSolve 2.14.6) instead of locally. I couldn't read the job logs without a Buildkite login, so this rests on the job status alone. Every red check on (AI-generated: Claude Code cloud session, model claude-opus-5-5, on behalf of @ChrisRackauckas.) Generated by Claude Code |
Bump version to 3.21.6 Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Agent-Harness: Claude Code 2.1.302 Agent-Model: claude-sonnet-5-5 Claude-Session: https://claude.ai/code/session_01VZjwf7Ux9YtTzwHGHMqnsq
Please ignore this draft until reviewed by @ChrisRackauckas.
Depends on SciML/NonlinearSolve.jl#1342 being merged and SimpleNonlinearSolve 2.14.6 being registered. Until then, CI here cannot resolve dependencies.
What changed and why
In-kernel DAE initialization (
ode_solve_kernel/ode_asolve_kernel→gpu_initialization_solve) compiled Float64 into Float32 kernels. oneAPI/SPIR-V rejects that ("Unsupported use of double value"). There were two sources:SimpleTrustRegion()'s Float64 hyperparameter defaults (upstream). These are fixed in SimpleNonlinearSolve by SimpleTrustRegion: no Float64 defaults so Float32 solves carry no doubles NonlinearSolve.jl#1342. Here, the only change is the compat bump:SimpleNonlinearSolve = "2.14.6". Per review, there's no local workaround.1.0e-6initialization tolerances (DiffEqGPU's own). These are noweltype(prob.u0)(1.0e-6).A new test in
test/gpu_kernel_de/conversions.jl("Float32 initialization solve carries no Float64") checks thatcode_typed(DiffEqGPU.gpu_initialization_solve, Tuple{typeof(prob), Nothing, Float32, Float32})contains noFloat64, and that the init solve succeeds.Verification
I ran locally in a scratch environment, with this branch and the #1342 branch (SimpleNonlinearSolve 2.14.6) both dev'd.
The new test, with #1342's
trust_region.jlreverted (still versioned 2.14.6):With #1342:
GROUP=CPU(runtests.jl, Julia 1.12.7) against the #1342 branch:runic --checkis clean. The previous revision passedGROUP=QA(27/27, JET 75/75). This revision only removes code and bumps compat, and I did not re-run QA.Not verified
eltype(prob.u0)(1.0e-6)conversion insideode_solve_kernelisn't covered by the new test, which checks host-side typed IR ofgpu_initialization_solve.ensemblegpuarray_scalar_batch.jl:102CUDA error came in with Fix EnsembleGPUArray scalar parameter packing for batch_size=1 #555 and are fixed by Fix #555 fallout: docs missing_docs and CUDA scalar-indexing test #563. The CUDA Enzymecuda_records.jlfailure is CUDA CI: test/enzyme/cuda_records.jl fails on released CUDACore (Enzyme undef-shadow fill! for non-numeric eltypes) #546 (upstream in CUDACore).For the reviewer to push back on
u0is ever integer-typed,eltype(u0)(1.0e-6)would throw. Every GPU-kernel ODE path I know of uses floatu0.🤖 Generated with Claude Code
https://claude.ai/code/session_01JbJS6cQK5XUwhDpYPQcsM6
(AI-generated: Claude Code cloud session, model claude-opus-5-5, on behalf of @ChrisRackauckas.)
Generated by Claude Code