Repository navigation
hrx-ops-test: the add-on acceptance must say which expectation it stops asserting (engine#3120) - #469
Conversation
…ps asserting (engine#3120) #465's per-row opt-in is the right mechanism, but the accept path prints "<kernel> is served by the HIP add-on", which reads as a substitution when the row in fact stops pinning <kernel> and only compares values afterwards. Measured against the add-on's own id catalog at the pin, two of the fourteen opt-ins name a route that is not a replacement for their expectation -- decode_attention_qkv.scheduling and attention_postprocess.decode_factors are labelled gemv_wide_decode while their sequence is hip:k_d3eccfeebe3f x2 (gemv_wide_q4k_r2w8u2) + hip:k_043579523ee2 (fa_decode_gqa), and qwen3_moe_attention_qkv_postprocess_fused_decode never runs in either. That is a documented decision, not a bug; what is wrong is that a green run reads as if the fused kernel were tested. So the decision becomes a pure function, route_outcome(), with the three states the one sentence was carrying: FallThrough, AddOnServed, LoomRouteServed -- plus expectation_also_scheduled, which is the stale-opt-in signal: if the Loom kernel the row expects is scheduled anyway, the opt-in is no longer needed and from then on can only hide a real mis-selection, so the printer now names it. The arm needs no device: host case support.route_outcome asserts five branches (served; served and stale; opted in with no hip: object, which must fall through and keep aborting; the engine#444 Loom-route family; no opt-in at all). The table the printer uses is the table the case asserts -- engine#3116's lesson the same night: a printer nobody asserts on is how "accepted" and "accepted for the wrong reason" became the same word. Host case only: [PASS] support.route_outcome, 1 passed, 0 failed. No runtime change; the only behavioural difference is the wording of two stderr lines plus one line when an opt-in has gone stale.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
This is the half of #465 that makes its message honest, and the defect is a word:
"
is served byreads as a substitution: the add-on's kernel does what the Loom kernel would have d[one]"
Two rows were labelled gemv_wide_decode and the sequence contained no such kernel at all — it held hip:k_d3eccfeebe3f ×2 (gemv_wide_q4k_r2w8…), and qwen3_moe:…_attention_qkv_postprocess_fused_decode never runs in either the pinned or the tested tree. So the routing was correct and the explanation was false: the row said "substituted", the truth was "something different ran".
That distinction is the one a reader acts on: "A is served by B" invites you to assume A and B are equivalent; "A did not run; these ran instead" tells you the expectation is describing a graph that no longer exists. The second is a finding, and #465's message would have hidden it — which is the same shape as the unknown-vs-0 family: a routing decision is not an equivalence claim, and the wording conflated them.
And the fix is structural rather than a reword:
route_outcome(sequence, expected, addon_route, loom_route) // a pure functionA pure decision function — that is the third time tonight a diagnostics change has been made testable by extracting a pure function (git_shallow.decide, ggml-org#3132's --self-test arithmetic, this). It means the mapping from sequence to outcome is table-testable without a device, which is the only way the two mislabelled rows could have been caught before a suite run.
Two things:
- the two mislabelled rows are the evidence and should be named as arms —
decode_attention_qkv.schedulingandattention_postprocess.decode_factorsboth claimedgemv_wide_decodeand contained twohip:k_d3eccfeebe3fs. An arm per row, feeding exactly that sequence, asserting the message says what ran rather than served by pins the wording against the next reword; qwen3_moe:…attention_qkv_postprocess_fused_decode never runs in eitheris a finding bigger than a label — an expectation naming a kernel that no tree executes is a row testing nothing, and it deserves its own line in the body or a separate issue. If two rows reference it and it never runs, the rows are vacuous regardless of how the message reads.
Not blocking: the word-level defect is identified with two concrete rows, the fix is a pure function, and the message now distinguishes what ran from what was expected.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 5401116: READY
The continuation of #463's measured-id work, and it makes the acceptance say which expectation it is accepting an add-on route for — so a failure names the pair rather than leaving the reader to match a Loom expectation against a hip: id by eye.
That is the third iteration of the same idea tonight, and it is the one that should stick: #463 went from a name list to per-expectation measured ids; #465 made the acceptance opt-in per row; this makes the message carry the pairing too. When a row fails, the diff, the row name and the message then all agree about what was expected and what was measured.
Test-only, +94/-9 in tests/hrx-ops-test.cpp, no runtime behaviour.
|
VERDICT at 5401116: READY This is the improvement on enum class RouteKind { FallThrough, AddOnServed, LoomRouteServed };
struct RouteOutcome { RouteKind kind; std::string served_by; bool expectation_also_scheduled; };Three things checked, in the order they matter: 1. The decision is pure and the caller acts on it. 2. The stale-opt-in signal is the best part: when the expected Loom kernel ran as well, it prints "… and X ran anyway, so the addon_route opt-in (Y) is no longer needed -- remove it, or it will hide a future mis-selection". That is the one weakness a per-row opt-in has (it can hide a mis-selection nobody re-reviews), turned into a message the run emits by itself. 3. The arm covers all four branches on the host, no device: One nit: in the For the record: my |
…ine#3085) (#471) The last two rows of engine#3085 (fa_decode_next_q8., .true) assert that the loom decode-split-next_q8 kernel takes the FA node. In a tree that builds the private add-on its own FLASH_ATTN_EXT arm takes that node -- hip.fa_decode registers at priority 90 and its only K/V conditions are k->ne[1] >= mask->ne[0] and n_kv <= 2^22, i.e. no capacity cap -- so the row aborts on a name no add-on build can produce, saying nothing about the route it exists for. Accept the tree and LABEL what stops being asserted, which is the shape engine#3120/#469 landed for hrx-ops-test's rows. Not a skip (the suite's only skip is device-presence) and not a known-fail: a known-fail here would report UNEXPECTED-PASS on a no-add-on tree, where this row passes today -- measured, 286/290 on the bench tree, all seven fa_decode_split rows green. Verified: -fsyntax-only with this tree's own compile command, rc 0, 0 errors. The add-on branch is not device-verified here (no add-on tree in this lane); on a no-add-on tree every dispatch name is a loom one, so the loop is never entered and the row behaves exactly as before. Co-authored-by: bong-water-water-bong <[email protected]>
Refs ggml-org#3120. The add-on acceptance itself landed as fork #465 (
f0226577c); this is the half that makes what it gives up visible and assertable, and it came out of checking that merge against this lane's measurement of the same seven/twenty-nine rows.The problem, precisely
require_kernel_subsequence_route()opts a row out of the kernel-name assertion when the add-on takes the node — and then prints:"is served by" reads as a substitution: the add-on's kernel does what the Loom kernel would have done. What actually happened is a weaker claim — the row stops pinning
<kernel>at all and only compares values afterwards. On the merged tree that is not academic: measuring the fourteen opt-ins against the add-on's own id catalog (hrx_kernel_ids.h,gpu-kernels bc3051d5e9) and this lane's full run at84ab5dae8, two of them name a route that is not a replacement for their expectation:decode_attention_qkv.schedulinggemv_wide_decodehip:k_d3eccfeebe3f×2 =gemv_wide_q4k_r2w8u2, +hip:k_043579523ee2=fa_decode_gqaattention_postprocess.decode_factorsgemv_wide_decodeqwen3_moe:qwen3_moe_attention_qkv_postprocess_fused_decodenever runs in either, and the merged comment says so — so this is a documented decision, not a bug. But a green run must not read like the fused kernel is being tested when it is not.The change — one file
route_outcome(sequence, expected, addon_route, loom_route)returnsFallThrough,AddOnServedorLoomRouteServed, plusexpectation_also_scheduled— the three states that were previously one printed sentence. The printer then says what is true:A stale opt-in is now a signal, not a hope. If the Loom kernel the row expects is scheduled anyway, the opt-in is no longer needed and from then on can only hide a real mis-selection — the printer says so by name, and
expectation_also_scheduledmakes it assertable instead of a comment.The arm needs no device — host case
support.route_outcome, five branches: served; served and stale (the signal set); opted in with nohip:object (mustFallThrough, i.e. keep aborting); the engine#444 Loom-route family; and no opt-in at all (unchanged).The shape is deliberate: the table the printer uses is the table the case asserts, which is the lesson engine#3116/pi-os3 landed for
pre-pr-checksthe same night — a printer nobody asserts on is how "accepted" and "accepted for the wrong reason" became the same word.What this does not do
qwen3_moe_attention_qkv_postprocess_fused_decodetestable again needs either an add-on kernel of that name or a row rewritten to assert the unfused route on purpose — a decision for that row's owner, and my earlier comment on Faster multi-gpu strategy? ggml-org/llama.cpp#3120 records both options.hip:object is the one measured for that name. It cannot: the id table lives in the private add-on, so the fork can only report what ran. The measured ids for the four genuine families are in this lane's Faster multi-gpu strategy? ggml-org/llama.cpp#3120 comment (k_a074247a0b6a/k_f7cc5eb2ed87,k_61d118a92b4c/k_3eef74efaf0a,k_c8f927eca76a) for whoever adds that check where the table is visible.One output-order nuance, stated rather than left for review
The refactor is control-flow-preserving except in one case, and it is the only call site that passes both labels —
the
dense_matmul_swiglu.q4_k.q4_k.lowtoken.tokens{2,3,5}.outputs4160rows (addon_route = "kquant_tokens_q8",loom_route = "loom_libs:ggml_kquant_swiglu_decode_f32"). There the old code printed "no hip: kernel scheduled for(kquant_tokens_q8) -- reading the named expectation" and then took the Loom-route arm, i.e. it announced that
it was reading an expectation it did not read. With the decision separated from the printing, that line only appears on the
real fall-through, so those three rows print one line instead of two, and the line that remains is the true one.
Everything else — which branch is taken, which rows abort, and what the value comparison does afterwards — is unchanged.
Evidence
Host case only (no device, no GPU ticket):
Mutation-proven on the part that is new — the stale-opt-in signal removed:
Nothing in the runtime changes; the only behavioural difference is the wording of two stderr lines and one extra line when an opt-in has gone stale.
Also worth knowing while reviewing: engine#3129's compile break is fixed in the base separately (
3829f5a88, fork #468, "pass the consumer tomoe_router_descriptor_layout") — unrelated to this PR, mentioned only so a reviewer who saw that report here is not surprised that it is gone.