Repository navigation
test-hrx-ops: past the split cap the row pins the CAP, not which fallback the tree has (engine#3085) - #461
Conversation
…back the tree has (engine#3085) fa_decode_split.1.3008 exists to be the smallest 64-token multiple past the loom split cap (2944 = 46*64, so 3008 = 47*64) and it asserted that the loom GENERAL kernel takes the node. That is true only in a tree without the private add-on: hip.fa_decode registers on FLASH_ATTN_EXT at 90 and its only K/V conditions are k->ne[1] >= mask->ne[0] and n_kv <= 2^22 -- no cap -- so above 2944 it is the only matcher left and the loom general kernel can never be scheduled there. Measured 2026-11-21 on a no-add-on bench tree at pin 5abb405: this row PASSES (286/290 overall), and the same row is among the aborts in an add-on tree. So assert what the shape pins -- the loom SPLIT is not offered past the cap -- and accept either fallback, naming it. The diagnostic #459 added stays in front of both REQUIREs, so a failing run still prints which kernel took the node.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
This is the correct resolution of a row that was pinning a name where its shape only pins a cap — and the two matchers side by side are the evidence:
dispatch-flash-attention.cpp:382-383 ceil_div(mask->ne[0],64)*64 > 2944 -> decline (the loom split)
gpu-kernels dispatch-hip-fa-decode.cpp (hip.fa_decode, FLASH_ATTN_EXT, 90):
n_kv = mask->ne[0]; k->ne[1] >= n_kv; v->ne[1] >= n_kv; n_kv <= 2^22 -> accept, NO CAP AT ALL
The row asserted "the general loom kernel", and the truth is narrower and more useful: "not the split kernel". Above 2944 the loom split declines — that is the shape's actual constraint — and what takes over depends on which tree the test runs in: the general loom kernel without an add-on, hip.fa_decode with one. A row that pins the general kernel is a row that fails in an add-on tree for a reason that has nothing to do with the defect it was written for (which is ggml-org#3085's four aborting rows).
And the replacement is precise about what is still excluded:
REQUIRE(scheduled != "loom_libs:ggml_flash_attention_decode_split_f32_f16_wmma_next_q8");
REQUIRE(scheduled.compare(0, 4, "hip:") == 0 ||
scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");Two requirements, and together they are the shape's real invariant: not the split, and either the add-on's path or the general loom path. A looser version (scheduled != split) would accept the CPU fallback — which is the failure ggml-org#3085 is actually about — and the second REQUIRE is what keeps the assertion from becoming "anything but the split". That is the difference between widening to the truth and widening to vacuity, and this PR is on the right side of it.
And #459's diagnostic stays in front of both — "so a failing run still prints which kernel took the node". The message that arrived an hour ago is already load-bearing for the next failure, which is the best possible outcome for a diagnostic PR.
One thing:
name the 2^22 ceiling as the other boundary this row does not test — n_kv <= 2^22 is the add-on's only cap, so at ~4 M tokens it would decline too, and a row at 3008 is nowhere near it. One clause saying "this row pins the split cap only; the add-on's 2^22 bound is untested here" stops a future reader mistaking a passing row for coverage of the add-on's limit.
Not blocking: the two matchers are quoted with their file and line, the invariant is narrowed to what the shape actually pins, both acceptance branches are enumerated, and the diagnostic from #459 is preserved.
|
VERDICT at The relaxation is the right one, and it keeps both halves of the claim: REQUIRE(scheduled != "loom_libs:ggml_flash_attention_decode_split_f32_f16_wmma_next_q8"); // the CAP
REQUIRE(scheduled.compare(0, 4, "hip:") == 0 || scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");The first line is the property the issue is about — past the cap the split kernel must not be offered — and it holds on every tree. The second says the node went somewhere legitimate, which is all a tree-independent row can say. That is the difference between a test of the dispatch decision and a test of which add-on happens to be built. One ask: Worth keeping in the commit message exactly as you wrote it: "these are the only rows that differ between the no-add-on bench tree, 286/290, and an add-on tree" — that is what tells the next person that a 4-row delta between two trees is a fixture problem and not four kernel bugs, which is precisely how ggml-org#3085 was read before you diagnosed it. |
|
VERDICT at 1e11cd4: READY. This is the most carefully argued test change I have reviewed tonight, and it corrects my advice twice over — the second correction is the one that matters. The diagnosis: the row was pinning the tree
That is exactly right, and it explains the symptom better than the symptom did. With the add-on built, The replacement pins both the cap and the candidate setREQUIRE(scheduled != "loom_libs:ggml_flash_attention_decode_split_f32_f16_wmma_next_q8");
REQUIRE(scheduled.compare(0, 4, "hip:") == 0 ||
scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");The first line is the property — the split kernel is not offered past the cap. The second is the one I was about to ask for: The population is measured, not asserted
Four rows, named by the difference between two real runs. That number is what makes the issue closable: not "some rows fail", but "these four, out of 290, and only in a tree with an add-on". My
|
|
VERDICT: READY "The row pins the cap; the tree picks the fallback." That is the distinction the four aborting rows needed, and it is a test fix in the exact sense that matters: the row asserts a property of the cap, and the tree it runs in decides which kernel the fallback is — so a row that hard-codes the fallback's name is testing the add-on's tree shape rather than the behaviour. Three asks:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 1e11cd4: READY
The change replaces a tree-shape assertion with a cap assertion, and it does it without weakening the row:
REQUIRE(scheduled != "loom_libs:ggml_flash_attention_decode_split_f32_f16_wmma_next_q8"); // the shape property
REQUIRE(scheduled.compare(0, 4, "hip:") == 0 ||
scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma"); // either tree's fallbackThe first assertion is the one the row is actually about: past 2944 = 46×64, the split kernel must not be offered. The second accepts either fallback — the add-on's hip.fa_decode (whose only K/V condition is k->ne[1] >= mask->ne[0], so it is the sole matcher left above the cap) or the loom general kernel in a tree without the add-on. That is the difference between "this tree has the add-on" and "this shape is above the cap", and the old single equality conflated them: it made the row abort on every add-on tree, which is why these were the only rows differing between the no-add-on bench tree (286/290) and an add-on tree.
It still fails for the cases worth failing: a split kernel taking the node fails the first line, and an unrelated loom_libs: kernel fails the second. The hip: prefix is loose (any hip kernel passes the second line on its own), but paired with the not-split assertion above it, and with the row's CPU-reference comparison still running afterwards, a wrong route would fail on the numbers.
Test-only, +10/-1, and the comment carries the measurement that justifies itself.
VERDICT at
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 1e11cd4: READY
The fix is right — the row was pinning a tree property — and I checked the add-on matcher it now allows. One clause in the comment overstates what that matcher accepts, and the comment is what a later reader will use to decide whether the row still means anything.
What the row actually pins, verified
loom split dispatch-flash-attention.cpp:382-383 ceil_div(mask->ne[0],64)*64 > 2944 -> decline
add-on gpu-kernels addons/hip-hrx/dispatch-hip-fa-decode.cpp:219-220
… || n_kv > (1 << 22) -> return false (the only n_kv cap)
plus k->ne[1] >= n_kv, v->ne[1] >= n_kv, mask->ne[2] == 1, mask->ne[3] == 1
At 3008 keys the loom split declines and hip.fa_decode (priority 90) is the only matcher left in an add-on tree, so REQUIRE(scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma") could only ever fail there. Asserting the cap instead —
REQUIRE(scheduled != "loom_libs:ggml_flash_attention_decode_split_f32_f16_wmma_next_q8");
REQUIRE(scheduled.compare(0, 4, "hip:") == 0 || scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");— is the right decomposition: the first line is the row's purpose (past the cap the split is not offered), the second is the freedom the tree has about which fallback. And it explains the measurement in the body: "these are the only rows that differ between the no-add-on bench tree, 286/290, and an add-on tree."
The one clause to narrow
"
hip.fa_decode(FLASH_ATTN_EXT, priority 90) accepts any mask width -- its only K/V condition isk->ne[1] >= mask->ne[0], there is no cap of any kind below 4M tokens"
For this row it is true, and the reason is worth stating exactly, because the matcher is much narrower than "any mask width":
q->ne[1] != 1 || … ← ONE query token (a decode row, which is what "fa_decode_split.1.…" is)
Hq / Hkv > 8 || Hq > 256 ← GQA ratio and head count bounded
q->type != GGML_TYPE_F32 … ← f32 queries, f16 K/V, no ALiBi / softcap / sinks
mask->nb[0] != 2 … ← f16 mask, contiguousSo a 16-token prefill would not match hip.fa_decode, and a reader who takes the comment literally could conclude the add-on swallows every FA node — which is exactly the claim that would make the row look worthless and get it deleted. One clause fixes it: "accepts any mask width for a one-token query (q->ne[1] == 1), which is what this row is; there is no n_kv cap below 4M". The comparison with the fourth FA row (#3104's probe) does not change: the row is 1 token by construction.
Composition with the other two PRs on this row
#3102(READY) adds a check that the row's literal sits exactly one 64-block past the cap (cap 2944 = 46×64, row3008 = 47×64). That check reads the row's number and the cap's number; this PR changes what the row asserts, not where it sits — so the two compose in either order and neither invalidates the other.#3105/#3107(shallow-clone guards) are unrelated but land in the samepre-pr-checksfamily; nothing here depends on them.
Worth a line in the body saying the pair is deliberate: the cap join (#3102) keeps the row addressable after a cap move, and this PR keeps the row meaningful in both trees. Between them the test-hrx-ops 286/290 vs add-on divergence drops from four rows to the remaining three.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 1e11cd4: READY
This corrects my own framing on ggml-org#3085, and the correction is verifiable in the add-on source.
I said the row's failure meant either "nothing is scheduled" or "the cap isn't applied". Neither: with the private add-on built, hip.fa_decode is a priority-90 Fused matcher for GGML_OP_FLASH_ATTN_EXT:
addons/hip-hrx/dispatch-hip-fa-decode.cpp:561
registry.add({ "hip.fa_decode", GGML_OP_FLASH_ATTN_EXT, DispatchMatchKind::Fused, 90, … });
…:410
if (n_kv > (1 << 22)) { return false; } // n-kv-cap = 4,194,304
So above the split cap 2944 and below 4M tokens, the ordering is hip.fa_decode (90) → loom split (75, declined by the cap) → loom general (50), and the add-on wins. The loom general kernel can never be scheduled there on an add-on tree — which is exactly why the row aborted: "Asserting the general kernel alone made this row a tree-shape test that aborts on every add-on tree (measured 2026-11-21: these are the only rows that differ between the no-add-on bench tree, 286/290, and an add-on tree)."
The replacement assertion is the right one, and it is a shape test again rather than a tree test:
REQUIRE(scheduled != "loom_libs:ggml_flash_attention_decode_split_f32_f16_wmma_next_q8");
REQUIRE(scheduled.compare(0, 4, "hip:") == 0 || scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");The split is not offered past the cap (the property the row exists for), and whatever takes the node must be either the add-on's kernel or the loom general. That keeps the row meaningful on both tree shapes, which is the whole point of a row that lives downstream of a pin.
The sentence worth keeping is the one that names the general problem: "which fallback takes the node is a property of the TREE, not of the shape." That is the same distinction I was groping at in my ggml-org#3085 comment and it is stated better here — a row that asserts a kernel name asserts the tree's composition, and this repo has at least two legitimate trees.
fa_decode_split.1.3008 therefore stays the row that proves the split cap is enforced, with ggml-org#3102's check pinning its relationship to the constant — and the pair of them is now the correct thing rather than two rows disagreeing about which kernel "should" win.
…ow (engine#3085) (#464) fa_prefill_full_cache.512 counts the loom general FA dispatch per chunk and then asserts flash_dispatch_count > 0 and covered_query_tokens == token_count. With the private add-on built, its own FA routes take every prefill chunk, the loop's filter skipped all of them, and the row aborted on 'the plan schedules no flash attention' -- which was false. The row is the third family in engine#3085 (the split row was fixed in #461). Count either route, and keep the per-chunk parameters (query_token_count, key_value_token_count, apply_gate, mask binding offsets) asserted only where they exist: they are the LOOM kernel's. Coverage therefore reads 0 on the add-on route, so that assertion is conditional on it being readable rather than dropped -- on a no-add-on tree nothing changes, which is the only tree this could be verified in (a tree that builds the private add-on is not available to this lane). Co-authored-by: bong-water-water-bong <[email protected]>
Refs 1bit-MONSTER/engine#3085 — the four rows that abort in an add-on tree and pass without one.
The row pins the cap; the tree picks the fallback
fa_decode_split.1.3008is the smallest 64-token multiple past the loom split cap (2944 = 46×64, so3008 = 47×64) and it asserted that the loom general kernel takes the node. That is a statement about the tree, not the shape:Above 2944 the loom split declines and the add-on's
hip.fa_decodeis the only matcher left, so in an add-on tree the loom general kernel cannot be scheduled for this shape — the row can only ever fail there. Below the cap the loom split keeps the node on priority, which is why the 512/513/65 rows pass in both shapes.What changes
The
REQUIREbecomes the invariant the shape actually pins — the loom split is not offered past the cap — plus "either fallback took it, and it is one of the two known routes":#459's diagnostic stays in front of both, so a failing run still prints which kernel took the node. Thehip:predicate is the same onetest-hrx-ops.cpp:5352already uses to recognise an add-on kernel.Verified
compile_commands.jsonfrom a configured HRX build,-fsyntax-only): rc 0, 0 errors. First version failed to compile (kDecodeSplitKernelNameis scoped to the other case), which is why the literal is used.5abb405c7this row passes today (my run:286 passed / 4 failed / 290,decode_attention_qkv_schedulingand all sevenfa_decode_split.*rows PASS), and on that tree the scheduled kernel isloom_libs:…wmma, so both newREQUIREs hold exactly as the old one did.Consequence, stated rather than hidden
On an add-on tree these rows no longer prove that the loom fallback is reachable — they prove the split is not. The loom fallback's proof now lives on a no-add-on tree, which is what the engine-side row in ggml-org#3102 keeps honest (
fa_split_expectation_checkfails if the cap moves under3008).