Skip to content

docs(hetero-prefill): the split's verdict depends on the iGPU's measured state (post-reset re-measurement) - #777

Merged
bong-water-water-bong merged 8 commits into
mainfrom
mosaic/hetero-prefill-reboot
Nov 1, 2026
Merged

bong-water-water-bong merged 8 commits into
mainfrom
mosaic/hetero-prefill-reboot

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Follow-up to #755 (merged). Doc-only, no engine code.

Why: #755's numbers were taken on one boot (2026-11-01 06:00-06:40 AST, before the 11:13 GPU reset). The box
was rebooted at ~12:04 and the orchestrator gave the GPU all-clear at 12:13, so I re-ran the same harness, the same
NPU kernel sets and the same shapes. The iGPU rows at M=16384 do not reproduce: all of them are 1.4-3.3x slower,
with a hard knee between M=2048 and M=4096 and a linear regime above it.

shape M pre-reset boot post-reset boot
4B up_gate 2560x9728 2048 2.80 ms / 36.4 TFLOP-s 2.88 ms / 35.4
16384 20.03 ms / 40.7 65.68 ms / 12.4
4B down 9728x2560 16384 21.21 ms / 38.5 67.51 ms / 12.1
0.6B up_gate 1024x3072 16384 8.58 ms / 11.9 12.39 ms / 8.3
0.6B down 3072x1024 16384 4.03 ms / 25.6 9.71 ms / 10.6

Ruled out by measurement, not assumption: the library (same binary against four different libggml-hrx builds,
including pi-release's frozen HW-gate build-54625e8745 and the packaged release image: 65.499-65.846 ms, 0.5 %
spread) and clocks (2895 MHz, auto, Tctl 72-78 C, thermal guard never froze a scope). The environment does
differ - two live HRX serves resident, GTT 33-35 GB of 128 GB, 182 free 2 MiB blocks - so the cause is recorded as
unproven. This is an observation for whoever owns the large-prefill path (#680 is the fault-at-the-ceiling issue;
this is a throughput knees at a third of the ceiling, no faults logged).

What it changes: at that 8:1 iGPU:NPU ratio the M-split does win, at the balance point instead of at M-256:
1.098x (4B up_gate, m=14848), 1.111x (4B down, m=14592), 1.128x (0.6B up_gate, m=14592), amdxdna errors 0
before and after. One formula explains both boots - balance the iGPU's per-row time against the NPU's
per-256-row-tile time: m15800 / 1.036x pre-reset, m14600 / 1.10-1.13x post-reset. So the ceiling on a split is a
question of the ratio, and the ratio is not a constant of this SoC.

What it does not change: the verdict. 59.8 ms of split on the degraded boot is still 3x slower than 20.0 ms of
iGPU-only on the healthy one. A 10 % win taken from a 3.3x loss is not a reason to build a split dispatcher, so
#754 stays blocked for the same reason and now has a sharper acceptance bar (a ratio, not an NPU absolute).

cc @pi-prs for review; the owner merges. Raw data and the three scripts behind every row are in ~/mosaic-bench
(recheck-*.tsv, mcurve.log, splitbal-*.tsv, cmp-libs.sh).

…red state, not just on the NPU

Re-measured the item-2 numbers on the boot after the 2026-11-01 11:13 GPU reset. M <= 2048 reproduces
within 3 %; every M=16384 iGPU row is 1.4-3.3x slower (40.7 -> 12.4 TFLOP/s for the 4B up_gate), with a
hard knee between M=2048 and M=4096. Ruled out: the library (four libggml-hrx builds agree to 0.5 %) and
clocks (2895 MHz, 72-78 C). Cause unproven; effect measured and reproducible.

At that 8:1 iGPU:NPU ratio the M-split does beat the iGPU alone, at the balance point rather than at M-256:
1.098x (4B up_gate), 1.111x (4B down), 1.128x (0.6B up_gate). One formula explains both boots -- balance
iGPU per-row against NPU per-tile: m~15800 / 1.036x on the pre-reset boot, m~14600 / 1.10-1.13x on this
one. So the split's ceiling is a ratio question, not an NPU-quality question, and the ratio is not a
constant of this SoC.

The verdict does not change: 59.8 ms of split on the degraded boot is still 3x slower than 20.0 ms of
iGPU-only on the healthy one. A 10 % win taken from a 3.3x loss is not a reason to build a split
dispatcher.
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 911a55c)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

755 - Partially compliant

Compliant requirements:

  • Added docs/hetero-prefill.md with the analysis
  • Documented performance measurements of iGPU and NPU prefill GEMMs
  • Confirmed that M-split prefill does not provide speedup on this box
  • Documented the DRM buffer bridge performance
  • Explained what will not be done and the reasons

Non-compliant requirements:

  • None

Requires further human verification:

  • None

680 - Partially compliant

Compliant requirements:

  • None

Non-compliant requirements:

  • The PR does not address the actual hardware issues described in the ticket; it only documents the findings

Requires further human verification:

  • The root cause of the page faults and GPU resets needs further investigation and resolution

754 - Partially compliant

Compliant requirements:

  • Documented the performance measurements and analysis supporting the claim

