Skip to content

test_io_subarray: Synchronize the GPU before handing buffers to MPI - #993

Merged
eschnett merged 1 commit into
masterfrom
claude/ci-failure-io-subarray-fae9b6
Sep 24, 2026
Merged

eschnett merged 1 commit into
masterfrom
claude/ci-failure-io-subarray-fae9b6

Conversation

@eschnett

Copy link
Copy Markdown
Contributor

test/test_io_subarray.jl:52 (the MPI.File.read_all! check) flaked on the ROCm Buildkite job (Julia 1.10, build 1891), with data_read all zeros. The same job passed on the builds before and after it.

On that agent ArrayType is ROCArray, and the fill!(data_read, 0) right before read_all! is an asynchronous kernel. Nothing synchronized before the buffer went to MPI, so the zero-fill could finish after MPI had written the data. The noncollective read above it has no fill!, which is why it passed. The other GPU tests already call synchronize() after device-side initialization; this PR adds the missing calls here.

This is not a file-consistency race: each rank reads only the bytes it wrote itself, so the existing comment saying no barrier is needed is correct.

It's a flake, so this can't be reproduced on demand. The evidence will be the ROCm job staying green. On CPU synchronize() does nothing.

The collective read in `test_io_subarray.jl` flaked on the ROCm Buildkite agent
(Julia 1.10), with `data_read` coming back all zeros. There `ArrayType` is
`ROCArray`, and the `fill!(data_read, 0)` just before `MPI.File.read_all!` is an
asynchronous kernel launch; without a `synchronize()` the zero-fill can land
after MPI has written the data. The noncollective read above it has no `fill!`
and passed. Every other GPU-aware test already synchronizes after device-side
initialization; this one did not.

This is not a file-consistency race. Each rank accesses only the bytes it wrote
itself through the same handle, so MPI guarantees sequential consistency
regardless of which ROMIO aggregator physically performs the read, and the
existing comment saying no barrier is needed stands.
@eschnett

Copy link
Copy Markdown
Contributor Author

I'm waiting for the GPU CI tests to run (and hopefully be green!) before merging.

@eschnett
eschnett merged commit 584f4c3 into master Sep 24, 2026
62 checks passed
@eschnett
eschnett deleted the claude/ci-failure-io-subarray-fae9b6 branch September 24, 2026 22:37
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.

2 participants