Skip to content

docs: the split's third measurement ran on a pre-#782 library, so the split does not pay after all (refs #754) - #1327

Merged
bong-water-water-bong merged 2 commits into
mainfrom
i754-prefixlib
Nov 7, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
i754-prefixlib

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Refs #754. Reverts the verdict in #1306 (95e52c1b) and keeps the two findings that survive: the device-tick unit
correction, and a deployment trap worth more than the number it broke.

What was wrong with #1306's conclusion

Its numbers were right for the binary they came from, and that binary was running a pre-#782 library. Device-free
evidence, reproducible in one command each:

check what the capture used the pin / post-fix build
libggml-hrx path ~/wt/release-rc/work/build/hrx/llama/bin/ (via the binary's RUNPATH — the harness's LD_LIBRARY_PATH=~/wt/c6-control contains only libhrx) ~/.cache/hw-gate/build-13a7fda57a/bin/
mtime 2026-11-02 07:03 2026-11-06 16:12
strings <lib> | grep -c m128_w8_f2_sb 24 0
config/gpu-kernels.config in origin/main — fd69590c…, the commit that build used

The pp2048 anchor the capture relied on ("1563.9 vs 1372.8 tok/s, the regression is gone") could not catch this: pp2048 is
below the M=2048 knee, which is exactly why it is fast on both builds.

The numbers, for both builds

pre-#782 library (what the capture ran) post-fix pin fd69590
iGPU per 256-row group, M=16384 1.441 ms (dispatch count) / 1.055 ms (FLOP cross-check) 0.313 ms (microbenchmark)
asymmetry vs the 8.61 ms NPU tile 6-8x 27-30x
per-GEMM ceiling 1.164x (1.120x) 1.032x
end to end (attention 48.5 %) 1.078x 1.017x
at #754's 4x bar (2.15 ms/tile) 1.650x / 1.254x ~1.12x

So on the build the engine ships, #754's bar stands: a per-GEMM 15 % needs the NPU around 1.9 ms/tile (~4.5x), and less end
to end. And the "3.4-4.6x loop-to-engine gap" that #1306 attributed to dispatch overhead is #782 through a stale install,
not a dispatch gap. A post-fix capture is unrun; the page now says that instead of implying otherwise.

Changed

  • docs/hetero-prefill.md: a second correction block with the evidence above; every pre-fix number re-labelled; the bar
    arithmetic stated for both builds; the "bar stands" verdict restored; the #754 follow-up line and the "will not do" bullet
    rewritten around what generalises — a measurement is a claim about a build, so print the library path, its mtime and its
    kernel-generation marker beside the number (ldd + strings … | grep -c m128_w8_f2_sb is enough — the capture already
    printed the model, the pin and the die temperature).
  • docs/hybrid.md: the ceiling table now carries the post-fix row the shipped engine is entitled to (1.032x per GEMM, 1.017x
    end to end) beside the pre-fix one, with the unrun post-fix capture named; the per-model range is back to 1.008x-1.015x.
  • tools/split_ceiling.py: the three "in-engine" self-test rows stay (they are the arithmetic the thread quotes) and are
    explicitly labelled a pre-hrx: Q4_K prefill at M>2048 is 3.5x slower than the rc-2026-10-31c binaries; the gap is inside libggml-hrx (same llama.cpp pin, same dispatch) #782 measurement.

Verification

  • tools/split_ceiling.py --self-test → PASS; tests/split_ceiling_test.py → PASS, 22 checks; tools/copyright.py --check rc 0.
  • No device work in this PR — the evidence is library metadata and strings, which is the point.
  • An on-box A/B (the Nov-2 library vs the post-fix build, same GEMM, same binary) is queued on the GPU; its numbers will be
    posted here when it runs. Nothing in this PR depends on it: the strings/pin evidence already decides the attribution, and
    the A/B only quantifies it.

cc @pi-prs

