Repository navigation
hrx: a capacity refusal stops advising a budget it cannot reach (engine #900) - #202
Conversation
ggml-org#900) resident + parked is bounded by the arena and the arena by the limit, so the snapshot of a capacity miss is always limit + one weight. Printed as advice that is the measured 6 MiB-at-a-time climb (2304 -> 2310 on a run whose floor is 2560) and, below the budget in force, the measured 38 <-> 44 MiB cycle. The capacity branch now names the numbers and says the snapshot cannot size the run; the fragmented wording (#180) is untouched and the unbounded arm no longer prints limit 0.0 MiB.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at a1d84b7fb
Message-only change, and the test is load-bearing — I ran it both ways rather than accepting the arm count.
$ g++ -std=c++17 -O2 -I ggml/src/ggml-hrx -o /tmp/tar tests/test-hrx-arena-refusal.cpp (at a1d84b7fb)
-> rc=0, "test-hrx-arena-refusal: all cases ok (6 arms)"
$ same test, compiled against the BASE header (428937ae6, put first on the include path)
-> 10 failures, rc=1, and the failing text is the advice this PR removes:
"... limit 2304.0 MiB ... Raise it to at least 2310 MiB or unset it (engine #788)."
"... limit 0.0 MiB ... Raise it to at least 64 MiB or unset it (engine #788)."
So the arm that matters is proven in both directions, and it uses engine#900's own numbers. The arithmetic in the body re-derives exactly: need 12.6 + resident 2231.7 + parked 65.2 = 2309.5 -> ceil = 2310, against a real floor of 2560 — i.e. the old advice named 2.2 % of the gap.
The reasoning is right, and it is the reason this should merge rather than the wording being cosmetic: resident + parked cannot exceed the arena, the arena cannot exceed the limit, so need + resident + parked is always limit + one weight. A refusal computed inside the allocator therefore cannot name a working set that is still growing, and printing one produces the measured 6 MiB-per-round climb and the 38 <-> 44 cycle where two snapshots advise each other.
Three details I checked because they would be easy to get wrong:
- the fragmented arm is untouched (
free >= need, block too small) and still drops the number — that is the one case where a number would have been legitimate, and it was already right; - the new
limit == 0arm is genuinely needed: the base printedlimit 0.0 MiB ... Raise it to at least 64 MiB, which invites raising a budget that is unset. The head says the limit is unset. (describe()is defensive there — the arena is not used on that path — but a message that invents a number is worse than one that says "unset".) - the capacity sentence is still one sentence, no trailing newline (the test asserts
text.back() != '\n'), which is what the log line above it expects.
No allocator, no predicate, no decision changed — fragmented() and describe() are the only touch points, and the diff is 2 files, +51/−7.
Not re-run: the six-round device ladder (13 -> 26 -> 38 -> 44 -> 2304 -> 2560). The message cannot change an allocation, and the before/after table's only device-dependent claim is round 6 ("2560 runs, coherent"), which is the same binary path as before with one printf's arguments changed.
GGML_HRX_HOST_WEIGHT_LIMIT_MBrefusals currently end withRaise it to at least N MiB or unset it, whereN = need + resident + parked. On a bounded arena that number cannot be the budget a run needs, and the engine ggml-org#900ladder proves it: 13 -> 26 -> 38 -> 44 -> (fragmented wording) on Qwen3-4B, and 2304 -> 2310 on a model whose real
floor is 2560 MiB.
Root cause:
resident + parkedis bounded by the arena, and the arena is bounded by the limit. So the snapshot is alwayslimit + one weight. The advice is therefore "raise it by one weight's worth", which is a slower ladder than doingnothing (six MiB a step, each step a full run), and when the snapshot lands below the budget in force it is the measured
38 <-> 44 MiB cycle - two states advising each other. Neither number is reachable, which is what this row's title says.
This PR changes only the sentence, not the allocator and not any decision:
free < need): the numbers are still printed, the advice is now "the arena is full at the limit youset, so this snapshot cannot name the budget this run needs (it is never more than the limit plus one weight): unset
GGML_HRX_HOST_WEIGHT_LIMIT_MBor raise it well above the current limit".free >= need, no block that large): unchanged - hrx: a host-weight refusal says whether the arena is fragmented or short (engine #900) #180's wording already drops the number there.limit 0.0 MiB; says the limit is unset (the arena is not used on that path, the arm isdefensive).
Measured, same box / model / command as engine#900 comment-6642471520
Qwen3-4B-IQ4_XS,
-dev HRX0 -ngl 0 -fit off -c 512 -b 32 -ub 32 -n 8 --temp 0, base428937ae6, onegpu-holdticketper ladder,
GGML_HRX_HOST_WEIGHT_LIMIT_MBset to exactly the value the previous round advised:The ladder still needs a human decision ("go much bigger or unset it") - that is deliberate: no number computed inside a
refusal can name a working set that is still growing. It is honest in one step instead of climbing by one weight's worth
and it no longer advises a value it has already proven wrong.
Tests
tests/test-hrx-arena-refusal.cpp, device-free, 6 arms: the two fragmentation arms (ggml-org#900's 200 MiB and 4096 MiBmeasurements) unchanged, the capacity arm now asserts the raise-to number is absent (including
4032 MiB, the oldarithmetic), a new arm is ggml-org#900's own 2304 MiB refusal, the unbounded arm asserts no raise and no
limit 0.0 MiB, and the"a big enough block exists" corner is unchanged. New test against the old header fails 10 assertions (negative
control); against this header:
all cases ok (6 arms).Part of engine ggml-org#900. Advice-only, so it does not need a window and cannot change a run's outcome.