Repository navigation
[codex] Clean up namespaced Slurm jobs on cancellation - #2745
Conversation
There was a problem hiding this comment.
Looks good — small, mechanical extension of the existing Slurm cleanup pattern.
Checked the shared &slurm-cleanup anchor (used for both pre-run and post-run steps): the new for job_name in ... loop correctly quotes "$job_name" in every scancel/squeue invocation, and reuses the same cancel-then-wait pattern that already existed for the single job-name case, just applied to both the bare runner name and the inferencex- prefixed name. No benchmark-execution logic, master configs, or perf-changelog are touched.
Extended reasoning...
Overview
The diff is confined to .github/workflows/benchmark-multinode-tmpl.yml, modifying the shared &slurm-cleanup YAML anchor used by both the pre-run and post-run cleanup steps. It wraps the existing scancel/squeue-wait logic in a for job_name in "${{ runner.name }}" "inferencex-${{ runner.name }}"; do ... done loop, so cleanup now also targets Slurm jobs submitted under an inferencex- prefixed name, and simplifies quoting by assigning to a shell variable instead of repeating the GitHub Actions expression with mixed quoting.
Security risks
None identified. This is CI-workflow shell logic operating on $USER-scoped Slurm job names; no new external input, no privilege changes, no injection surface beyond what already existed (the runner.name expression was already interpolated into the shell script pre-change).
Level of scrutiny
Low-to-moderate. It's a CI/infra script change on a self-hosted runner cleanup path, which per the repo's own conventions (root-owned-file staleness on the AMD MI355X cluster) is a sensitive area to get right, but the change itself is a direct, minimal extension of a pre-existing pattern: same cancel-then-wait shape, just looped twice with correct quoting. I verified against the pre-change version of the file that the original single-name logic used the identical sequential cancel/wait structure, so looping it over two names doesn't introduce a new stall/skip failure mode — a stuck job would have stalled the original code the same way.
Other factors
No test coverage is possible for a workflow YAML block beyond the author's stated validation (PyYAML parse, actionlint, and a real reproduction against a canceled GB200 run showing the previously-orphaned inferencex-prefixed job). The bug-hunting system reported no findings, and the two "ruled out" candidate notes (about sequential per-name processing) describe existing, unchanged behavior rather than a regression, so I did not restate them.
Summary
inferencex--namespaced Slurm jobs in the reusable multi-node cleanupValidation
.github/workflows/benchmark-multinode-tmpl.ymlwith PyYAMLgit diff --checkactionlint .github/workflows/benchmark-multinode-tmpl.yml(only pre-existing informational ShellCheck findings outside this change)No performance changelog entry is needed because this only corrects cancellation cleanup and does not change benchmark execution or results.
Note
Low Risk
Workflow-only cancellation cleanup; no change to benchmark execution, recipes, or result processing.
Overview
The reusable multi-node benchmark workflow’s shared Slurm cleanup step now targets both the physical runner name and the
inferencex--prefixed job name launchers use (e.g. GB200), instead of only${{ runner.name }}.For each name it
scancels matching user jobs and pollssqueueuntil the queue is empty, so pre-run and post-run cleanup can clear leftover allocations when a GitHub job is canceled while Slurm still holds the namespaced job.Reviewed by Cursor Bugbot for commit 0de6087. Bugbot is set up for automated code reviews on this repo. Configure here.