… split does not pay after all (refs #754)

The device-tick correction in #1306 was right, and so were its numbers for the binary they came from - but that
binary was running a four-day-old library, so the conclusion drawn from it was wrong. This reverts the verdict
and keeps the two findings that survive.

How it was found, device-free: the harness (~/lb/exp50-split-ratio.sh) sets LD_LIBRARY_PATH=~/wt/c6-control,
which contains only libhrx; libggml-hrx therefore comes from the binary's RUNPATH,
~/wt/release-rc/work/build/hrx/llama/bin/libggml-hrx.so.0.18.0, dated 2026-11-02 07:03 - before the #782 fix. That
library references `m128_w8_f2_sb` 24 times; the post-fix build at ~/.cache/hw-gate/build-13a7fda57a/bin
(2026-11-06 16:12, gpu-kernels fd69590) references it 0 times; and origin/main's config/gpu-kernels.config pins
fd69590c6c471507f6d804751f38473261436350. The pp2048 anchor the capture used to declare "the regression is gone"
could not catch this: pp2048 is below the M=2048 knee.

So, on the pin the engine ships:
  - per-GEMM ceiling at M=16384 is ~1.03x (2 of 64 row-groups), not 1.12-1.16x;
  - #754's bar stands: a per-GEMM 15 % needs the NPU near 1.9 ms/tile (~4.5x), and less end to end because
    attention is 48.5 % of the cell;
  - the "3.4-4.6x loop-to-engine gap" that #1306 attributed to dispatch overhead is #782 seen through a stale
    install, not a dispatch gap. A post-fix *capture* is unrun, and the page now says so instead of implying it.

docs/hetero-prefill.md gains a second correction block with that evidence, re-labels every pre-fix number,
restores the "bar stands" verdict and replaces the "will not do" bullet with the lesson that actually generalises:
a measurement is a claim about a build, so print the library path, mtime and kernel-generation marker beside it
(`ldd` + `strings <lib> | grep -c m128_w8_f2_sb` is enough). docs/hybrid.md's table now carries the post-fix row
the engine is entitled to (1.032x / 1.017x end to end) next to the pre-fix one, and its per-model range is back to
1.008x-1.015x. tools/split_ceiling.py's three "in-engine" self-test rows are kept and explicitly labelled as a
pre-#782 measurement, because they are the arithmetic the discussion quotes.

Verification: tools/split_ceiling.py --self-test PASS; tests/split_ceiling_test.py PASS (22 checks);
tools/copyright.py --check rc 0. No device work in this PR - the evidence is library metadata and strings, which
is the point. The on-box A/B (Nov-2 lib vs the post-fix build on the same GEMM) is queued on the GPU and its
numbers will be posted on the PR when it runs; nothing here depends on it.

@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 84adba7b34d20e88d875487d54c003aa47d11a28. Every row of the attribution evidence reproduces device-free, and the restored verdict follows. I owe a correction: my READY on #1306 accepted "the split clears #754's bar" without checking which library the capture loaded. The tick-unit fix in #1306 was right; the conclusion drawn from it was about a stale install. This PR is the right repair.

The attribution, re-derived here

  • The capture binary: exp50-split-ratio.sh runs ~/.local/share/1bit-hrx-a5271d9/hrx/llama/bin/llama-bench (built 11-02 07:05) with LD_LIBRARY_PATH=~/wt/c6-control:$SDK/lib. c6-control holds only libhrx.so*. Under exactly that environment, ldd resolves libggml-hrx.so.0 => ~/wt/release-rc/work/build/hrx/llama/bin/libggml-hrx.so.0 through the binary's RUNPATH.
  • That library: libggml-hrx.so.0.18.0 has mtime 2026-11-02 07:03 and 24 m128_w8_f2_sb strings. The post-fix build ~/.cache/hw-gate/build-13a7fda57a/bin/libggml-hrx.so.0.18.0 has mtime 2026-11-06 16:12 and 0.
  • The pin: origin/main:config/gpu-kernels.config → fd69590c…. compare 262c2f9a (gpu-kernels#48, #782's fix)...fd69590c = ahead 6 / behind 0, so the pin contains the fix.

So the capture measured the pre-#782 _sb tiles, and the pp2048 anchor could not have caught that, as the body says.

Arithmetic and tests: with 0.313 ms/256 rows, the integer scan at the 8.61 ms tile gives 1.032x per GEMM. split_ceiling.py --self-test PASS, tests/split_ceiling_test.py PASS, copyright.py --check rc 0.

Nits, not blocking

  • "~1.12x at the 2.15 ms bar" (hetero-prefill.md:236, :331, and the body table) is the number from the retired 0.288 ms input. With 0.313 ms the scan gives 1.143x (n=7: max(57·0.313, 7·2.15) = 17.84 against 20.03). The conclusion is unchanged (a per-GEMM 15 % still needs ~4.5x), but the cell should match its input.
  • End to end: with the page's own 51.5 % split share, 1/(0.485 + 0.515/1.032) = 1.016x. The 1.017x in hybrid.md:279/281 is the 52.3 % share. Pick one share per page.
  • The post-fix column compares the microbenchmark (0.313 ms) with a pre-fix in-engine number. The body says the post-fix capture is unrun; the queued A/B is what makes the two columns the same instrument.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

##1327 ready for review at 84adba7b — build pass 6m40s, CodeQL pass, all five Analyze pass. The one red is pr_agent, and it is the self-hosted runner, not a finding: ##[error]the local model (coder-llm on :8090) does not answer after ~5 min of retries (same job, same message, on other heads today).

Two notes for the reviewer:

  • The evidence in the body is deliberately device-free (ldd + strings <lib> | grep -c m128_w8_f2_sb + the pin in config/gpu-kernels.config), because that is the class of check that would have caught both corrections before they merged.
  • The on-box A/B is still queued (the GPU has held a 45-min fnpre ticket since 06:49 and there are ~16 entries behind it); when it runs I will post the Nov-2-vs-post-fix factor as a comment. Nothing in the correction depends on it.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The on-box A/B is withdrawn — I will not hold a GPU slot for a confirmation while 15 lanes queue

When I opened this PR the A/B (Nov-2 library vs the post-fix build, same GEMM, same binary) was queued as the quantitative
follow-up. It has now waited ~1.3 h behind a 45-minute fnpre hold and 15 other entries, and the correction does not depend
on it, so I cancelled it rather than keep a device slot for a number that can only confirm an attribution the metadata already
settles. Stating that here instead of leaving a queued ticket silently.

The confirmation, done device-free while it waited — the two libraries' kernel corpora:

libggml-hrx.so.0.18.0 the capture ran (Nov-2) post-fix build 13a7fda57a (Nov-6, gpu-kernels fd69590)
m128_w8_f2_sb references 24 0
dense_prefill dispatch registration present (8 refs) present (8 refs)
origin/main config/gpu-kernels.config — fd69590c…

i.e. the two libraries register the same dense-prefill dispatch and differ in exactly the spilling tile family #782 was about —
which is the whole of the claim: the capture's 1.441 ms per 256-row group belongs to a pre-fix kernel selection, and the post-fix
pin's number is the microbenchmark's 0.313 ms.

If a reviewer wants the wall-clock factor anyway, the queued arm is ~/mosaic-bench/split754.sh-style — same binary,
LD_LIBRARY_PATH pointed at each libggml-hrx in turn, one --mode gpu GEMM at M=16384 — about 10 s of GPU once a slot frees.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

754 - Partially compliant

Compliant requirements:

Non-compliant requirements:

  • None

Requires further human verification:

  • None

782 - Partially compliant

Compliant requirements:

  • The PR identifies and corrects the root cause of the regression (libggml-hrx build differences)
  • The PR ensures that performance measurements are tied to specific library builds

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect Performance Ceiling

The PR updates the performance ceiling calculation to reflect that the previous measurement was taken with a pre-#782 library that had a performance regression. The corrected ceiling is ~1.03x instead of the previously reported 1.12-1.16x, which means the split does not pay off as previously thought. This correction is important because it affects the decision to implement the hybrid route.

**What that does to the bar**, stated for both builds so neither can be quoted alone. On the **pre-#782 library
the capture ran**: iGPU 1.441 ms per 256 rows, NPU 8.61 ms per tile, 64 row-groups at M=16384, iGPU-only =
92.2 ms -> 9 row-groups on the NPU, both sides at 79.3 ms, **1.164x** (1.120x on the 1.055 ms reading), and
**1.650x** at #754's 2.15 ms/tile bar. On the **post-fix pin** (`fd69590`, the microbenchmark's 0.313 ms per
group, iGPU-only 20.03 ms): 2 row-groups -> **1.032x**, and **~1.12x** at the same 2.15 ms bar. The second row
is the one the shipped engine is entitled to, so the page's bar stands: a per-GEMM 15 % needs the NPU near
1.9 ms per tile (~4.5x), and less end to end because attention is 48.5 % of the cell. M<=2048 stays unresolved:
1.00x / 1.143x on the pre-fix build, and no measurement on the post-fix one.
Deployment Trap

The PR highlights a deployment trap where a harness can silently measure a four-day-old runtime, producing a plausible wall clock measurement (653 tok/s) while actually running on an older, slower library. This is a critical finding for ensuring that performance measurements are accurate and tied to the correct build.

> **Second correction, 2026-11-07 07:0x.** The unit fix stands, and so does every corrected number *for the binary it was
> taken on* - but that binary was running a **pre-#782 library**, so the conclusion drawn from it was wrong. The harness
> (`~/lb/exp50-split-ratio.sh`) sets `LD_LIBRARY_PATH=~/wt/c6-control`, which contains **only `libhrx`**; `libggml-hrx`
> therefore comes from the binary's RUNPATH, `~/wt/release-rc/work/build/hrx/llama/bin/libggml-hrx.so.0.18.0`, and that file is
> dated **2026-11-02 07:03** - four days before the #782 fix. Two device-free checks settle it: that library references
> `m128_w8_f2_sb` **24 times**, while the post-fix build at `~/.cache/hw-gate/build-13a7fda57a/bin` (2026-11-06 16:12,
> gpu-kernels `fd69590`) references it **0 times**, and `origin/main`'s `config/gpu-kernels.config` pins
> `fd69590c6c471507f6d804751f38473261436350` - i.e. **the pin already carries the fix; the installed runtime the capture
> used was stale**. The pp2048 anchor could not have caught this: pp2048 is below the M=2048 knee, which is why it is fast
> on both builds.
>
> So the 1.441 ms and 1.055 ms per 256-row group below are the **regressed** kernel selection, the "3.4-4.6x slower than the
> microbenchmark" is #782 seen through a stale install rather than a dispatch-side gap, and on a post-fix library the iGPU
> side of the ratio is the microbenchmark's own 0.29-0.31 ms per group (27-30x from the NPU) unless a post-fix **capture**
> says otherwise - which is unrun. What that restores is the page's original verdict: **on a fixed build the split does not
> pay** (ceiling ~1.03x), and #754's bar stands. The genuinely new finding of the whole exercise is the deployment one: a
> capture harness can silently measure a four-day-old runtime, and the wall clock (653 tok/s) looked plausible on both.
Incorrect Ceiling Calculation

The PR corrects the ceiling calculation in docs/hybrid.md to reflect the updated performance data from the corrected measurements. The previous calculation was based on a pre-#782 library and resulted in a ceiling of ~1.164x, whereas the corrected value is ~1.032x, which significantly impacts the perceived benefit of the hybrid route.

| **post-fix pin `fd69590`, microbenchmark (0.313 ms/256)** | **20.03 ms** | **1.032x** | **2 of 64 tiles** | **1.017x** |
| engine's own prefill, **pre-#782 library** (1.441 ms/256) | 92.22 ms | 1.164x | 9 of 64 tiles | 1.078x |
| engine's own prefill, **pre-#782 library**, at the 4x NPU bar | 92.22 ms | 1.650x | 26 of 64 tiles | 1.254x |

The row the shipped engine is entitled to is the **third**: main pins `fd69590c`, which carries the kernel fix, and
the capture the fourth row comes from ran on a library that still referenced the spilling `m128_w8_f2_sb` tiles 24
times. On that build a perfect concurrent split is worth **~1.7 % of prefill**, which is the number engine#754 is
blocked on. What is *unrun* is an engine-side capture with the post-fix install - until someone takes it, the best
estimate is the microbenchmark's rate on the post-fix build, not the stale capture's.

@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 7c2a78aa5fc5533726bb8bb6b701fc5208496978. Main merges only since my READY at 84adba7b: no non-merge commit of its own, and the PR's own +/- lines against its merge-base are identical (hash 0de8cf8fba84). The review at 84adba7b stands (the stale-library attribution reproduced; the ~1.12x → 1.143x and share nits are still open).

@bong-water-water-bong
bong-water-water-bong merged commit f7714ec into main Nov 7, 2026
9 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the i754-prefixlib branch November 7, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant