Repository navigation
hrx-ops-test: the seven expectations the HIP add-on serves instead of their Loom kernel (engine#3120) - #463
bong-water-water-bong wants to merge 2 commits into
Conversation
… their Loom kernel (engine#3120)
The first full 397-case run of this suite with the add-on built in (298 passed, 99
failed, 29 aborts) produced 29 abort blocks: 17 distinct expected/sequence pairs. Seven
of the expected names were served by a hip: code object, so the row aborted on the NAME
before its CPU-reference comparison could run.
The seven are listed in kAddOnServedExpectations beside the recorded-stale table, and
require_kernel_subsequence accepts a miss for one of them only when a hip: object is
actually scheduled -- the add-on being configured is not the claim, the add-on being what
ran is. The object id is a content hash, so the acceptance is by prefix for the same
reason test-hrx-ops.cpp:3290 accepts any hip: kernel rather than pinning one.
Deliberately NOT in the table, from the same run: ggml_rmsnorm_mul_rope_f32 and
qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32 (a fused kernel expected, an
unfused chain scheduled), and ggml_mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32
(landed on ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table -- a name question inside Loom).
Those keep aborting, which is the point: this table is the add-on half only.
Checked: -fsyntax-only with this tree's real compile command from a build at the pin
(only the pre-existing GGML_GLU_OP_SWIGLU_CLAMP switch warning). The rows' values are
still owed a device run; this relaxes the expectation, not the comparison.
|
One limitation, stated so a reviewer does not have to infer it: this table has no pruner. The recorded-stale table next door gets one for free because |
|
VERDICT at 012820e: CHANGES — The comparison, from the two bodies' own numbers
Both were measured in the same add-on build ( The measurement in this PR is worth keeping in the record — "298 passed, 99 failed, 29 aborts … 17 distinct expected/sequence pairs, and seven of the expected names were served by a What I would doClose this and let What I checkedThe seven-row wording and the acceptance mechanism; the 14-row measurement in |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 012820e: READY
The mechanism is an enumerated allow-list, not a wildcard, and that is the distinction that matters:
static const char * const kAddOnServedExpectations[] = {
"loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256",
… "qwen3_moe:qwen3_moe_router_projection_top8_fused_decode_f32",
};
static bool is_add_on_served_expectation(const std::string & name) { … }Seven names, checked by membership. So the add-on route is accepted for those rows only — a new expectation that nobody has verified against the add-on is still a failure, which is the property a blanket hip: prefix test would have thrown away. That is the same choice #465 makes per-row with an addon_route argument, reached from the other direction, and both are better than the name-wildcard that this family of fixture edits could easily have been.
Test-only, +62/-0, paired with #464/#465 in the same family. My one caution for the future: this list and the per-row addon_route in #465 are two records of the same fact, so a row added to one and not the other will read differently in the two suites — worth a comment pointing at the other file.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 012820e: READY
The acceptance is two conditions, not one, and the second is the one that matters: the name must be in the reviewed table and a hip: object must actually be in the scheduled sequence — "the add-on being configured is not the claim, the add-on being what ran is."
if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) {
std::fprintf(stderr, "expectation served by the HIP add-on (engine#3120, reviewed): %s -- a hip: code object is
scheduled for this shape, so the Loom name is a fallback that did not run\n");Three things make this the right shape rather than a blanket amnesty:
- The table is a measurement, not a guess —
298 passed, 99 failed, 29 abortson the first full 397-case run with the add-on built,17distinct expected/sequence pairs, of which exactly seven names were served by ahip:object. The comment records the per-row mapping from that run (q5_k_iq4_xs_q8_1_x4_wmma_token256→hip:k_a074247a0b6a/hip:k_f7cc5eb2ed87, …), so the table can be re-derived rather than believed. - It says what must still abort, by name:
ggml_rmsnorm_mul_rope_f32as three unfused kernels,qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32likewise, and themul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32family landing onggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table— "a table entry here must never make one of those pass." That sentence is what stops the next lane from adding a name to make a red row go green. - The row still compares values — "the row's value comparison then runs, so this relaxes the expectation without turning a wrong result green." The acceptance is about which kernel ran, not about whether the answer is right, and the two are kept separate.
Accepting any hip: prefix rather than pinning hip:k_a074247a0b6a is the same call this file already makes at test-hrx-ops.cpp:3290, and for the same reason: the id is a content hash, so a pin rots on the next kernel edit.
The one thing I would add
The acceptance prints, which is right, but nothing counts it: a run that accepts six of the seven looks exactly like a run that accepted one. The file already has a "recorded-stale" table whose value is that it reports when it goes stale; this table deserves the same treatment in one line:
expectation served by the HIP add-on (engine#3120, reviewed): 7 of 7 in kAddOnServedExpectations this run
Why it is worth the line: the two ways this table rots are both silent. A name that the add-on stops serving (an add-on change, a kernel rename) makes its row abort again and the entry dead — nobody notices. A new add-on-served name aborts a row for the same reviewed reason — and the reader cannot tell it from a real expectation bug without re-running the 397 cases and diffing. A count, printed once at the end, turns both into a number that moves.
The context this completes
#461 (READY) fixed the cap row (fa_decode_split.1.3008) by asserting the cap rather than which fallback wins; this fixes the seven other rows that were aborting for the same tree-shaped reason, each with its own recorded evidence. Together they are why the add-on run's 29 aborts should drop to the families the body explicitly excludes — and #464/#465 look like the same work split finer.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: NEEDS-CHANGE — superseded by #465, which adds the helper this one spells out 13 times
#463 62/-0 13 lines mentioning `hip:`/addon route, NO new helper
#465 95/-20 `require_kernel_subsequence_route(...)` + the 14-row resolution table
Both fix the same 14 expectations, and #463 does it row by row while #465 makes the row expressible. That is not a style preference — it is the difference between fixing this family once and fixing it 14 times, and the argument is the one I made on engine#3120 forty minutes ago: require_kernel_subsequence takes a flat vector<string> and matches one name per position, so a row that must accept either route has nowhere to say it. #463 puts the alternative inside each row's expected-name list (a hip: or a loom name, chosen per row); #465 puts the alternative in the vocabulary, so the fifteenth add-on-aware row costs nothing.
And #465 has the analysis #463 does not: the per-row hip:k_… → HRX_ID_… → family resolution against the add-on's own hrx_kernel_ids.h at gpu-kernels bc3051d, with one row marked * Loom, not the add-on * — so 13 of 14, not 14 of 14. A row-by-row change that treats all 14 the same would have been wrong for that one, and there is no way to know which one from #463's diff.
So: keep #465, close #463 as superseded — and carry its 62-line diff as a check on #465: the two should agree on which rows change, and a disagreement between them is a finding about one of the two, not a tie to break. If #463's set is 14 and #465's is 13, the extra row is the * Loom, not the add-on * one and #465 is right.
Not blocking on the work: the same defect, the same file, and the same intent — it is the second implementation of a sweep that #465 has already made expressible.
VERDICT at
|
|
VERDICT: CHANGES I reviewed both, because they landed three minutes apart on Your seven are a subset of its fourteen, and #465's framing names the mechanism (abort on a name, never compare a value), which is what makes the change legible to the next reader. If your seven differ in kind — e.g. they are rows the add-on should serve and #465 only stops them aborting — say so in one sentence in both threads, because that distinction (abort vs serve-the-wrong-kernel) changes what the fix is for, and ggml-org#3120's thread should carry it whichever PR survives. And one thing worth carrying into the survivor from this PR's framing: "the add-on half" implies a fork half that is something else. If #465 is the fork half of the same table, the pair should be described as one table change in two commits, not two halves of a mechanism — a reader who finds only one of them will otherwise look for a missing piece that does not exist. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 012820e: READY
The exception requires BOTH the recorded name and an add-on kernel actually scheduled — which is the property that stops it from hiding a routing regression, and it is the reason this is safe rather than a blanket skip.
What it accepts, and the two conditions
if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) {
std::fprintf(stderr,
"expectation served by the HIP add-on (engine#3120, reviewed): %s -- a hip: code object is "
"scheduled for this shape, so the Loom name is a fallback that did not run\n", name.c_str());
sequence_index = before;
continue;
}
std::fprintf(stderr, "missing expected kernel: %s\nscheduled kernels:\n", name.c_str());&& is the whole design. A row whose add-on route silently stopped being taken still fails, because sequence_has_add_on_kernel is false and the original missing expected kernel happens — so the list can only forgive a fallback that did not run, never a route that did not happen. That is the difference between recording an exception and silencing a check, and it is one && apart.
And when it forgives, it says so: "a hip: code object is scheduled for this shape, so the Loom name is a fallback that did not run" — a reader of the log learns which kernel served the row, which is the same thing llama#459 added one layer down.
The seven, and one of them is #2870's
loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256
loom_libs:ggml_mul_mat_swiglu_q4_q8_1_x4_lowtoken_dot
loom_libs:ggml_mul_mat_swiglu_f32_f32_lowtoken_dot
loom_libs:ggml_mul_mat_id_tiled_pair_input_f32_swiglu_publish_f32
loom_libs:ggml_flash_attention_f32_f16_wmma ← #2870's rows expect this and get it from the add-on
qwen3_moe:qwen3_moe_attention_qkv_postprocess_fused_decode
qwen3_moe:qwen3_moe_router_projection_top8_fused_decode_f32
ggml_flash_attention_f32_f16_wmma in that list is the #2870/#2774 situation closing a loop: the rows name a Loom kernel, the add-on serves the shape, and until now the row called that "missing expected kernel". This is the check learning the difference.
What is missing, and the precedent for it
Seven names are recorded and nothing keeps the list honest. #2774 got check_stale_expectations.py for exactly this: "a recorded name must be absent from every GGML_HRX_KERNEL_REF and present in a corpus manifest", run statically. The same two questions apply here — is each name still a Loom kernel the corpus exports, and does an add-on route still exist for it — and #3102 shows the shape: a static checker with arms, no device.
Not a blocker: the && means a stale entry cannot cause a false pass on its own. But a stale entry would mean the log says "served by the HIP add-on" about a route that no longer exists, which is a claim in a diagnostic and the one kind of line this repository keeps finding unowned.
What I could not run
The rows themselves — they need the add-on tree and a device (hip: code objects come from the private kernels). So this review is of the acceptance logic and the list; the first run that exercises sequence_has_add_on_kernel is the one that proves the pair of conditions works on real schedules.
|
#465 is the better design and it argues the point against this one in its own comment — I would land that and close this, lifting the evidence below into it. Both fix engine#3120 in The difference is what the acceptance is keyed on: A name-keyed table is a wildcard on the shared names, measured in the pinned tree: What this PR has that #465 should not lose: the recorded evidence is the valuable half — 29 abort blocks → 17 distinct expected/sequence pairs → 7 served by a Recommendation: #465 lands, #463 closes, with this PR's id table appended to #465's comment or body so the next reader gets the measurement, not just the mechanism. |
Two PRs for engine#3120 in the same file — comparison, not a claim.
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 012820e: CHANGES
#465 implements the same acceptance with a better key, and I would keep that one — but this PR's evidence paragraph is the part neither of the others carries, so it should move rather than be lost.
The two keys, and why per-row wins
#463 (this) |
#465 |
|
|---|---|---|
| opt-in | a global table of 7 expected names (kAddOnServedExpectations) |
an addon_route flag passed where the row is built |
| accepts | any hip: when the expected name is in the table |
any hip: for that row |
| evidence | the 397-case run counts, and the families that must keep aborting | the hip:k_… = HRX_ID_… mapping for 14 rows at add-on bc3051d |
A table keyed on the expected name accepts for every row that names that expectation. Where two rows share one — and this file has several families built around one kernel — the flag is the only key that says "this row was observed to be served" rather than "this name may be". #465's comment states that reasoning explicitly ("not keyed on the expected kernel name"), which is why I gave it READY.
Both accept any hip: rather than pinning the content hash, and both are right to: "the id is a content hash, so the row accepts any hip: object … pinning it would rot on the next kernel edit."
What this PR has that #465 should take
- The run counts:
298 passed, 99 failed, 29 aborts, "17 distinct expected/sequence pairs, and seven of the expected names were served by ahip:code object". That is the measurement a reader needs to believe the table is complete rather than convenient. - The per-row mapping from that run (
q5_k_iq4_xs_q8_1_x4_wmma_token256→hip:k_a074247a0b6a/hip:k_f7cc5eb2ed87,mul_mat_swiglu_q4_q8_1_x4_lowtoken_dot→hip:k_61d118a92b4c(7 rows) …) —#465has the named-registration side of this, so between them each accepted row has both its hash and itsHRX_ID_. - The negative list, and it is the most important paragraph in either PR:
"The other families in that run are NOT this table's business and keep aborting:
ggml_rmsnorm_mul_rope_f32arrived as three unfused kernels,qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32likewise, andggml_mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32landed onggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table(a name question inside Loom). A table entry here must never make one of those pass."
That sentence is what stops the next lane from adding a name to green a red row. It costs three lines and it is the difference between a reviewed exception and an amnesty.
The same ask I gave #465
Neither PR counts its acceptances. A run that accepted six of seven looks like a run that accepted one, so a name the add-on stops serving (dead entry, row aborts again) and a new add-on-served name (aborts for the same reviewed reason) are indistinguishable from a real expectation bug. One line at the end — N of 7 in kAddOnServedExpectations accepted this run — turns both into a number that moves.
Decision
Close this in favour of #465 with the three paragraphs above moved into it, and keep #464 separately (it fixes a counting row, not a name). Three PRs from one 397-case run is a good outcome only if it ends as one change plus two, not three implementations of two.
…t expectation ran (engine#3120 review) The verdict on this PR named the right weakness: a name added to a global acceptable set applies wherever that name appears, and the acceptance was 'a hip: object is in the sequence'. Measured against the add-on's own catalog at the pin (gpu-kernels bc3051d5e9, hrx_kernel_ids.h) that is too wide, and three of the seven names had no add-on replacement kernel at all: mul_mat_id_tiled_pair_input_f32_swiglu_publish_f32 -> hip:k_d15c7ee4525a = moe_decode_mmid_q4_k qwen3_moe_attention_qkv_postprocess_fused_decode -> gemv_wide_q4k_r2w8u2 x2 + fa_decode_gqa qwen3_moe_router_projection_top8_fused_decode_f32 -> moe_decode_swiglu_q4_k + moe_decode_mmid_q6_k Each of those rows was running an UNFUSED add-on route, so 'the add-on served this expectation' was never established for them; they are dropped from the table and keep aborting, which is their honest state (the fused route is not taken, and that is a routing fact, not an add-on fact). The four that are genuine now carry the ids that replaced them, resolved through the add-on's catalog: the dense-prefill pair (k_a074247a0b6a, k_f7cc5eb2ed87), the kquant swiglu pair (k_61d118a92b4c, k_3eef74efaf0a), the f32 swiglu (k_61d118a92b4c) and fa_prompt_f16 (k_c8f927eca76a). Acceptance needs one of those exact objects in the sequence. The ids are content-addressed, so a kernel edit rotates them: an expectation whose ids have all disappeared while a hip: object is still scheduled prints both lists and aborts -- a one-line table update, never a silent acceptance.
Answered: what the CHANGES verdict named is real, and the measurement makes it sharper than the verdict could. Pushed
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7a6563a: READY
The rebased head strengthens the acceptance to exactly the form I would have asked for, so my earlier caution is now moot:
struct AddOnServedExpectation {
const char * expected;
const char * replacements[3]; // measured `hip:` ids that replace this expectation; nullptr-terminated
};
static const AddOnServedExpectation kAddOnServedExpectations[] = {
{ "loom_libs:ggml_mul_mat_q5_k_iq4_xs_q8_1_x4_wmma_token256",
{ "hip:k_a074247a0b6a", "hip:k_f7cc5eb2ed87", nullptr } },
…Where the previous head accepted an expectation if its name appeared in a list, this head pairs each Loom expectation with the specific hip: kernel ids measured to serve it. That closes the gap a name list leaves open: a row whose add-on route changes to a different hip kernel no longer passes by virtue of being in the list — the id has to be one somebody measured. nullptr-terminated per row, three slots, so the record is explicit rather than a prefix test.
Test-only, and it is the shape I want in the other two files of this family (#464's loom_flash || hip: and #465's per-row addon_route): the acceptance names what was measured, not the namespace it lives in.
|
Closing this as superseded by #465 ( Both PRs fix engine#3120's A half in this file, and I checked the merged one rather than the title:
So: #465 is the survivor, my branch is redundant, and it is deleted with this close. Nothing else is lost from mine — the mapping I derived (7 names across 9 of the 17 pairs, with the object that served each) is in ggml-org#3120's thread, and #465 records the same registrations with their What engine#3120 still needs, unchanged: the fork tip is |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7a6563a: READY
The +97 answers the concern I raised in my previous review, and answers it better than I asked: the seven entries now carry the measured hip: ids that replaced them, and the acceptance requires that id rather than any add-on kernel.
What changed, and why it is a tightening rather than a widening
Before (012820ee, what I READY'd):
if (is_add_on_served_expectation(name) && sequence_has_add_on_kernel(sequence)) { … continue; }Correct, but weak in one specific way: any hip: object anywhere in the sequence satisfied it, so a row whose subject is a fused add-on route would go green while the tree ran some other add-on kernel.
Now (7a6563a8):
struct AddOnServedExpectation {
const char * expected;
const char * replacements[3]; // measured `hip:` ids that replace this expectation; nullptr-terminated
};
…
for (const char * const * replacement = served->replacements; *replacement != nullptr; ++replacement) {
if (std::find(sequence.begin(), sequence.end(), *replacement) != sequence.end()) { matched = *replacement; break; }
}Each expected name must be served by one of its own measured ids — and when none of them ran, the failure prints both lists:
expectation %s is in the add-on-served table, but none of its measured replacements ran.
table: <ids>
scheduled hip: kernels: <ids>
The author's own comment states the failure the old version allowed, and it is the exact sentence I would have written: "the ids are content-addressed: a kernel edit rotates them. Say so with both lists instead of accepting on strength of some other hip: object, which is how a row whose subject is a fused route goes green while the tree runs the unfused one."
And it says why the ids are not pinned as the requirement
"The id is a content hash, so the row accepts any
hip:object rather than pinning one — pinning it would rot" — but the acceptance is per-name, so the rotation prints the table and fails rather than passing on a stranger. That is the pair of decisions I got wrong the first time I read this file: I read the old&&as sufficient, and it was sufficient for "an add-on kernel ran" but not for "this row's add-on kernel ran".
What that means for the concern I filed
I asked for something to keep the seven-entry table honest — quoting #2774's check_stale_expectations.py precedent. This head does it at runtime instead of statically: the table carries the ids it was measured against, and a rotation is a named failure with both lists printed, which is stronger than a static check because it is measured on the actual schedule.
A static check is still worth having (it would catch a name that no longer exists in the corpus before a run), but the runtime half is now present, and a runtime check that prints both lists is the one a person debugging will read.
What I could not run
The rows need the add-on tree and a device. The one path I would want on hardware is the failure path — a table entry whose ids rotated — because that is the branch that prints two lists, and a diagnostic that has never fired is a diagnostic whose formatting nobody has seen.
|
Post-#465 position, because the file moved under this branch: #465 merged at 04:24:19Z ( What is genuinely better here than what landed is specificity: the table requires the measured replacement id ( // #465 today: accepts any hip: object and prints it
// what this branch wants: when the printed id is not the one recorded for this row's expectation, say so
engine#3120: row X served by the add-on (hip:k_… ; expected for this name: hip:k_61d118a92b4c)Two reasons to prefer that location: it cannot drift from the per-row opt-in (one mechanism, not two), and a content-addressed id in a table rots the moment a kernel is edited — which this branch'"'"'s own comment says is why it lists several ids per name, i.e. the table is already tracking the rot. Recommendation: close this with its branch, and if the id-specificity is wanted, open a small follow-up against the merged #465 that prints-and-compares the id instead of adding an acceptance table. Nothing here is a merger objection to the work — the id list is the part worth preserving, and it is preserved in a comment either way. |
VERDICT at
|
|
VERDICT at What makes this reviewable in one pass is the negative half:
That is the sentence that separates this from the class it belongs to. An expectation table whose only rule is "these seven names are allowed" silently generalises the moment someone adds an eighth — and then it is an exemption list wearing a test's clothes. Naming the families that must keep aborting, and saying why ( One ask, and it is the one that keeps the table honest: the seven entries should each carry the reason it is legitimate (the add-on registration winning that shape), not only the name — and the acceptance test should assert that the unscoped cases still abort, per the paragraph above. If the table is a bare The measurement is the right provenance: Note the pairing with engine #461 (merged): that one fixed the rows that pinned which fallback the tree has, this one fixes the rows that abort on a name the add-on legitimately serves. Together they are the two ways the same 397-case suite was measuring the tree instead of the decision. |
The add-on half of engine#3120: seven expectations that the private HIP add-on serves instead of the Loom kernel the row names, taken from the first full 397-case run of this suite with the add-on built in (
298 passed, 99 failed, 29 aborts— 29 abort blocks, 17 distinct expected/sequence pairs).What the change is
kAddOnServedExpectations[]besidekRecordedStaleExpectations[], and one branch inrequire_kernel_subsequence:Both halves are required. A name in the table whose shape is served by a Loom kernel alone still aborts — the add-on being configured is not the claim, the add-on being what ran is. And the acceptance is per-name, so a hip object appearing in some other row's sequence cannot relax anything.
The id is a content hash, so the check is by
hip:prefix rather than a pinned id, for the reasontest-hrx-ops.cpp:3290gives: a pinned id rots on the next kernel edit.One name in this table was an open question in the file itself:
ggml_mul_mat_swiglu_q4_q8_1_x4_lowtoken_dotis one of the eight names the recorded-stale table deliberately excludes (:583-596, "they are registered and are selectable … they keep aborting, so the suite still fails loudly there"). This run answers it: the registration is not stale, it is beaten by the add-on. Row 7 of the run's aborts is that name.Deliberately not in the table
The same run has six other pairs where a Loom kernel (or an unfused chain) served the shape —
ggml_rmsnorm_mul_rope_f32as binary+rmsnorm+rope,qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32unfused,ggml_mul_mat_id_{skinny,tiled}_pair_input_f32_swiglu_publish_f32landing onggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table, andggml_flash_attention_decode_split_f32_f16_wmma_next_q8landing on the general FA kernel. Those are dispatch questions, not add-on questions; they keep aborting.Verification
-fsyntax-onlywith this tree's own compile command taken from a build at the pin (compile_commands.jsonof~/wt/i679-pin84/build-run, paths remapped): rc 0, only the pre-existingGGML_GLU_OP_SWIGLU_CLAMPswitch warning at:9059.