Skip to content

Honor per-trajectory timesteps in EnsembleGPUArray - #599

Draft
ChrisRackauckas wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas:ensemble-array-trajectory-dt
Draft

ChrisRackauckas wants to merge 2 commits into
SciML:masterfrom
ChrisRackauckas:ensemble-array-trajectory-dt

Conversation

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

🚧 UNREVIEWED — awaiting review by @ChrisRackauckas. Filed by an AI agent running as @ChrisRackauckas; Chris has not seen this.
Harness: Codex Desktop 0.173.0-alpha.4.1 · Model: gpt-6.2-sol
Conversation: local session 01a23c8e-a01f-7d51-8ec1-ea0e28a2e418 (no session URL)

EnsembleGPUArray groups ODE trajectories by the physical dt and tspan returned by prob_func. Each group uses one OrdinaryDiffEq solver and one controller. The ensemble presents trajectory outputs in their original order. A scalar dt passed directly to solve takes precedence. CPU offloads and the single-trajectory path receive explicit adaptive settings.

prob_func = (prob, ctx) -> remake(prob; dt = timesteps[ctx.sim_id])
ensemble_prob = EnsembleProblem(prob; prob_func)
sol = solve(
    ensemble_prob, Tsit5(), EnsembleGPUArray(backend);
    trajectories = length(timesteps), adaptive = false
)

A small set of repeated timesteps retains large GPU batches. Each distinct (tspan, dt) pair needs its own solve within a batch. For fully independent adaptive stepping with compatible methods, use EnsembleGPUKernel.

Verification

  • Julia 1.12.7 CPU regression using test/ensemblegpuarray_trajectory_dt.jl and the OrdinaryDiffEqTsit5 Tsit5 entry point. The base revision reported 22 passed, 17 failed in the first testset. A trajectory requesting 1/16 ran on the 1/8 grid. The patch reported 39/39 in the first testset and 8/8 for differing spans. The tests compare the saved time grids and states against standalone solves and cover CPU offload, the one-trajectory path, and backwards integration.

  • Runic, typos, and git diff --check passed.

  • GROUP=CPU julia +release --project -e 'using Pkg; Pkg.test()' passed on Linux with Julia 1.13.2, including 47/47 assertions in the new test file. The targeted Julia 1.12.7 JLArrays run also passed 47/47. The targeted GROUP=CUDA run on an RTX PRO 6000 passed 47/47.

  • GROUP=QA julia +release --project -e 'using Pkg; Pkg.test()' passed on Linux with Julia 1.13.2 (27/27 QA and 75/75 JET).

  • The full julia +release --project=docs docs/make.jl build exited successfully on Linux with Julia 1.13.2 and CUDA. Documenter rendered the updated manual and resolved the new cross-reference.

  • In a fixed-step CPU-backed solve of 64 scalar decay equations, grouping cut trajectory RHS evaluations from 49,216 to 16,960. The maximum absolute endpoint error was 2.08e-11 with grouping and 6.11e-16 with the smallest timestep applied to all trajectories. The grouped solve used dt = 1/16 for 48 trajectories with rate -1 and dt = 1/128 for 16 trajectories with rate -20 on [0, 1].

Links


🤖 Posted by an AI agent — harness: Codex Desktop 0.173.0-alpha.4.1 · model: gpt-6.2-sol
Conversation: local session 01a23c8e-a01f-7d51-8ec1-ea0e28a2e418 (no session URL)

ChrisRackauckas and others added 2 commits December 3, 2026 15:18
Honor the dt supplied on each trajectory problem and batch trajectories
with a shared physical time grid. Preserve output order and propagate
explicit adaptive settings to CPU solves.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex Desktop 0.173.0-alpha.4.1
Agent-Model: gpt-6.2-sol
Agent-Session: local session 01a23c8e-a01f-7d51-8ec1-ea0e28a2e418 (no session URL)
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Codex <noreply@openai.com>
Agent-Harness: Codex Desktop 0.173.0-alpha.4.1
Agent-Model: gpt-6.2-sol
Agent-Session: local session 01a23c8e-a01f-7d51-8ec1-ea0e28a2e418 (no session URL)
@ChrisRackauckas

Copy link
Copy Markdown
Member Author

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Aligned the indentation with CI's Runic 1.13.0. The whole-repository format check passed locally. The independent adaptive implementation is in a separate draft. Independent adaptive stepping


🤖 Posted by an AI agent — harness: Codex Desktop 0.173.0-alpha.4.1 · model: gpt-6.2-sol
Conversation: local session 01a23c8e-a01f-7d51-8ec1-ea0e28a2e418 (no session URL)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant