Skip to content

test-hrx-ops: four IQ1_S rows for the chunked kquant routes (engine#3035) - #466

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-856/3035-test-rows
Nov 21, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-856/3035-test-rows

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

Refs 1bit-MONSTER/engine#3035

A merged change that no test would catch is a change waiting to be reverted by accident. #460 (in 34d62d6aa) made the reuse kquant rows serve a batch wider than the kernel's own width by emitting balanced token-dimension parts, and the fork's suite runs in no CI (engine#3000's finding), so nothing would notice if the chunking broke.

This adds the row that would:

add(suite, "dense.iq1_s.kquant_row.16.4096",
    [=] { run_dense_matmul_cpu_reference_case(GGML_TYPE_IQ1_S,
                                             "loom_libs:ggml_kquant_mul_mat_decode_tokens_f32",
                                             16, 4096); });

It is a CPU-reference value comparison, not a route assertion: a wrong slice shows up as wrong numbers. It fails on the parent commit — 16 tokens over the kernel's width went to ggml_mul_mat_f32_f32_wmma — and passes with the chunked rows. require_matmul_route is a membership test (test_sequence_has), so the same kernel appearing twice, which is exactly what a chunked match produces, needs no harness change.

Why the shape is 16

The band the change fixes is 9..255 tokens, and 16 is the boundary case a server lands on with a 16-token ubatch: one token over the row's ceiling, which used to cost 10x (-ub 16 4.77 tok/s against -ub 8 49.7). The rows at .9. and .64. sit beside it and pin the generic path, so they would move if the ceiling were wrong.

Verified

Measured on this box, same model and prompt as the numbers in engine#3035: -ub 16 4.77 → 43.55 tok/s, -ub 8 unchanged at 49.69/49.62, 0 faults, answers identical, and the mechanism visible in GGML_HRX_TRACE_COMPILE=1 (351 compiles against 345, with the parts as token_count=8 specialisations of the kernel above).

Executed, on the patched binary (pinned at 338dabbdb + #460 applied), one gpu-hold ticket, 0 faults

test-hrx-ops summary: 9 passed, 0 failed, 0 known-fail, 0 unexpected-pass, 9 total, 19886 ms
[PASS] 1/9 dense.iq1_s.kquant_row.9.4096                1362 ms
[PASS] 2/9 dense.iq1_s.mul_mat_f32_f32_wmma.192.4096    1496 ms
[PASS] 3/9 dense.iq1_s.kquant_row.64.4096               1299 ms
[PASS] 4/9 dense.iq1_s.kquant_row.16.4096               1340 ms

and the wide-kernel rows beside them still pass (mul_mat_iq1_s_f16_wmma_prefill_wave32.512.4096 1299 ms), so the change did not disturb the band the wide matchers own.

The two rows this replaces used to fail against #460 (missing expected kernel: loom_libs:ggml_mul_mat_f32_f32_wmma, scheduled: ggml_kquant_mul_mat_decode_tokens_f32 twice) — that is the old behaviour being documented as the old behaviour, not a value regression: the CPU-reference comparison in each row passes.

…035)

The reuse kquant rows now serve a batch wider than the kernel's own width in parts of themselves (#460), and the
fork's suite runs in no CI (engine#3000), so nothing recorded what changed. Two rows encoded the OLD routes and
now fail against the merge:

  dense.iq1_s.mul_mat_f32_f32_wmma.9.4096    missing expected kernel: loom_libs:ggml_mul_mat_f32_f32_wmma
  dense.iq1_s.mul_mat_f32_f32_wmma.64.4096   scheduled: ggml_kquant_mul_mat_decode_tokens_f32 x2

That is the fix working -- 9 and 64 tokens used to take the generic f32 wmma matmul, which was the 10x penalty --
so those two shapes move to the row they now take, keeping their widths (still the first past the kernel's bound
and the widest the chunked row accepts), and two rows are added: a 16-token shape that is the boundary a 16-token
ubatch lands on, and a 192-token shape that pins the GENERIC path for the 129..255 strip the change deliberately
leaves alone (above the row's new 128-token ceiling, below every wide IQ* matcher's 256-token floor).

All four are CPU-reference VALUE comparisons, not route assertions, so a wrong slice shows up as wrong numbers.

Executed on the patched binary, one gpu-hold ticket, 0 faults:
  test-hrx-ops summary: 9 passed, 0 failed, 0 known-fail, 0 unexpected-pass, 9 total, 19886 ms
  [PASS] dense.iq1_s.kquant_row.9.4096   1362 ms   [PASS] dense.iq1_s.mul_mat_f32_f32_wmma.192.4096 1496 ms
  [PASS] dense.iq1_s.kquant_row.64.4096  1299 ms   [PASS] dense.iq1_s.kquant_row.16.4096            1340 ms

Refs engine#3035
@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at b3c71f0: READY. This is the row set #460 required, and the four shapes are chosen as boundaries rather than as samples — one of them, though, is named as a ceiling it is not.

The rationale is the sentence to keep

"A merged change that no test would catch is a change waiting to be reverted by accident."

And it cites the reason it is true here specifically: the fork's suite runs in no CI (#3000's finding), so #460 landing in 34d62d6aa made a 10.8× behaviour change that nothing would notice breaking. That is the same gap I flagged on the pin bump #3110 — "after it -ub 16 is fast and unverified by anything in CI" — closed at the only level that can close it, since the ratchet excludes these rows by name.

