Skip to content

feat(bench): hold the ROCm guard lock for a whole gate or session - #2249

Merged
inureyes merged 1 commit into
mainfrom
feat/issue-2244-guard-hold
Oct 8, 2026
Merged

inureyes merged 1 commit into
mainfrom
feat/issue-2244-guard-hold

Conversation

@inureyes

@inureyes inureyes commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

  • rocm_gpu_guard.sh --hold [--max-wait SECS] -- COMMAND takes the host-wide lock through the existing acquire_lock (exit 75 on --max-wait), skips the idle wait and monitor, exports ROCM_GPU_GUARD_LOCK_HELD and runs COMMAND in the foreground with its status passed back. Guards inside keep their idle wait and monitor but take no lock. --idle-secs, --max-attempts and --log are rejected (exit 2); under an outer guard it just runs COMMAND; INT and TERM give 130 and 143.
  • --status prints held or free (exit 0 free, 1 held) and the holder from $LOCK.holder (pid, start, mode, command), written by every holder after it takes the lock and removed on exit; a dead pid is reported as stale.
  • make verify-rocm-held builds the test, release and clippy artifacts without the lock, then runs make verify-rocm under one hold. verify-rocm is unchanged.
  • docs/benchmarks.md gains "Sessions on a shared host". FIFO fairness stays out of scope as the issue says.

Verification

Run on gfx1151, private lock and private KFD dir, never the host lock: 11 new GuardTests (28 guard tests pass), make verify-python-tooling verify-versions verify-fmt, cargo test --features rocm --test dead_doc_pointers, and a hand demo of --hold and --status against a private lock. make verify-rocm-held and make verify-rocm were not run, as instructed for this unit; the orchestrator's gate run covers the end-to-end acceptance item. shellcheck is not installed here (bash -n passes).

Not verified: Metal and CUDA are not available on this host; nothing on those paths changes.

Closes #2244

Units starved on rocm_gpu_guard.sh because every guarded run, and every unguarded verify-rocm, competed separately for idle windows on the shared host.

rocm_gpu_guard.sh --hold takes the lock through the existing acquire_lock (same --max-wait, exit 75), skips the idle wait and monitor, exports ROCM_GPU_GUARD_LOCK_HELD and runs the command in the foreground, so guards inside keep their own idle wait and monitor but take no lock. --idle-secs, --max-attempts and --log are rejected with --hold. --status reports held or free from a ROCM_GPU_GUARD_LOCK.holder sidecar that every holder writes on acquire and removes on exit (stale pids are flagged). make verify-rocm-held builds unlocked and then runs verify-rocm under one hold. Existing guard behavior is unchanged.

Validated with the GuardTests additions (28 guard tests) and make verify-python-tooling verify-versions verify-fmt, plus a demo on a private lock. Refs #2244.
@inureyes
inureyes merged commit ce18b47 into main Oct 8, 2026
26 of 27 checks passed
@inureyes
inureyes deleted the feat/issue-2244-guard-hold branch October 8, 2026 21:26
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.

feat(bench): run ROCm gates and measurement sessions under one guard lock hold

1 participant