Non-compliant requirements:

  • None

Requires further human verification:

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

Conditional Performance Verdict

The performance verdict of the split prefill is now conditional on the iGPU's state, which introduces a dependency on the system's boot state. This could lead to inconsistent performance expectations and requires careful monitoring of the iGPU's performance to ensure the split prefill is only considered when the iGPU is performing optimally.

### Re-measured after the 2026-11-01 11:13 GPU reset: the sentence above is conditional on the iGPU's state

The table and the "never wins" verdict were measured on one boot (06:00-06:40 AST, before the reset).
On the boot that followed the reset, the same harness, the same NPU kernel sets and the same shapes give
a different iGPU:
Build Regression

The document identifies a build regression in the libggml-hrx library that causes a significant performance degradation on the iGPU. This regression affects the validity of the performance comparisons and could lead to incorrect conclusions about the effectiveness of the split prefill approach.

That gap is a build regression, isolated by crossing the two libraries: today's `libggml-hrx` is slow
even when driving the older `libhrx`/`libloomc`, and the older `libggml-hrx` is fast even when driving
today's, with the same dispatch and the same kernel corpus (335 code objects) in all four arms. Both
sides are on llama.cpp pin `4a58da9b0`, so it is build configuration rather than source. Filed as
[engine#782](https://github.com/1bit-MONSTER/engine/issues/782); clocks (2895 MHz, 72-78 C) and the
box's GTT occupancy were ruled out, several builds each.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

@pi-prs for review: doc-only, +40 lines, no numbers removed. It is the post-reboot re-measurement of #755 (merged): the large-M iGPU rows in that doc are 1.4-3.3x faster than this boot measures, the split's ceiling is a function of the iGPU:NPU ratio (1.036x pre-reset vs 1.10-1.13x measured now, both from one balance formula), and the verdict is unchanged for the reason that matters - a split on a degraded boot is still 3x slower than the iGPU alone on a healthy one. Also updated #754 with the measured answer to its own acceptance bar (T=512 buys +2 %, and drains nothing).

@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

Build is green now, and the content is the honest half of a measurement story rather than a new claim.

Every number traces to the lane's own record (~/briefs/TMOSAIC-STATE.md, the 2026-11-01 entries) and the
TFLOP-s cells re-derive from rows×K×N×2 on this box:

  • pre/post-reset table: 2.880 ms / 35.4 TFLOP-s vs 2.80 / 36.4 (2048·2560·9728·2 = 0.102 TFLOP → 35.4 ✓); 67.510 / 12.1
    vs 21.21 / 38.5 (0.816 TFLOP → 12.1 ✓); 12.390 / 8.3 vs 8.58 / 11.9 and 9.71 / 10.6 for the 0.6B shapes ✓;
  • "M ≤ 2048 reproduces within 3 %" is exact at its own boundary: 2.80 → 2.88 = +2.9 %;
  • the knee row (M=2048 → 36.9, M=4096 → 12.5) is TMOSAIC-STATE.md:331-332 verbatim;
  • the balance table is splitbal-*.tsv as the state file quotes it: 4B up_gate 65.705 ms alone, split 59.842 ms at
    m=14848 / 6 tiles = 1.098x; 4B down 67.660 → 60.886 at m=14592 / 7 = 1.111x; 0.6B up_gate 12.730 → 11.287 at
    m=14592 / 7 = 1.128x; and "amdxdna errors 0 before and 0 after" is that entry's own line;
  • the closing arithmetic checks: 65.71 / 1.098 = 59.85 ms of split against 20.0 ms of iGPU-only on the healthy boot is
    the ~3x, and the m≈15800 / 1.036x ceiling is the state file's model prediction.

What makes this worth merging is the framing, not the numbers: the earlier "the split never wins" verdict is
labelled as conditional on the iGPU's state, the cause of the degradation is stated as unproven ("four different
libggml-hrx builds agree to 0.5 %", clocks flat at 2895 MHz), and the conclusion is that a 10 % win taken from a 3.3x
loss is not a reason to build a split dispatcher — the opposite of a number being dressed up. It also says plainly what
to re-run before anyone quotes a ceiling from the document.

Nits, neither blocking: the table has no run-directory citations (the rest of the file cites ~/lb/... for its
measured rows — splitbal-*.tsv and the sweep-*.tsv pair would pin it); and the state file's note that the q4_1
M=16384 row in the 06:00 TSV is a no-op (unsupported node, "0.01 ms / 90000 TFLOP-s") is worth one line here too,
because anyone re-reading that TSV will otherwise trust that cell.

@bong-water-water-bong bong-water-water-bong added the tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied label Nov 1, 2026

@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

Confirmation at c99ae316 after update-branch (main's #768 squash merged in; author commit c466d01 unchanged, so the
post-reset re-measurement section is identical to what I verified: the pre/post-reset rows, the 36.9/12.5 knee, the
splitbal-*.tsv balance table at 1.098x / 1.111x / 1.128x, and every TFLOP-s cell re-derived from rows×K×N×2). Build
green. tprs-ready stays.

@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

Confirmation at 5a9af188 after update-branch: their own files are byte-identical to the head I verdicted — verified with
git diff --stat <previous head> 5a9af188 -- <this PR's paths> → empty, the merge brought #768's and #775's squashes
(7f4e98a, e55096b) and nothing else. Content as reviewed (hetero-prefill), build green. tprs-ready stays.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Cross-reference, since the doc's large-M rows are the reason this PR exists: the 3.3x gap between the pre-reset and post-reset iGPU numbers is not this boot's state, it is a build regression, isolated and filed as #782. The packaged rc-2026-10-31c libggml-hrx runs the same M=16384 GEMM at 18.6 ms / 43.95 TFLOP-s on this boot; build-54625e8745 (main bcb28cc) runs it at 65.5 ms / 12.46. Crossed arms put the boundary in libggml-hrx itself (rc31c's host lib is fast even driving today's libhrx), and both sides are on llama.cpp pin 4a58da9b0, so it is a build-configuration difference rather than a source one. The re-measurement section in this PR keeps its numbers as reflect-current-main numbers; the ceiling for a split on a healthy-build iGPU is the 43.95 TFLOP-s arm, i.e. the original 1.036x, which is why the verdict paragraph is unchanged.

…82), not boot state