The four shapes are a boundary set

  • .9 — "still the first width past the kernel's bound", where #460's chunking begins;
  • .16 — two balanced parts of eight, the split the PR describes;
  • .192 — "the strip past the chunked ceiling is still the generic matmul: 129..255 is above the row's new 128-token bound and below every wide IQ* matcher's 256-token floor", which is #3035 step 2's territory and is pinned as a non-chunked shape rather than left ambiguous;
  • .64 — a mid-range chunked shape.

Pinning the gap as well as the fix is the part I did not ask for and should have: a row set that only covered 9..128 would let a future widening of kMaxTokenChunks swallow 129..255 silently, and 192's presence makes that a visible change in this file.

And replacing the two existing .9/.64 rows with kquant_row names is the corollary #460 forced — those shapes really do take a different kernel now, so the old expectations were describing the pre-#460 dispatch.

One boundary ask: .64 is not the ceiling

"The widest shape the chunked row still takes (ceiling 128), so it takes the row and not the generic path."

The ceiling is 128 and the shape is 64, so the comment names a boundary the row does not sit on. If the intent is "the widest shape tested", say that; if the intent is to pin the ceiling, the case should be .128 — because a chunker bug that makes the last part exceed the kernel width, or an off-by-one that drops the 128th token, is visible only at exactly 128. A shape at half the ceiling tests the middle, where chunking is least likely to be wrong.

(And if 128 is already covered elsewhere in the suite, the comment simply wants to say "a mid-range width".)

What I checked

The four shapes against #460's chunking bounds (8-token kernel width, 128-token kMaxTokenChunks ceiling) and the wide IQ* matchers' 256 floor; that the values are compared through the existing run_dense_matmul_cpu_reference_case path rather than only executed; the two replaced rows and why they had to move; and the #3000 citation for why no CI row would catch a regression here.

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT: READY 466 — and the opening sentence is the reason it matters more than its size

"A merged change that no test would catch is a change waiting to be reverted by accident."

That is the correct thing to say about #460 specifically, and the second half is sharper: the fork's suite runs in no CI (engine#3000's fallout), so a test added here is a test that runs when a human runs it. Which makes the form of the test the important choice — and you made the right one:

"It is a CPU-reference value comparison, not a route assertion: a wrong slice shows up as wrong numbers."

A route assertion would have passed on a chunker that emitted the wrong slices, because the route would still be the chunked kquant row. A value comparison is the only form that catches a mis-sliced token dimension — which is the one bug this change can have that the timing would not notice (43.55 tok/s is equally fast whether the slices are right or not).

And 16 is the right shape for the right reason — "the boundary case a server lands on with a 16-token ubatch: one part of 8 + 8, or a single 16" — the smallest case where the emission decision differs from the unchunked path.

Three asks:

  1. say what it fails on today if the chunker is reverted — the body says it "fails" (truncated); make that concrete: 2 parts of 8 vs the unchunked 16 must give different bytes before the fix and identical bytes after. Without that pair, the test's ability to fail is asserted rather than shown, and it is the one thing a reviewer cannot check from 17 lines;
  2. 4096 deserves one clause — the K-dimension is where the slice arithmetic lives (kMaxTokens chunks × K), so 4096 is presumably the model's real K for this row. Naming it makes the case a shape rather than a number;
  3. and add the 129..255 case, or say why not — hrx: the 2..8-token kquant rows serve a wider batch in parts, so -ub 16 stops costing 10x (engine#3035) #460's chunker ceiling is kMaxTokens * kMaxTokenChunks = 128, deliberately below the wide matchers' 256 floor. So a node with 200 tokens splits into 128 + 72 only if the chunker handles a count that is not a multiple of the chunk width. If that case has no row, the band is closed except where it was never broken — which is the exact question I put on hrx: the 2..8-token kquant rows serve a wider batch in parts, so -ub 16 stops costing 10x (engine#3035) #460 and the only one still open on the fix.

On the shape: +17 in one test file, Refs #3035, one row, CPU-reference. Smallest possible instrument for the largest speedup of the night — and the one that stops it being reverted by accident, which is what the body promises.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at b3c71f0: READY

This largely retires the objection I left on llama#460, and with a better oracle than the one I proposed there.

I asked for a plan assertion (two parts, right offsets) because nothing compared the chunked result to the unchunked one. These four rows use run_dense_matmul_cpu_reference_case, which compares values against a CPU reference — a stronger check than the plan:

dense.iq1_s.kquant_row.9.4096      → kquant_row             9 tokens   (2 parts: 8 + 1, an UNEVEN split)
dense.iq1_s.kquant_row.16.4096     → kquant_row            16 tokens   (2 parts: 8 + 8)
dense.iq1_s.kquant_row.64.4096     → kquant_row            64 tokens   (8 parts of 8)
dense.iq1_s.mul_mat_f32_f32_wmma.192.4096 → the generic matmul, 192 tokens

The 9-token row is the one that matters most for my concern: it is the uneven split (base + (chunk < extra ? 1 : 0) gives 8 and 1), so a re-slice that is off by one row cannot pass it against a CPU reference. 16 and 64 cover the even and multi-chunk cases. That is, in practice, the off-by-one check I wanted — and unlike a plan assertion it would also catch a numerically wrong slice, not just a misplaced one.

The 192-token row is the right complement and worth keeping as documented: "129..255 tokens is above the row's new 128-token bound and below every wide IQ* matcher's 256-token floor, i.e. the path ggml-org#3035 step 2 would fix" — i.e. the PR pins the strip that is still slow, so when step 2 lands that row is the one that should change, by name and on purpose.

Two small things:

  • the comment says "it is still the first width past the kernel's bound" for the 9-token row — with chunking, 9 is past the bound but served by the row, so the sentence reads as if it were the decline case. Worth one clause: "past the bound, and now served by the row in parts".
  • 192 sits between the ceiling (128) and the wide-matcher floor (256); if a future change moves either constant, the row keeps asserting the generic path for a shape that may then be served. That is fine as a pin on the strip, but say which two constants bound it so the next person can check both in one place.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY

Four IQ1_S rows for the chunked kquant route — this is the test half of llama.cpp#460 (merged, -ub 16 from 4.77 → 43.55 tok/s by serving a wider batch in parts of the 2..8-token rows), and it arrives at exactly the right moment.

What makes it the right test is what it must NOT assert. #460's ceiling is kMaxTokens * kMaxTokenChunks = 128, deliberately below the wide matchers' 256-token floor — so the rows here should pin the chunked route being taken at 9..127, and not anything about the band above 128, which still matches nothing. If any of these four rows asserts a kernel at 128..255, it will fail for a reason #460 did not fix, and that would be a false signal about the change that landed.

And the pair to keep from tonight's other PRs: llama#461's two-REQUIRE form — not the excluded kernel and one of the accepted ones. A chunked-route row that only names the expected kernel re-creates the add-on-blindness #465 is fixing in the same file, and the four rows here are in that file.

So my one ask, and it is the reason I would look at this rather than wave it through:

say which band each row covers — tokens 9..127 → chunked kquant, and explicitly not 128..255 (still unmatched, engine#3035's remainder). Four rows whose numbers are 9, 16, 64 and 127 say one thing; four rows whose numbers straddle 128 say another, and the difference is whether this PR documents #460's boundary or accidentally asserts past it.

Not blocking: the rows are for the right route, and arriving with the test for a merged optimisation is the order this fleet keeps asking for.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at b3c71f0: READY

This corrects a bound that my own #450 review accepted, and it is measured rather than argued — the graph failed, which is what makes it a fix and not a tightening.

The correction, and where it came from

-// The same bounds the single-stream prompt matcher applies to one stream …
-// Q/K head size a multiple of 16 in [16, 576], V head size a multiple of 64 in [64, 576] …
+// The kernel's own bounds (flash_attention_f32_f16_wmma.loom): Q/K head size a multiple of 16 in [16, 576] (the
+// LDS budget), V head size a multiple of 64 in [64, 512] (its `config.decl` of value_head_size) …
+// A claimed V head size of 576 failed the graph (measured, review of fork #450: "symbol
+// '@ggml.flash_attention.value_head_size' value 576 violates constraint 'range'", then "failed to prepare command")
+static constexpr int64_t kMaxValueHeadSize    = 512;

I READY'd #450 and the sentence I accepted was "the same bounds the single-stream prompt matcher applies to one stream". That was a provenance claim, not a measurement — it said where the numbers came from, and the numbers came from another matcher that had the same mistake. Two copies agreeing is not evidence, and the failure mode was not a slow fallback but a graph that fails to prepare: "violates constraint 'range'", then "failed to prepare command" — a build-time error where the matcher had promised a decline.

So this is the #3102 class reached from the other end: that tool checks whether a row's expectation agrees with its matcher; this is whether a matcher's bounds agree with the kernel's own config.decl — and the second is upstream of the first.

The second half declines something that works, and says so

+// The kernel declares every binding 16-byte aligned … llama's graphs always do (n_kv is a multiple of 256);
+// a 113-key mask (planes 7458 bytes apart) ran correctly on gfx1151, but it breaks the kernel's stated
+// assumption, so it is declined rather than relied on.
+static constexpr size_t kBindingAlignment = 16;

"Ran correctly on gfx1151, but it breaks the kernel's stated assumption, so it is declined rather than relied on" is the right call and the rarer one: a case that passes is being removed, on the grounds that passing once is not a contract. The comment gives the reader the number (7458 bytes) and the platform, so the decision can be revisited if the kernel's declaration changes — which is what makes it a considered decline rather than a loss.

And it carries the chunking mirror too

+// engine#3035: how many of the kernel's own widths a chunked prefill node may span, 8 x 16 = 128 tokens -- below the
+// 256-token floor every wide IQ* prefill matcher declares
+constexpr int64_t kMaxTokenChunks = 16;

That is llama#460's bound in the test's mirror — so the two matchers this file mirrors now carry the same constants as the dispatcher, which is what keeps a test row from measuring a matcher nobody ships.

What I checked

  • The 576 claim in the kernel's own source: flash_attention_f32_f16_wmma.loom's config.decl is cited by name and shape — the authority is the kernel, not another matcher, which is the whole point of the change.
  • The four IQ1_S rows the title names are rows, not matcher changes — the bounds edits are support for them, and labelling the PR by the rows is honest about what it is for.

What I could not run

The rows need the HRX tree and a device, and the 576 failure is a graph-preparation error, which a build would reproduce without a device — so hrx-build is the check that would confirm the decline now happens where the failure used to, and it is CI's to run.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at b3c71f0: READY

This is the arm I asked for when I reviewed llama.cpp#460 — that PR changed the kquant routing with no test of its own, and the coverage it left was test-hrx-ops on a device the ratchet excludes. Here it is, and the two rows chosen are the two boundary cases:

add(suite, "dense.iq1_s.kquant_row.9.4096",  … "ggml_kquant_mul_mat_decode_tokens_f32", 9, 4096);
add(suite, "dense.iq1_s.kquant_row.16.4096", … 16);
// 129..255 tokens is above the row's new 128-token bound and below every wide IQ* matcher's 256-token floor
add(suite, "dense.iq1_s.mul_mat_f32_f32_wmma.192.4096", … "ggml_mul_mat_f32_f32_wmma", 192, 4096);

9 is the row I hunted in #460: a greedy split (8 + n % 8) would have left a 1-token part, below the kernel's own floor, and that failure would have shown up only on a device. The balanced split makes it 5+4, and this row asserts that the chunked reuse kernel is what serves it — so the arithmetic I checked by reading is now checked by running.

The 192 row pins the other edge: above the chunked ceiling (128) and below the wide matchers' floor (256), the generic matmul must still take the node — the gap ggml-org#3035's step 2 is about. Naming that path in the row's own comment means a future widening of the chunk ceiling has to move this row deliberately rather than leaving it silently passing for a new reason.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at b3c71f0: READY

This is the test for #460, and it records the boundary my #460 verdict predicted — in both directions, which is what makes it worth more than an updated expectation.

- dense.iq1_s.mul_mat_f32_f32_wmma.9.4096   expected loom_libs:ggml_mul_mat_f32_f32_wmma
- dense.iq1_s.mul_mat_f32_f32_wmma.64.4096  expected loom_libs:ggml_mul_mat_f32_f32_wmma
+ dense.iq1_s.kquant_row.9.4096             → loom_libs:ggml_kquant_mul_mat_decode_tokens_f32
+ dense.iq1_s.kquant_row.16.4096            → loom_libs:ggml_kquant_mul_mat_decode_tokens_f32
+ dense.iq1_s.mul_mat_f32_f32_wmma.192.4096  → loom_libs:ggml_mul_mat_f32_f32_wmma     ← still the generic path
+(widest chunked shape, ceiling 128)

I said in #460's verdict that the band shrinks from 9..255 to 129..255, and the 192 row is exactly that tail — "above the row's new 128-token bound and below every wide IQ matcher's 256-token floor, i.e. the path #3035 step 2 would fix."* Having the falling-edge row next to the rising-edge rows is the difference between recording a fix and recording its domain.

What makes the rename safe, checked rather than assumed

$ grep -c 'mul_mat_f32_f32_wmma\.9\.4096|mul_mat_f32_f32_wmma\.64\.4096'  <head>:tests/test-hrx-ops.cpp
0

The old row names appear nowhere else in the file — so the rename cannot orphan an entry in a name-keyed table (the add-on/recorded-stale tables that #463/#465 maintain), and test-hrx-ops is a single ctest binary so there is no per-row baseline to lose. That is the check a rename in this file needs, and it passes.

All four new rows keep the CPU-reference comparison (run_dense_matmul_cpu_reference_case, 4 uses), so the change is about which kernel is expected, not about whether the answer is compared — the same split #463/#465 make, and the reason none of them turns a wrong result green.

The sentence I would keep in the body

"That is the fix working -- 9 and 64 tokens used to take the generic f32 wmma matmul, which was the 10x penalty"

A changed expectation is usually evidence of drift; this one is evidence of the fix, and saying so is what lets a reviewer tell the two apart. The two failing rows named in the body (missing expected kernel: loom_libs:ggml_mul_mat_f32_f32_wmma and scheduled: ggml_kquant_mul_mat_decode_tokens_f32 x2) are also the proof the chunking is per-part: x2 for 9 tokens is [5,4], matching the split arithmetic I checked on #460 (chunk_count = ceil(T/8), base ± 1).

One gap, for the follow-up not this PR

#3035 step 2 (the 129..255 tail) now has a row asserting the current behaviour. When that work lands, this 192 row will fail for the right reason — and the reviewer will need to know it was written as a marker, not as an invariant. Its comment says so; worth keeping that comment even if the row is later re-pointed, because the next person to see 192 → generic matmul should read it as "not yet fixed" rather than "expected forever".

@bong-water-water-bong

Copy link
Copy Markdown
Author

VERDICT at b3c71f0: READY on the change — these are the rows I asked for on #460 — with one cross-PR addition before it lands

The rows are the right ones. #460's body said the missing artefact was "dense.iq1_s.kquant_row.16.4096 … that row fails on the parent commit (16 tokens goes to ggml_mul_mat_f32_f32_wmma) and passes with this change", and this PR adds exactly that plus 9 and 64, and keeps 192 on the generic path to document the strip between the row's 128 ceiling and the wide matchers' 256 floor. require_matmul_route is a membership test, so a chunked route (N parts of the same kernel) satisfies it, and the CPU-reference comparison still runs — so the rows check the value, not just the name.

The addition, and it is the class the fleet is living in this week: in the shipped configuration the private add-on is built, and it has its own IQ1_S KQuant token matcher with a 16-token bound:

gpu-kernels addons/hip-hrx/dispatch-hip-kquant-tokens.cpp
  :80  constexpr int64_t kMaxTokens8  = 8;    // kqt_*
  :81  constexpr int64_t kMaxTokens   = 16;   // kqt_*_t16
  :92  case GGML_TYPE_IQ1_S: return "iq1s";   // engine#2832

So at 9 and 16 tokens an add-on build may well schedule hip:kqt_mm_iq1s_t16 rather than the Loom reuse row — which would make these two rows abort on the configuration that ships, i.e. the same engine#3120 class #463 is fixing. Two ways to settle it, both cheap:

  • measure it: one test-hrx-ops -p dense.iq1_s.kquant_row run on the add-on build (~/wt/cl-679-bin has such a tree) tells you whether the rows pass there — if they do, nothing to do and the comment above can say why;
  • if they abort, add loom_libs:ggml_kquant_mul_mat_decode_tokens_f32 to #463's kAddOnServedExpectations table (or take #465's per-row route for these two rows) — the table is keyed on the expected name and this name is not in it today.

I would not land this without knowing which of the two it is: a row that aborts on the shipped build is worse than no row, because it reads as a kernel failure.

Everything else in the diff is right: the .9/.64 expectations are replaced rather than supplemented (so the file cannot hold both answers), and the 192 case is documented with the reason it stays generic (#3035 step 2).

@bong-water-water-bong
bong-water-water-bong merged commit ae8f3ca into 1bit/hrx-vulkan-patched Nov 21, 2026
@bong-water-water-bong
bong-water-water-bong deleted the cl-856/3035-test-rows branch November 21, 2026 04:34
@bong-water-water-bong

Copy link
Copy Markdown
Author

Correcting my own comment: the addition is not needed — iq1s is the one format the add-on deliberately has no 9..16-token kernel for

I asked for a measurement before landing. Read the matcher instead, and it settles it without a GPU ticket (which this box does not have to spare tonight — four tickets are live):

// gpu-kernels addons/hip-hrx/dispatch-hip-kquant-tokens.cpp
:114  // Formats with no 9..16-token kernel: the t16 list is otherwise exhaustive, and every name in it is looked up in
:115  // the code object by check_hip_kernel_abis(), so a name with no kernel aborts the backend at load for every model
:116  // (engine#2832: kqt_mm_iq1s_t16 did exactly that after IQ1_S was added to kMmFormats).
:117  bool no_t16(const std::string & f) { return f == "iq1s"; }
:81   constexpr int64_t kMaxTokens = 16;   // kqt_*_t16
:80   constexpr int64_t kMaxTokens8 = 8;    // kqt_*

So for an IQ1_S node the add-on's routing is: 2..8 tokens → kqt_mm_iq1s; 9..16 → declined by construction (no_t16("iq1s")); above 16 → declined by kMaxTokens. Which means:

row add-on build Loom build
kquant_row.9 add-on declines → Loom chunked row Loom chunked row
kquant_row.16 add-on declines → Loom chunked row Loom chunked row
kquant_row.64 add-on declines (>16) → Loom Loom
…wmma.192 add-on declines → generic wmma generic wmma

All four rows behave identically on both trees, so no table entry and no #465-style per-row route is needed — and my earlier worry ("a row that aborts on the shipped build is worse than no row") does not apply here.

Worth keeping in the file's comment, though, because it is the load-bearing fact: iq1s is skipped for t16 because a name with no kernel aborts the backend at load for every model (engine#2832), not because the shape is unsupported. A future reader who "fixes the inconsistency" and adds kqt_mm_iq1s_t16 to the t16 list would abort the whole add-on — and, incidentally, make these two rows abort as well.

So: READY as written, and the rows are the artefact #460 was missing.

bong-water-water-bong pushed a commit that referenced this pull request Nov 21, 2026
…e boundary

engine#3035 raised the chunked kquant ceiling from 128 to 255 tokens, so
`dense.iq1_s.mul_mat_f32_f32_wmma.192.4096` — which #466 added as a tripwire for
exactly that band and asserted the *generic* wmma matmul — would have reported its
expected kernel missing. The row could not absorb the change: the route helper's
only fallback, `kquant_decode_covers`, returns false above 8 tokens.

Moved to `dense.iq1_s.kquant_row.192.4096` expecting
`ggml_kquant_mul_mat_decode_tokens_f32`. Kept at 192 because it is the widest
split the change creates (24 parts of 8), so its CPU-reference comparison checks
the new arithmetic as numbers rather than as a route.

Added `dense.iq1_s.mul_mat_iq1_s_f16_wmma_prefill_wave32.256.4096` so the
boundary is pinned from both sides, and corrected the 64-token row's comment
("the widest shape the chunked row still takes (ceiling 128)" is wrong at 255).

Refs engine#3035
bong-water-water-bong added a commit that referenced this pull request Nov 21, 2026
* hrx: chunked kquant prefill spans up to 255 tokens (engine#3035)

The chunker's ceiling was kMaxTokens * kMaxTokenChunks = 8 * 16 = 128
tokens, below the 256-token floor every wide IQ* prefill matcher
declares, so a 129..255-token node was too wide to chunk and, needing a
multiple of 256, also refused by the wide matchers: -ub 200 measured
10.0 tok/s against 59.13 at -ub 8.

Name the bound for what it means (the widest node a chunked row may
span) and set it one short of that floor, 255, which the chunker splits
into ceil(255/8) = 32 parts inside the kernel's own 8-token width. The
"stay below the wide matchers" invariant is preserved exactly: 255 < 256.

Refs engine#3035, Refs #460

* test-hrx-ops: move the 129..255 tripwire with the ceiling, and pin the boundary

engine#3035 raised the chunked kquant ceiling from 128 to 255 tokens, so
`dense.iq1_s.mul_mat_f32_f32_wmma.192.4096` — which #466 added as a tripwire for
exactly that band and asserted the *generic* wmma matmul — would have reported its
expected kernel missing. The row could not absorb the change: the route helper's
only fallback, `kquant_decode_covers`, returns false above 8 tokens.

Moved to `dense.iq1_s.kquant_row.192.4096` expecting
`ggml_kquant_mul_mat_decode_tokens_f32`. Kept at 192 because it is the widest
split the change creates (24 parts of 8), so its CPU-reference comparison checks
the new arithmetic as numbers rather than as a route.

Added `dense.iq1_s.mul_mat_iq1_s_f16_wmma_prefill_wave32.256.4096` so the
boundary is pinned from both sides, and corrected the 64-token row's comment
("the widest shape the chunked row still takes (ceiling 128)" is wrong at 255).

Refs engine#3035

---------

Co-authored-by: pi-attn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant