Repository navigation
hyperloom: the entrypoint waits for GTT room before claiming the GPU, and re-checks inside the claim (#1438) - #1439
Conversation
… and re-checks inside the claim `custom_strixhalo.sh` exec'd straight from `gpu-hold` into the workload. `gpu-hold` admits on the die's temperature and the FIFO's order and knows nothing about GTT; the engine's guardrail (ggml_hrx, #680) refuses a load that does not fit -- correctly, but only after the claim is ours. Measured 2026-11-08 on a long-context `hyperloom optimize` session (27B UD-Q4_K_XL, 20,480 ctx): two claims in a row granted at die 48.88 / 59.88 C while other lanes held 89.27 / 89.48 GiB of GTT, both dying in the first leg: HRX0 guardrail: ... pool budget 14.4 GiB - a launch that needs more is refused here llama_model_load: error loading model: unable to allocate HRX0 buffer and both artifacts recorded `llama-bench failed (rc=1, rows=[])` with score 0.0 -- the record blaming the workload for a claim taken on work that could not fit, at ~5 minutes of device time each, with other lanes queued behind it. Fix: wait until `GTT in use + HL_GTT_NEED_GIB <= HL_GTT_RULE_GIB` before claiming, and run the same check again inside the claim before anything loads, because the box moves while queued -- the window harness learned that on 2026-11-05 (a pre-claim check alone is a race). Refusal is `exit 3` with the numbers and the variable names in the message, so a session reports "no room" instead of "workload broken". Defaults 24 GiB needed / 95 GiB rule (this box's rule) / 1800 s wait; all three overridable and documented in the README, since the need is a property of the model+context. Proved device-free with a stand-in for `gpu-hold` (no claim taken, no load run), three paths: rule too small -> refuses before claiming, exit 3; rule passes but shrinks inside the claim -> refuses after the grant, exit 3, nothing loaded; both pass -> the workload is reached, exit 0. `bash -n` clean, `copyright --check` rc=0. Closes #1438
|
#1439 ready for review at d633247 — one entrypoint, one README row. Reproducer is two real tuner measurements from this box (04:41 and 04:59 today, both granted at 48.9/59.9 C with 89 GiB of other lanes' GTT held, both recorded as |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at d633247e4c0d8107f7af935d1ef7f3d637adc9af
This is the right fix for #1438: gpu-hold admits on temperature and FIFO order only, so the entrypoint has to ask "will it fit" itself, and do it twice.
- Once before claiming, bounded by
HL_GTT_ROOM_WAIT. - Again inside the claim, before anything loads. That's the step that matters, because the box moves while queued. The
bash -c '…' _ "$HERE/benchmark.py"form passes the script as$1andexecs it, so the claim still wraps exactly the measurement.
A refusal now says "no room" with the numbers and the variables, instead of a score-0.0 artifact that reads as a broken workload. That's what makes this worth shipping.
Checked at this head:
bash -npasses oncustom_strixhalo.sh, andtools/copyright.py --checkis rc 0;HL_GTT_NEED_GIBandHL_GTT_RULE_GIBare exported before theexec, so the innerbash -csees them;- on this box
/sys/class/drm/card0/device/mem_info_gtt_usedis the amdgpu device (89 GiB in use right now, so this would correctly refuse a 24 GiB need against a 95 GiB rule), andbenchmark.py:73uses the samecard0path, so the guard and the measurement read the same counter.
Two small notes, not blocking:
- It fails open. An unreadable
mem_info_gtt_usedcounts as 0 GiB in use ("unreadable sysfs must not be read as full"), so if the GPU ever isn'tcard0(a second GPU, orsimpledrmtaking card0 on another box), the guard silently admits everything. Resolving the card that hasmem_info_gtt_usedwith a glob, or at least printing "[1bit-hl] GTT unreadable at …, not checking", would make that visible. / 1073741824floors, so 88.9 GiB counts as 88. With a 24 GiB need and a 9 GiB gap to the engine's 104 ceiling that's harmless, but rounding up would make "≤ rule" mean what it says.
No device run on my side; your three stand-in paths cover the logic.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…tes, not a round 24 (#1472) #1439 added the room gate with `HL_GTT_NEED_GIB` defaulting to 24 GiB -- a round number nobody measured. The workload publishes its own requirement, and `1bit serve` prints it at load: need 20.21 GiB (weights 16.35 + KV/state 1.40 + compute 0.50; draft 1.96) Measured 2026-11-08, a long-context optimize session on this box, three attempts, zero measurements: two were refused by the gate itself, and one of those refusals was wrong -- 06:26 GTT 57 -> 75 at grant refused (75+24=99 > 95) 20.21 says 95.21 > 95 -> correct 08:18 GTT 64 -> 74 at grant refused (74+24=98 > 95) 20.21 says 94.21 <= 95 -> FITS, refused anyway and the engine's own guardrail had 30 GiB of budget free at that moment (104 GiB ceiling - 74 in use), so both the box's rule and the engine said yes while this adapter said no. Default 21 GiB (measured figure plus a hair, with the basis in the comment so it is not rounded again), rule unchanged at 95. The two-place check and the refusal path are unchanged; their three-path proof stays as in #1439. Closes #1471 Co-authored-by: bong-water-water-bong <[email protected]>
Fixes #1438.
Root cause
custom_strixhalo.shends withexec gpu-hold -l hyperloom -t <min> -- python3 benchmark.py.gpu-holdadmits a measurement on the die's temperature and the FIFO's order — it knows nothing about GTT. The engine's guardrail (ggml_hrx, #680) does check, and refuses correctly, but only after the claim is ours. So a measurement can be granted a claim it provably cannot use.Measured before/after
A real long-context
hyperloom optimizesession (27B UD-Q4_K_XL, 20,480 ctx) on strixhalo, 2026-11-08. Two claims in a row, both granted, both wasted:llama-bench failed (rc=1, rows=[]), score 0.0Both artifacts are missing
longctx,placement,serve_tok_s,score_geomean— the record says the workload is broken, when the entrypoint had taken a claim for work that could not fit, at ~5 min of device time each with other lanes queued behind it.After the fix, the same box state refuses instead of loading, and says why:
exit 3, no claim taken, nothing loaded.What changed
GTT in use + HL_GTT_NEED_GIB <= HL_GTT_RULE_GIBbefore claiming (HL_GTT_ROOM_WAIT, default 1800 s bounds the wait);Verification
Device-free, with a stand-in for
gpu-holdso no claim is taken and no load runs — three paths:exit 3exit 3, nothing loadedexit 0bash -nclean,python3 tools/copyright.py --checkrc=0. 2 files, +49/−1.