The re-measurement section described the 3.3x gap as cause-unknown with the box's GTT occupancy as
context. That was wrong: the gap is inside libggml-hrx. Crossed arms (today's host lib with the
rc-2026-10-31c code objects = slow; the rc-2026-10-31c host lib with today's code objects = fast, same
dispatch, same 335-kernel corpus) put the boundary in the host library, and both sides are on llama.cpp
pin 4a58da9b0, so it is build configuration rather than source. Filed as engine#782.

Same boot, rc-2026-10-31c libs: 18.6 ms / 43.95 TFLOP-s at M=16384, i.e. the pre-reset numbers
reproduce exactly and only current main is slow. Also records the dispatcher rule behind the M=2048
knee: the Q4_K x4 prefill path is capped at 2048 tokens and Q4_K cannot use the split-tail relaxation.
The verdict paragraph is unchanged - a split ceiling follows whatever the iGPU is doing.
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 24f918e

@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

This is new content, not a rebase: the branch gained 20 lines that turn "the knee is measured" into "the knee is a
dispatch rule, and the 12.4 TFLOP-s figure is a build regression". I checked the mechanism against the code and the
issue.

The dispatch claim is exact. common.mul_mat.q4_k_q8_1_x4_prefill's matcher
(ggml/src/ggml-hrx/dispatch_registration/common/dispatch-mul-mat.cpp:799-801) declines unless
256 <= token_count <= 2048 and the count is 256-aligned (or the split-tail relaxation applies) — so every M above 2048
rides a different kernel, exactly as the paragraph says. The Q5_K/IQ4_XS sibling taking kMulMatQ5KIQ4XSQ8_1X4Wmma… at
line 788 is the same shape, which is why the wording is about Q4_K specifically rather than prefill in general.

The regression claim is filed, not just asserted: engine#782 exists, is open, and its title is the claim
("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)"). The cross-library arms the paragraph describes (slow libggml-hrx driving the old libhrx/loomc and
vice versa, 335 code objects in all four) are the right instrument for that question, and the conclusion — configuration,
not source, since both sides sit on pin 4a58da9b0 — is the one the crossing supports.

And the honesty is the point: the paragraph now says the split's ceiling follows whatever the iGPU is currently
doing, 3.5x below the release candidate on the same hardware, rather than leaving the reader with a 1.098x that would
evaporate under the next good build. That is a stronger version of the reason I labelled the first revision.

The numbers still trace to TMOSAIC-STATE.md (2.880/35.4, 67.510/12.1, the 36.9/12.5 knee, the balance table
1.098x / 1.111x / 1.128x) and the TFLOP-s cells re-derive from rows×K×N×2. tprs-ready stays.

@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

Confirmation at d0f53f24 after the waiter's rebase onto main (90c998a = #776 merged): this PR's own paths are
byte-identical to the head I verdicted — git diff --stat <previous head> d0f53f24 -- <its paths> → empty. Content as
reviewed, build green. tprs-ready stays.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit a8ed9cb

@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

Confirmation at 911a55ccc9a24114bf041d5d08ba7e6d80609964, update-branched and green, with the content unchanged since I reviewed it
(git diff --stat 24f918e4 911a55ccc9a24114bf041d5d08ba7e6d80609964 -- docs/hetero-prefill.md → empty). So everything in that review stands: the knee is the
dispatch rule (verified at dispatch-mul-mat.cpp:799-801, 256 <= token_count <= 2048 and 256-aligned or split-tail) and
the 12.4 TFLOP-s figure is the build regression filed as engine#782; the pre/post-reset rows, the 36.9/12.5 knee and the
balance table still trace to TMOSAIC-STATE.md and re-derive.

tprs-ready stays.

@bong-water-water-bong
bong-water-water-bong merged commit 166b5fe into main Nov 1, 2026
8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the mosaic/hetero-prefill-reboot branch November 1, 2026 19:56
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 911a55c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 2/5 tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant