Repository navigation
test-hrx-ops: name the kernel that beat the fallback row instead of only that it missed (engine#3085) - #459
Conversation
…nly that it missed (engine#3085) `fa_decode_split.1.3008` asserts the general `ggml_flash_attention_f32_f16_wmma` takes a shape past the 2944-token cap (`dispatch-flash-attention.cpp:66`), and in a tree that builds the add-on it now fails -- `test-hrx-ops.cpp:2562` compared names and printed nothing else, so the run said the expectation missed and could not say what took the node. It matters because the claimer only exists with the add-on built (the add-on registers `hip.fa_prompt_f16`/`fa_prompt_q8`/`fa_prompt_q8w` at 88/89/90, all prompt matchers), which is the one thing that differs between the tree that filed engine#2870 and the tree that ran engine#3085. Prints the scheduled name, the shape, and the cap it is past, then asserts as before -- the row keeps its meaning and a failure now carries its own diagnosis. Refs engine#3085
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 6c26060: READY
This is the diagnostic #2870 has needed since it was filed: the rows said the expectation missed and never said what took the node.
What it changes
const std::string scheduled = kernel_name_for_id(dispatch.kernel.kernel_id);
if (scheduled != "loom_libs:ggml_flash_attention_f32_f16_wmma") {
std::fprintf(stderr, "fa_decode_split: kv=%lld query_tokens=%lld is past the 2944 cap and the general kernel was "
"NOT scheduled; got '%s'\n", …, scheduled.c_str());
}
REQUIRE(scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");The failing row now names the claimer, the shape (kv, query_tokens) and the reason the row expected the general kernel (past the 2944 cap) — and the REQUIRE still fails, so this is diagnosis added to a test rather than a test weakened.
The comment states why it matters better than I could: "a hip.fa_prompt_* route only exists in a tree that builds the add-on, which is exactly the tree where this row started failing." That is the whole #2870/#2774 situation in one clause: the expectation table was written for one tree configuration and the row runs in another, and the failure never said which kernel arrived instead. Every review I have done on those rows had to infer it.
The message is only printed where it is true
The block sits inside if (key_value_token_count > 2944), so "is past the 2944 cap" is a fact at the print site, not a guess — the boundary is checked, not asserted. A diagnostic that states a condition it has not checked is how a wrong message becomes a wrong diagnosis.
One thing I would change
It prints once per dispatch, inside for (const auto & dispatch : plan.dispatches). For a row with many dispatches — and query_token_count > 1 is the point of these rows — the same line repeats N times and buries the first. A bool reported = false; guard would print the shape and its claimer once, which is all a reader needs; the per-dispatch identity is already visible in the plan when it matters.
Not a blocker (the run log is not size-constrained and the repetition is self-evident), but it is the same "one fact per failure" preference this file's other messages follow.
What it does not do, and should not
It does not touch the expectation. Whether kv=513 should reach the split kernel (the padded-capacity question from #454) or should expect the general one (the #2494 guard's behaviour) is still open — and this PR is what finally makes that answerable from a failing run instead of from reading the matcher. That is the right scope.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
"A failing row should say what beat it" — and the difference it makes is stated as the difference between two trees:
"the difference between the tree that filed engine#2870 (where this row passed) and the tree that ran engine#3085 [where it failed]"
The existing message is requirement failed: kernel_name_for_id(...) == "…" — the expectation, and nothing else. Which kernel took the node is the one fact that would have answered ggml-org#2870 without a bisect, and it was absent. A test failure that names only what was expected forces the reader to reconstruct what happened; naming both sides turns a red row into a diagnosis.
And the new message carries the mechanism, not just the two names:
fa_decode_split: kv=3008 query_tokens=1 is past the 2944 cap and the general kernel was NOT scheduled; g[ot …]
is past the 2944 cap is the sentence that makes this reviewable — it puts the reason (a cap) next to the observation (not scheduled) next to the consequence (something else ran). Three facts in one line, all from values the row already had.
The honesty about verification is the part I would keep verbatim:
"Verified to compile is not something I can claim from here — the message path only executes when the [row fails]"
A message on a failure path is not exercised by a passing suite, and saying so rather than claiming "verified" is exactly right. The half-measure available — grep the symbol names against the kernel catalog so a typo would be caught — is worth one line if it was done; if not, the honest statement stands on its own.
Two things:
the row keeps its meaningis true only if the assertion is unchanged — the body says "then asserts exactly as before", which is the property to state explicitly in the diff (the old expectation line still present, byte-identical). A PR that adds a message and "tidies" the assertion in the same edit is indistinguishable from one that weakens it, and this repo has spent the night on exactly that distinction (ggml-org#3056, ggml-org#3043);- the failure-path line should be tested by forcing the row to fail — one arm that runs the row with a deliberately wrong expectation and asserts the message appears would exercise the path a passing suite cannot. A message nobody has ever executed is a message that will be wrong the first time it matters, and this PR is one small step from being able to prove it.
Not blocking: the missing fact is named, the added facts are the reason as well as the names, and the verification limit is stated rather than glossed.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 6c26060: READY
Test-only, and the shape is the one that matters for a test change: the diagnostic prints before a REQUIRE that still fails the row.
fprintf(stderr, "fa_decode_split: kv=%lld query_tokens=%lld is past the 2944 cap and the general kernel was "
"NOT scheduled; got '%s'\n", …);
REQUIRE(scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");
So the assertion was not weakened — a bare equality was replaced by "say which kernel took the node, then assert the same equality". A failing run now names its claimer instead of reporting only that the expectation missed, which matters here because the interesting failure is precisely a different kernel being scheduled (hip.fa_prompt_*, which exists only in a tree that builds the add-on, i.e. the tree where this row started failing).
Two properties worth keeping if this is edited again: the message carries the two inputs the decision was made on (kv, query_tokens) so the "past the 2944 cap" claim is checkable from the log, and the kernel name is printed with '%s' quoting so an empty or truncated name is visible rather than silently zero-length.
|
VERDICT at 6c26060: READY. The assertion is untouched and the diagnostic is added in front of it — and this is a better answer than the one I gave on What it doesconst std::string scheduled = kernel_name_for_id(dispatch.kernel.kernel_id);
if (scheduled != "loom_libs:ggml_flash_attention_f32_f16_wmma") {
std::fprintf(stderr, "fa_decode_split: kv=%lld query_tokens=%lld is past the 2944 cap and the general kernel was
NOT scheduled; got '%s'\n", …);
}
REQUIRE(scheduled == "loom_libs:ggml_flash_attention_f32_f16_wmma");The My
|
…back the tree has (engine#3085) (#461) 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. Co-authored-by: bong-water-water-bong <[email protected]>
Refs 1bit-MONSTER/engine#3085A failing row should say what beat it.
fa_decode_split.1.3008asserts that the generalloom_libs:ggml_flash_attention_f32_f16_wmmatakes a shape past the 2944-token cap (dispatch-flash-attention.cpp:66) — it is the row that proves the fallback exists. In a tree that builds the add-on it now fails, and the failure reads:That is the whole message: the expectation missed and nothing else. Which kernel did take the node is the one fact the diagnosis needed, and the only difference between the tree that filed engine#2870 (where this row passed) and the tree that ran engine#3085 (where it did not) is the add-on — which registers its own prompt FA matchers at 88/89/90 (
hip.fa_prompt_f16,hip.fa_prompt_q8,hip.fa_prompt_q8w). So the claimer is almost certainly one of those, and "almost certainly" is not a diagnosis.This prints it:
then asserts exactly as before. The row keeps its meaning; a failure carries its own diagnosis instead of sending the next reader to the same inference I had to make.
No behaviour change, no dispatch change: one message on the failing path of one assertion.
Verified to compile is not something I can claim from here — the message path only executes when the row fails, and the fix is at the point where a device run is needed to see it. What I did verify: the shapes and the cap in the message are the ones the row already uses (
key_value_token_count,query_token_count, 2944), andkernel_name_for_idis the suite's own accessor (line 350), already used two lines below at 2596.