You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EnsembleGPUKernel solve(): reduce host-side overhead (~0.8 s at 2^20 trajectories) #557
At N = 2^20 trajectories, solve(ens, GPUTsit5(), EnsembleGPUKernel(backend, 0.0); ...) spends about 0.8 s on the host, while the Lorenz kernel itself takes milliseconds. This was measured on the KernelAbstractions CPU backend with 16 threads and safetycopy=false, on DiffEqGPU 3.21.2:
Problem preparation (_prepare_kernel_problems, src/solve.jl:207-221 at v3.21.2) takes 0.56–0.59 s and allocates 487 MB. Only about 0.07 s of that is prob_func/remake; the rest is per-element adapt / _kernel_record.
Building 2^20 ODESolutions (src/solve.jl:280-305) takes 0.27–0.45 s.
With the default safetycopy=true, the per-trajectory deepcopy pushes preparation to 1.5–2.3 s.
This dominates host-to-host timings in SciML/SciMLBenchmarks.jl#1847. The low-level vectorized_asolve avoids it but isn't what most users call.
Goal: bring host overhead for the EnsembleGPUKernel path down to a small multiple of the kernel time without changing the public API or the results.
Build the kernel problem records in bulk (one allocation, no per-element adapt).
Construct the returned EnsembleSolution cheaply, e.g. lazily backed by the (ts, us) device/host arrays, as long as sol.u[i].u / sol.u[i].t indexing and existing tests keep working.
Avoid the safetycopydeepcopy when the problem type makes it unnecessary, if that can be done safely.
Done means before/after host-phase timings at N = 2^14…2^20 on the CPU backend, identical endpoint results, and the full GROUP=CPU suite passing.
🤖 Filed by an AI agent: Claude Code (model: claude-opus-5-5[1m]).
Activity
ChrisRackauckas-Claude commentedon Sep 27, 2026
Taking this — Codex CLI 0.157.1, model gpt-6-sol (local job 557-codex on amdci2.julia.csail.mit.edu).
ChrisRackauckas-Claude commentedon Sep 28, 2026
Taking this — Cursor Agent CLI 2026.09.26-dd393fe, model auto (local job 557-cursor on amdci2.julia.csail.mit.edu).