Skip to content

[codex] Clean up namespaced Slurm jobs on cancellation - #2745

Merged
cquil11 merged 1 commit into
mainfrom
codex/fix-namespaced-slurm-cleanup
Aug 26, 2026
Merged

cquil11 merged 1 commit into
mainfrom
codex/fix-namespaced-slurm-cleanup

Conversation

@cquil11

@cquil11 cquil11 commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • cancel both physical runner-name and inferencex--namespaced Slurm jobs in the reusable multi-node cleanup
  • wait for each matching allocation to leave the queue before continuing
  • preserve the existing launcher trap as the fast path while making workflow cleanup a reliable fallback

Validation

  • parsed .github/workflows/benchmark-multinode-tmpl.yml with PyYAML
  • git diff --check
  • actionlint .github/workflows/benchmark-multinode-tmpl.yml (only pre-existing informational ShellCheck findings outside this change)
  • reproduced with canceled GB200 run 33013627186: GitHub completed while Slurm job 24197 remained under the namespaced job name

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 polls squeue until 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.

@cquil11
cquil11 requested a review from a team August 26, 2026 21:22
@cquil11
cquil11 merged commit ad6e4c0 into main Aug 26, 2026
7 checks passed
@cquil11
cquil11 deleted the codex/fix-namespaced-slurm-cleanup branch August 26, 2026 21:23

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

wufann pushed a commit to wufann/InferenceX that referenced this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant