Skip to content

test(rocm): add a local verify-rocm gate with a shared build-and-generate smoke - #2008

Merged
inureyes merged 2 commits into
mainfrom
feature/issue-1811-verify-rocm
Sep 28, 2026
Merged

inureyes merged 2 commits into
mainfrom
feature/issue-1811-verify-rocm

Conversation

@inureyes

@inureyes inureyes commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Refs #1811, #1801.

make verify is Metal-only: verify-clippy and verify-test carry --features metal,accelerate, so it does not run on this host at all. ROCm had only the single verify-test-rocm target and no aggregate, which meant every gate run here was an ad-hoc command line.

verify-rocm mirrors what verify does for Metal, reusing the four backend-agnostic checks and adding ROCm clippy, the ROCm test gate, and a smoke. verify keeps its documented contract of matching the nightly-verify job, which is macOS Metal, untouched.

The smoke is the part verify-test-rocm cannot cover. A test run misses three failure classes: a binary that links but cannot start because the ROCm rpath is missing, which is how #1802 shipped; a kernel that compiles and links but launches nothing, the shape of the #1825 gaps; and a run that quietly lands on the CPU. Its body lives in scripts/ci/rocm_smoke.sh so that the parked ROCm build and generate job and this target run the same thing. That matters more than usual because the job never runs until a gfx1151 runner exists, so the local target is the only thing exercising the script and an inline copy in the workflow would rot unnoticed.

Two things were wrong before measurement corrected them.

The device assertion did not do what its comment claimed. custom kernel backend: rocm names the backend MLX resolved, not the device the run used, and those deliberately do not track each other, which #1805 documented and gpu_backend_available_does_not_track_the_default_device pins. A run forced onto the CPU with MLXCEL_DEVICE=cpu still prints it, so the assertion accepted a CPU run. It now reads Runtime device: GPU, verified against a real CPU run and a real GPU run. The same wrong claim in the workflow comment is corrected here.

The cap on cargo parallelism was attributed to the core count. The dominant cause is that this host shares 30 GiB with the GPU services it also runs: three llama-server processes were measured holding 25.5 GiB, leaving about 2 GiB for a build. ROCM_JOBS says that, and the smoke reports available memory and names the largest resident processes before building, because an OOM kill partway through a compile otherwise reads as an unrelated crash. That warning was observed firing and then correctly predicting the kill.

Validated on the gfx1151 host: the smoke runs end to end when memory is free, reporting OK: 32 tokens, 24 word-like tokens of generated text; a missing checkpoint is refused; a CPU run is refused. verify-test-rocm completes with four targets still failing, all tracked: the nvfp4 abort of #1806 and the sampler aborts of #1885. The WebUI catalog tests that used to fail now pass, since #1886 landed.

What was verified

The aggregate was run end to end on the gfx1151 host with the GPU services stopped. The smoke runs and passes, then the suite fails on the three known targets:

[rocm-smoke] available memory: 25802 MiB (cargo parallelism: -j 6)
[rocm-smoke] building and linking with --features rocm
[rocm-smoke] generating on the GPU
[rocm-smoke] OK: 32 tokens, 24 word-like tokens of generated text
...
error: 3 targets failed:
    `-p mlxcel --test sampling_gumbel_kill_switch`
    `-p mlxcel --test sampling_rejection_kill_switch`
    `-p mlxcel-core --lib`

Three, not four: -p mlxcel --lib now passes, because #1886 fixed the WebUI catalog rows that used to fail on ROCm. The remaining three are the sampler aborts of #1885 and the nvfp4 abort of #1806, both tracked. The aggregate failing is the honest outcome, not a defect in it.

That first run is also what caught the ordering bug fixed in the second commit here. With the test gate first, make stopped there and the smoke never executed at all.

The memory preflight was verified in both directions. Under pressure it warns and names the cause, and the build it warned about was then OOM-killed:

[rocm-smoke] available memory: 1270 MiB (cargo parallelism: -j 6)
[rocm-smoke] warning: under 4 GiB available; a build at this parallelism may be OOM-killed.
[rocm-smoke] largest resident processes:
  llama-server               26.8 GiB

With the services stopped it stays quiet, as above. The assertions were each exercised: a missing checkpoint is refused, and a run forced onto the CPU is refused by the corrected Runtime device: GPU check.

…rate smoke

`make verify` is Metal-only: `verify-clippy` and `verify-test` carry `--features metal,accelerate`, so it does not run on this host at all. ROCm had only the single `verify-test-rocm` target and no aggregate, which meant every gate run here was an ad-hoc command line.

`verify-rocm` mirrors what `verify` does for Metal, reusing the four backend-agnostic checks and adding ROCm clippy, the ROCm test gate, and a smoke. `verify` keeps its documented contract of matching the nightly-verify job, which is macOS Metal, untouched.

The smoke is the part `verify-test-rocm` cannot cover. A test run misses three failure classes: a binary that links but cannot start because the ROCm rpath is missing, which is how #1802 shipped; a kernel that compiles and links but launches nothing, the shape of the #1825 gaps; and a run that quietly lands on the CPU. Its body lives in `scripts/ci/rocm_smoke.sh` so that the parked `ROCm build and generate` job and this target run the same thing. That matters more than usual because the job never runs until a gfx1151 runner exists, so the local target is the only thing exercising the script and an inline copy in the workflow would rot unnoticed.

Two things were wrong before measurement corrected them.

The device assertion did not do what its comment claimed. `custom kernel backend: rocm` names the backend MLX resolved, not the device the run used, and those deliberately do not track each other, which #1805 documented and `gpu_backend_available_does_not_track_the_default_device` pins. A run forced onto the CPU with `MLXCEL_DEVICE=cpu` still prints it, so the assertion accepted a CPU run. It now reads `Runtime device: GPU`, verified against a real CPU run and a real GPU run. The same wrong claim in the workflow comment is corrected here.

The cap on cargo parallelism was attributed to the core count. The dominant cause is that this host shares 30 GiB with the GPU services it also runs: three `llama-server` processes were measured holding 25.5 GiB, leaving about 2 GiB for a build. `ROCM_JOBS` says that, and the smoke reports available memory and names the largest resident processes before building, because an OOM kill partway through a compile otherwise reads as an unrelated crash. That warning was observed firing and then correctly predicting the kill.

Validated on the gfx1151 host: the smoke runs end to end when memory is free, reporting `OK: 32 tokens, 24 word-like tokens of generated text`; a missing checkpoint is refused; a CPU run is refused. `verify-test-rocm` completes with four targets still failing, all tracked: the nvfp4 abort of #1806 and the sampler aborts of #1885. The WebUI catalog tests that used to fail now pass, since #1886 landed.

Refs #1811, #1801.
`verify-rocm` listed the smoke after the test gate, and make stops at the first failing prerequisite. The ROCm test gate has known failures, the nvfp4 abort of #1806 and the sampler aborts of #1885, so the smoke was never reached: the first full run of the target ended without it having executed once. It now runs before the suite, which also means a developer gets the "does a real forward pass still run on this device" answer while the suite is red. Confirmed by re-running: the smoke reports `OK: 32 tokens, 24 word-like tokens of generated text`, then the gate fails on the three known targets.

The `ROCM_JOBS` rationale gains the number that settles it. With the GPU services on this host stopped, a full run at `-j 6` never dropped below 14.8 GiB available, against 116 MB when three `llama-server` processes held 25.5 GiB. The cap is conservative on a free machine, and the co-tenants really were the constraint rather than the core count.

Refs #1811, #1801.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority status:done Completed type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant