Skip to content

[CI] [AMD] spur: Run 1-, 2- and 4-GPU suites on part of a node - #48830

Merged
HaiShaw merged 3 commits into
sgl-project:mainfrom
michaelzhang-ai:amd-ci-spur-gpu-split
Nov 7, 2026
Merged

HaiShaw merged 3 commits into
sgl-project:mainfrom
michaelzhang-ai:amd-ci-spur-gpu-split

Conversation

@michaelzhang-ai

@michaelzhang-ai michaelzhang-ai commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

What

launch_amd_ci_mi35x.sh takes --gpus 1|2|4|8, matching the linux-mi35x-gpu-N labels. 8 (the default) keeps today's whole-node --exclusive job. 1, 2 and 4 request that many GPUs with --gres, so up to 8/N jobs share a node. The Spur stage-a smoke workflow now asks for 1 GPU.

Why

Every Spur job currently holds a whole MI355X node, but the suites that queue longest on ARC are 1-GPU. Running stage-a-test-1-gpu-small-amd on Spur leaves 7 of 8 GPUs idle. The scheduler already packs jobs: two --gres=gpu:2 jobs on one node got ROCR_VISIBLE_DEVICES=0,1 and 2,3. What stopped sharing was our scripts, which assume one job per node.

Changes

  • Container name: the AMD CI scripts read it from CI_CONTAINER_NAME, which defaults to ci_sglang. A shared-node job uses ci_sglang_<jobid>.
  • GPU isolation: amd_ci_start_container.sh accepts AMD_CI_RENDER_DEVICES, a list of /dev/dri/renderD* paths, in the same way ARC pods use /etc/podinfo/gha-render-devices. The job script maps the scheduler's GPU indices to render nodes through the KFD topology, so the container sees only its own GPUs.
  • VRAM clear: ensure_vram_clear.sh stops every GPU container on the host, so only 8-GPU jobs run it.
  • Leftovers from killed jobs: Spur doesn't remove a job's container on scancel or exit, only once the node has no jobs left. So every Spur job names its container ci_sglang_<jobid> and first removes those whose job squeue no longer lists. A smaller job then checks that its own GPUs are below 5% VRAM before starting.
  • Keeping room for 8-GPU jobs: SLURM_WHOLE_NODE_ONLY lists nodes that jobs under 8 GPUs stay off, so packed small jobs cannot leave every node partly busy.
  • ARC unaffected: with the two new variables unset (as on every ARC runner), the AMD CI scripts behave exactly as before.

Test servers don't collide on ports, because containers use Docker's default bridge network rather than the host network.

Test plan

All runs used stage-a-test-1-gpu-small-amd on rocm10 from this branch, on one MI355X node.

  • GPU mapping: two 2-GPU probe jobs ran at the same time. GPUs 0,1 mapped to renderD128/136 (PCI 0002:00:01.0, :02.0), and GPUs 2,3 to renderD144/152 (:03.0, :04.0). A container given only those render devices saw exactly 2 GPUs, with the matching PCI IDs.
  • Packed: three jobs with --gpus 2, --gpus 2 and --gpus 1 ran on the same node from 06:11 to 06:20 UTC. They got GPUs 0,1 / 2,3 / 4 in containers ci_sglang_<jobid>, and each passed 11/11.
  • Leftover container, job still running: a job held a container with 30 GiB on every GPU. A 1-GPU job left the container alone and failed with GPUs assigned to this job still hold memory: /dev/dri/renderD136:30GiB.
  • Leftover container, job ended: same setup after the holding job exited without cleanup, with a placeholder job keeping the node busy so Spur wouldn't clean up first. The next 1-GPU job logged removing ci_sglang_271037: job 271037 has ended, got one of the freed GPUs and passed 11/11.
  • Whole node: --gpus 8 ran ensure_vram_clear as before and passed 11/11.
  • Launcher arguments, with sbatch stubbed out: default and 8 give --exclusive; 1/2/4 give --gres=gpu:N; 0, 3, 16 and x are rejected; SLURM_WHOLE_NODE_ONLY is added to --exclude only for jobs under 8 GPUs.
  • Cluster runs: everything above ran through the launcher by hand on a cluster node, so there are no GitHub run links. The same launcher passed through the workflow on main before this change: Test AMD MI35x (Spur) run 42144878076, stage-a 11/11.
  • PR CI on dfeacce: PR Test and Lint pass.
  • Not run: the workflow itself, because the runners only take main. PR Test (AMD) on the ARC runners also hasn't run, since the PR has no run-ci. The ARC path goes through the defaulted variables unchanged.

CI States

Latest PR Test (Base): ✅ Run #42198379453
Latest PR Test (Extra): ❌ Run #42198379387
Latest PR Test (AMD ROCm 10): ❌ Run #42198379390

Tip

Base CI only covers the core cases, and its workload may not exercise your change. Use /rerun-test to run the tests your change touches, or copy this prompt for an agent:

Find the registered tests this PR affects and run them with /rerun-test, following https://github.com/sgl-project/sglang/blob/main/.agents/skills/rerun-test/SKILL.md

launch_amd_ci_mi35x.sh takes --gpus 1|2|4|8. 8 keeps the whole-node
--exclusive job; smaller counts request that many GPUs with --gres, so
several jobs share a node. Such a job skips ensure_vram_clear.sh (it
stops every GPU container on the host), runs in its own container, and
passes only the render devices of the GPUs the scheduler assigned.

The AMD CI scripts take the container name from CI_CONTAINER_NAME and
the device list from AMD_CI_RENDER_DEVICES. Both default to today's
behaviour (ci_sglang, all of /dev/dri), so ARC runners are unaffected.
The Spur stage-a smoke workflow now asks for 1 GPU.
SLURM_WHOLE_NODE_ONLY names nodes that jobs asking for fewer than 8 GPUs
stay off, so packed small jobs cannot leave every node partly busy and
starve 8-GPU jobs.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@michaelzhang-ai michaelzhang-ai added the run-ci CI: run the baseline test suite on this PR label Nov 6, 2026
@github-actions github-actions Bot added amd and removed run-ci CI: run the baseline test suite on this PR labels Nov 6, 2026
@michaelzhang-ai michaelzhang-ai added the run-ci CI: run the baseline test suite on this PR label Nov 6, 2026
@bingxche bingxche removed the run-ci CI: run the baseline test suite on this PR label Nov 6, 2026
@bingxche

bingxche commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

The mi35x-spur jobs only can be dispatched through workflow, no need to run-ci

Comment thread scripts/ci/slurm/amd_ci_job_mi35x.sh Resolved
A job killed before its EXIT trap runs leaves its container, and that
container's GPU memory, behind; the scheduler then hands the GPU to the
next job. Every Spur job now names its container ci_sglang_<jobid>,
removes such containers whose job squeue no longer lists, and a job
under 8 GPUs checks that its own GPUs are below 5% VRAM before starting.
@HaiShaw
HaiShaw merged commit 754185a into sgl-project:main Nov 7, 2026
132 of 139 checks passed
@michaelzhang-ai
michaelzhang-ai deleted the amd-ci-spur-gpu-split branch November 7, 2026 08:23
gyohuangxin pushed a commit to ROCm/aiter that referenced this pull request Nov 9, 2026
…7645)

Upstream sglang (sgl-project/sglang#48830, merged into amd/aiter-ci on
2026-11-07) replaced the hardcoded ci_sglang container name in
scripts/ci/amd/amd_ci_install_dependency.sh with "$CI_CONTAINER_NAME"
(default ci_sglang). The two human-eval entries in SGLANG_CI_PATCHES no
longer matched, so both SGLang accuracy jobs failed at the patch step with
"Expected snippet not found". Match the new text.

Co-authored-by: Claude <[email protected]>
ruanjm pushed a commit to ROCm/aiter that referenced this pull request Nov 10, 2026
…7645)

Upstream sglang (sgl-project/sglang#48830, merged into amd/aiter-ci on
2026-11-07) replaced the hardcoded ci_sglang container name in
scripts/ci/amd/amd_ci_install_dependency.sh with "$CI_CONTAINER_NAME"
(default ci_sglang). The two human-eval entries in SGLANG_CI_PATCHES no
longer matched, so both SGLang accuracy jobs failed at the patch step with
"Expected snippet not found". Match the new text.

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants