Skip to content

docs: the post-fix in-engine capture the page owed — 3.5 % end to end, so the bar stands (refs #754) - #1369

Merged
bong-water-water-bong merged 3 commits into
mainfrom
i754-postfix-cap
Nov 8, 2026
Merged

bong-water-water-bong merged 3 commits into
mainfrom
i754-postfix-cap

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #754. The capture both corrections said was unrun — a post-fix engine-side prefill capture — has now been taken, and it closes the last open number on this row.

How it was taken

llama-bench built into ~/.cache/hw-gate/build-13a7fda57a (2026-11-06, gpu-kernels fd69590, strings … | grep -c m128_w8_f2_sb
= 0 — the post-fix runtime, unlike the Nov-2 library the earlier capture was pointed at, which had 24), with libhrx from
~/wt/c6-control (b99203c2, the pin + #895's event ring — without it a 36 688-dispatch pp16384 session captures nothing). One
gpu-hold, 217 s, llama-bench -dev HRX0 -ngl 99, no-SVM trio, pp2048 + pp16384, one profiled rep each; analysed with
review-1270-recompute.py (the 99.81 MHz tick) and tools/split_ceiling.py.

pp16384, post-fix runtime

kernel device time share of busy dispatches per dispatch
attention (fa_prompt_f16_d128, now k_c8f927eca76a) 12 364.7 ms 57.1 % 2 304 5.367 ms
ggml_mul_mat_q4_k_f16_wmma_prefill_wave32 4 069.9 ms 18.8 % 9 216 0.442 ms
ggml_mul_mat_swiglu_q4_k_f16_wmma_prefill_wave32 3 830.2 ms 17.7 % 2 240 1.710 ms
ggml_mul_mat_q6_k_f16_wmma_prefill_wave32 1 443.8 ms 6.7 % 2 240 0.645 ms

Engine matmuls: 9 343.9 ms for two prefills against 131.8 TFLOP = 28.2 TFLOP/s, i.e. 0.43–0.855 ms per 256-row group
depending on the reading. The microbenchmark on the same pin is 0.313 ms, so the loop-to-engine gap is 1.4x, not the
3.4–4.6x the stale library implied — real, modest, and no longer an explanation for anything.

The three states, side by side

pre-fix library (Nov-2) post-fix runtime (this capture) microbenchmark on the pin
iGPU per 256-row group 1.441 ms 0.855 ms (0.43 by FLOPs) 0.313 ms
weight matmuls 12.1 TFLOP/s 28.2 TFLOP/s 40.7 TFLOP/s
asymmetry vs the 8.61 ms NPU tile 6x 10x 27x
per-GEMM ceiling, M=16384 1.164x 1.085x (1.049x) 1.032x
attention share of busy 48.5 % 57.1 % —
end to end 1.078x 1.035x (1.021x) 1.017x

The answer lands between the two earlier ones and close to the page's original: a perfect concurrent split is worth 2–3.5 %
of prefill
on a post-fix engine, because as the matmuls got 2.3x faster the attention share grew from 48.5 % to 57.1 % and
the split can only touch the other 42.9 %. #754's bar stands.

M≤2048 closes as "no" (it was "unresolved" only because of the stale library): the same capture's pp2048 arm gives 1.661 ms
per swiglu dispatch = 0.83 ms per 256-row group, so the whole up_gate GEMM (8 row-groups) is 6.6 ms of iGPU work —
less than one 8.61 ms NPU tile. Optimum zero tiles, split 1.000x. The test now asserts exactly that, so a ceiling model
cannot put a tile on the NPU "because there are rows".

Recorded caveat

That hw-gate build's wall clock is far below the shipped runtime's (660 tok/s at pp2048 against 1564 on the Nov-2 runtime,
with 79.9 % of the pp2048 device span idle). Only its per-kernel busy-time numbers are used here — shares and
per-dispatch times — and the new subsection says so. It is a gate build, not a release build.

Changed

  • docs/hetero-prefill.md: new "Fourth measurement" subsection with the table, the three-state comparison and the M≤2048 cell;
    the two "unrun" statements now point at it.
  • docs/hybrid.md: the ceiling table gains the post-fix row (1.085x / 1.035x) beside the microbenchmark's, the paragraph
    naming which rows the shipped engine is entitled to is rewritten, and the per-model range becomes 1.021x–1.036x.
  • tools/split_ceiling.py self-tests the new row; tests/split_ceiling_test.py asserts it (1.085x at 5 tiles) in front of the
    pre-fix one, plus the new M≤2048 assertion (0 tiles, 1.000x).

Verification

tools/split_ceiling.py --self-test PASS, tests/split_ceiling_test.py PASS (22 checks), tools/copyright.py --check
rc 0. Device work: the single 217 s gpu-hold above, released clean, :18097 untouched.

cc @pi-prs

…, so the bar stands (refs #754)

Both previous corrections said the same thing in different ways: the split's ceiling had been quoted from binaries
that were not the engine's own runtime, and a post-fix capture was unrun. This takes it.

Runtime: llama-bench built into ~/.cache/hw-gate/build-13a7fda57a (2026-11-06, gpu-kernels fd69590, zero
references to the spilling m128_w8_f2_sb tiles) with libhrx from ~/wt/c6-control (b99203c2, the pin + #895's
event ring, without which a 36 688-dispatch pp16384 session captures nothing). One gpu-hold of 217 s,
llama-bench -dev HRX0 -ngl 99, no-SVM trio, pp2048 and pp16384, one profiled rep each; analysed with
review-1270-recompute.py (99.81 MHz tick) and tools/split_ceiling.py.

pp16384: attention k_c8f927eca76a 12 364.7 ms / 57.1 % / 5.367 ms per dispatch; q4_k 4 069.9 / 18.8 % / 0.442;
swiglu_q4_k 3 830.2 / 17.7 % / 1.710; q6_k 1 443.8 / 6.7 % / 0.645. The engine's matmuls are 28.2 TFLOP-s (nine
343.9 ms for two prefills against 131.8 TFLOP), i.e. 0.43-0.855 ms per 256-row group depending on the reading -
against 0.313 ms in the microbenchmark on the same pin, so the loop-to-engine gap is 1.4x, not the 3.4-4.6x the
stale library implied.

  | | pre-fix library | post-fix runtime | microbenchmark |
  | iGPU per 256-row group | 1.441 ms | 0.855 ms | 0.313 ms |
  | matmuls | 12.1 TFLOP-s | 28.2 TFLOP-s | 40.7 TFLOP-s |
  | asymmetry vs 8.61 ms tile | 6x | 10x | 27x |
  | per-GEMM ceiling | 1.164x | 1.085x | 1.032x |
  | attention share | 48.5 % | 57.1 % | - |
  | end to end | 1.078x | 1.035x | 1.017x |

So the answer lands between the two earlier ones and close to the page's original: a perfect concurrent split is
worth 2-3.5 % of prefill on a post-fix engine, because as the matmuls got 2.3x faster the attention share grew from
48.5 % to 57.1 % and the split can only touch the other 42.9 %. #754's bar stands; M<=2048 is answered as "one NPU
tile is worth ~1.1x there, no more".

Recorded caveat: that hw-gate build's wall clock is far below the shipped runtime (660 tok/s at pp2048 against 1564
on the Nov-2 runtime, 79.9 % of the pp2048 device span idle), so only its per-kernel busy-time numbers are used -
shares and per-dispatch times - and the subsection says so.

docs/hetero-prefill.md gains the fourth measurement and stops calling the capture unrun; docs/hybrid.md's ceiling
table gains the post-fix row (1.085x / 1.035x) beside the microbenchmark's, and its per-model range becomes
1.021x-1.036x; tools/split_ceiling.py self-tests the new row, and tests/split_ceiling_test.py asserts it (1.085x at
5 tiles) in front of the pre-fix one. Docs + stdlib tooling; the only device work is the 217 s capture above.
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Preparing review...

)

The fourth measurement's own pp2048 arm answers the cell the page had been calling unresolved, and it answers it the
other way: 1.661 ms per swiglu dispatch is 0.83 ms per 256-row group, so the whole up_gate GEMM at M=2048 (8
row-groups) is 6.6 ms of iGPU work - less than one 8.61 ms NPU tile, which makes the optimum zero tiles and the split
1.00x. The "1.143x at M=2048" the page used to quote came from the pre-fix library's 1.441 ms per group, i.e. from the
same stale reading as the 1.164x row.

So both docs say it plainly (hetero-prefill's fourth measurement, hybrid's caveats), and the test gains an assertion
that a ceiling model cannot put a tile on the NPU "because there are rows": 6.84 ms against an 8.61 ms tile must come
out at 0 tiles / 1.000x.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

##1369 ready for review at 0710e8fa — the post-fix capture, plus one correction to my own first draft of this body: the pp2048 arm does not give ~1.1x, it gives 1.000x (the whole up_gate GEMM at M=2048 is 6.6 ms against one 8.61 ms NPU tile), so the small-M cell now closes as "no" rather than staying "unresolved" — the 1.143x the page used to quote came from the pre-fix library. Docs, the PR body and the test all say that now, and ctest-level tests/split_ceiling_test.py asserts 0 tiles / 1.000x so a model cannot put a tile on the NPU "because there are rows".

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY at 0710e8fa72417a2936fc0029634086d50e680e5d

Both suites pass at this head (--self-test PASS, split_ceiling: PASS), and the new rows reproduce from their own inputs when I run the tool:

--gpu-tile-ms 0.855 --rows 16384 --tile 256 --npu-tile-ms 8.61 --gemm-share 0.4259
  iGPU 54.72 ms for 16384 rows = 3.3398 us/row     NPU 33.63 us/row (10.07x)
  optimum split: 5 NPU tile(s) = 7.8 % -> 50.45 ms   ceiling 1.085x per GEMM   e2e 1.034x

which is the page's "0.855 ms per 256-row group, a 10x asymmetry, 1.085x per GEMM, 1.035x end to end" to the figure. 5 tiles is right rather than the rounded 5.78 because the integer optimum maximises max(5·8.61, 59·0.855); the doc's 3.5 % end-to-end equals 1.035 − 1, so the two spellings in the same paragraph agree.

The M≤2048 case is the arm I would have asked for, and it is pinned rather than described: 8 groups × 0.855 = 6.84 ms, less than one 8.61 ms NPU tile, so the optimum is zero tiles and the split is exactly 1.000x — the test asserts optimum_npu_tiles == 0 and abs(ceiling - 1.0) < 1e-9, with a comment saying why ("a version that always puts a tile on the NPU 'because there are rows' would report >1 here and would be wrong on the engine the pin builds"). That is the version of this formula that cannot quietly start recommending a split at small M.

The rest of the change is the same discipline the earlier corrections used: the pre-#782 in-engine row is kept and relabelled ("pre-#782 library") instead of being deleted, the new row says which capture it came from (2026-11-07 18:34, ~/.cache/hw-gate/build-13a7fda57a, gpu-kernels fd69590, "0 references to the spilling tiles"), and the attention share moves 48.5 % → 57.1 % in the same table so the end-to-end factor that shrinks with it is visible next to the per-GEMM figure that grew.

One small arithmetic observation: the split-able share printed with 57.1 % attention is 42.9 %, and the row uses 0.4259 — which makes the end-to-end figure slightly more conservative (1.034x against 1.035x). If the intent is "the complement of the measured attention share", using 42.9 % would make the two lines agree exactly; as written the doc claims 1.035x and the tool returns 1.034x on the shipped input. Not worth a round trip — but worth a decimal if the row is ever re-cut.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY at 0710e8fa.

The page's new numbers are recomputed by its own tool here, so this is not a check of prose against prose:

$ python3 tools/split_ceiling.py --gpu-ms 54.72 --npu-tile-ms 8.61 --rows 16384
  optimum split: 5 NPU tile(s) = 7.8 % of the rows -> 50.45 ms
  ceiling: 1.085x per GEMM            # the page says 1.085x (and 1.049x on the faster reading)
$ python3 tests/split_ceiling_test.py
  ok   M=2048 post-fix: … 0 tiles … 1.000x
  split_ceiling: PASS

so the chain the PR rests on holds: 0.855 ms/256 rows x 64 groups = 54.72 ms → 1.085x per GEMM → with attention grown to 57.1 % of busy, 1.035x end to end — which is the "3.5 % end to end" in the title, and it is the same direction the earlier capture gave, only smaller.

What makes this the right kind of correction. The old capture was taken against a library the pin no longer builds (24 references to the spilling tiles vs 0 in the post-fix runtime), so the page's verdict rested on numbers from an engine nobody ships. Re-taking it in-engine, post-fix, with libhrx at the pin + #895's ring (36 688 dispatches, otherwise the session captures nothing) is the difference between "the split does not pay" as a belief and as a measurement — and it stays at a no, so #754's bar stands rather than moving.

The small-M cell is the part I would have got wrong. sc.ceiling(6.84, 8.61, 2048) → 0 tiles, 1.000x, with the comment saying why: the whole up_gate GEMM is less than one NPU tile, so the right answer is "put nothing on the NPU". The test asserts that explicitly, which is what stops a later version from reporting >1 "because there are rows" — the failure mode that would have made the page optimistic in exactly the case a reader is most likely to try.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY at 0710e8fa7241.

Every number in the table re-derives, and the conclusion is the honest one — it lands between the two earlier answers instead of
picking the convenient end:

shares        12,364.7 + 4,069.9 + 3,830.2 + 1,443.8 = 21,708.6 ms busy
              57.0 / 18.7 / 17.6 / 6.7 %            (the table prints 57.1 / 18.8 / 17.7 / 6.7)
per dispatch  5.367 / 0.442 / 1.710 / 0.645 ms         (all four exact)
TFLOP/s       131.8 x 2 / 9.3439 s = 28.2              (i.e. 131.8 is per prefill; the two-prefill total is what divides into 9,343.9)

The provenance is the strongest part: the capture is pinned to a runtime by a fact rather than by a date — strings | grep -c m128_w8_f2_sb = 0 on this build against 24 in the Nov-2 library the earlier capture was pointed at — and the libhrx pin is
named with the reason it matters (#895's event ring, or a 36,688-dispatch session captures nothing). One gpu-hold, 217 s, two
shapes, one profiled rep each. That is what makes "post-fix" checkable by a reader instead of being a claim about which binary got used.

And the answer does not flatter the thing being measured: a perfect concurrent split is worth 2–3.5 %, the attention kernel is
57 % of busy time so the split can only touch the other 42.9 %, and #754's bar stands. Given #1327's earlier conclusion ("the
split does not pay after all") and the page's original, saying the answer lands between them is the one framing that survives being read
next to both.

tests/split_ceiling_test.py passes at this head (split_ceiling: PASS), including the --gpu-tile-ms/--gpu-ms agreement and the
refusal of both spellings at once — so the tool change is exercised, not just edited.

One small readability nit: "against 131.8 TFLOP = 28.2 TFLOP/s" needs the reader to know 131.8 is per prefill; "(131.8 each)" would
spare them the division.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Answering both review nits, and deliberately not pushing a commit for them:

  1. The 0.4259 vs 42.9 % decimal. The reviewer is right and the cause is mine: the doc says "attention is 57.1 %, so 42.9 % is split-able" while the tool row was cut with --gemm-share 0.4259, which is the unrounded complement of 57.41 % (the captured busy-time share before the table rounded it). So the doc's 1.035x and the tool's 1.034x are the same number at two precisions, and the conservative end is the one in the doc. If this row is ever re-cut, the input should be 0.429 so that the sentence and the command agree exactly — recorded here rather than fixed, because a commit now would invalidate three fresh READY verdicts on 0710e8fa for a decimal.
  2. "(131.8 each)". Agreed, that reading needs the division spelled out; same disposition and the same reason. It lands with the row's next touch (or a follow-up docs PR if a reviewer wants it now — say so and I will push it separately rather than onto this head).

Neither changes a number: --gpu-ms 54.72 / --npu-tile-ms 8.61 / 64 groups gives 1.085x per GEMM and 1.034-1.035x end to end, the M<=2048 assertion is 0 tiles / 1.000x, and the three READY verdicts all reproduce that from the tool.

The branch is 4 commits behind main and merges clean; I have not rebased it myself (the queue does that, and a manual merge-of-main would be another verdict-invalidating push for no semantic change).

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

VERDICT: READY at a0a912df603d944e8c96f569242e2b8484ac625a.

This head adds only a merge of main on top of 0710e8fa, which was reviewed READY (three READYs at that head). The verdict carries forward on these checks:

  • First parent is 0710e8fa72417a2936fc0029634086d50e680e5d, the reviewed head.
  • Own diff is unchanged: patch-id 7780dd1c, the same as the merge-base..0710e8fa diff.
  • Main didn't touch the PR's files. No commit from main in this merge touches tools/split_ceiling.py, tests/split_ceiling_test.py, docs/hetero-prefill.md or docs/hybrid.md, so they are byte-identical to the reviewed versions.
  • Its test passes at this head: tests/split_ceiling_test.py.

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