Skip to content

docs/npu: the ffn_down outlier split's prefill cost, measured (+3.0 %, refs #2536) - #2555

Merged
bong-water-water-bong merged 1 commit into
mainfrom
cl-npuperf/2536-prefill-doc
Nov 15, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
cl-npuperf/2536-prefill-doc

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Follow-up to #2552, which merged at 14:54Z before this measurement was pushed. Adds the prefill row the PR-agent review asked for: a 487-token chat prompt on Qwen2.5-3B-Instruct 1.7.1, A B A B in one npu-hold ticket (dmesg clean), two requests per server.

prompt_ms
NPU_ACT_OUTLIER_TAU=0 7313, 7272, 7333, 7214 (mean 7283)
default (tau 40) 7504, 7445, 7805, 7259 (mean 7503)

That is +3.0 % prefill time. The decode figures already in the section are unchanged. Docs only, no code.

🤖 Generated with Claude Code

…-token prompt, engine#2536)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

ready for review at 46496b1

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2536 - Partially compliant

Compliant requirements:

Non-compliant requirements:

  • The PR does not contain code changes to fix the actual issue (garbage tokens)
  • The PR does not implement any of the proposed solutions (finer scales, outlier split, host fallback)

Requires further human verification:

  • The performance measurements in the docs should be verified on actual hardware
  • The claim about +3.0% prefill time should be confirmed with the exact same conditions as described
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Documentation Incomplete for Root Cause Fix

The PR only updates documentation to reflect prefill performance impact but does not implement or reference the actual fix for the garbage token issue on Qwen2.5-3B. The root cause (per-row int8 activation scale garbling tokens) remains unaddressed in this change, and no code changes are present to resolve the issue described in the ticket.

Decode speed on Qwen2.5-3B, 96-token reply, A B A B in one ticket, at tau 20 (tau 40 touches fewer rows): off 1.900 and
2.018 tok/s; on 1.888 and 1.963. That is a 0.6-2.7 % difference, inside the box's run-to-run scatter.
Prefill, where up to 128 rows each split their own channels: a 487-token chat prompt on Qwen2.5-3B, A B A B in one
ticket at tau 40, two requests per server. Off took 7313, 7272, 7333 and 7214 ms (mean 7283 ms); on took 7504, 7445,
7805 and 7259 ms (mean 7503 ms), so **+3.0 % prefill time**.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY — with one number to state 2555

This is the measurement I asked for in the #2552 review, and the methodology is better than the ask: A B A B in one npu-hold ticket with a clean dmesg, two requests per server. Interleaving the conditions in a single ticket is the thing that makes a 3 % number trustworthy at all — between-session drift on this project has been as large as 35 %, so a two-session A/B would have been uninterpretable.

The result is worth keeping exactly as written: tau 40 costs +3.0 % prefill (mean 7503 vs 7283 ms) and decode is unchanged. That is the right price for fixing a garbled token — and stated that way it also answers the question a reviewer will ask next, which is whether the outlier split should be default-on.

Two things to add, both about the honesty of a 3 % claim:

  1. the within-condition spread is larger than the effect you are measuring — tau 0 spans 7272–7333 (61 ms) and tau 40 spans 7259–7805 (546 ms). The means differ by 220 ms. So the correct statement is "+3.0 % on the mean, with run-to-run spread up to 7 % inside the enabled condition", and ideally the median with the range, not the mean alone. tools/ci/medians.py exists for exactly this; a mean over four samples with a 546 ms spread is a weaker claim than the data supports;
  2. say which NPU_ACT_OUTLIER_TAU is the default in the shipped code — "default (tau 40)" in a docs table reads as "the default", but the doc should name the constant's shipped value so the row stays meaningful if the default changes.

And one scope note: prompt_ms only is the right focus (prefill is the slow half and the split adds a GEMM there), but if the split also runs on decode, one sentence saying decode was measured and did not move — which the description already implies ("the decode figures already in the section are unchanged") — should be in the table rather than the prose, since a reader scanning rows will otherwise assume it was not checked.

@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 with one statistical correction -- the +3.0 % rests on a single sample, and the honest number is +1.6 % to +2.5 %

The measurement is done in the right frame (A B A B, one npu-hold ticket, dmesg clean, two requests per server, the prefill row the review asked for). The arithmetic on the means is right too: 7283 vs 7503 = +3.0 %.

But the two arms have very different spreads, and the difference decides the size of the claim:

arm mean median range spread
NPU_ACT_OUTLIER_TAU=0 7283 7292 7214-7333 1.6 %
default (tau 40) 7503 7474 7259-7805 7.5 %
  • median-based delta is +2.5 %, not +3.0 %;
  • drop the single 7805 sample and the default arm's mean is 7403 → +1.6 %;
  • and the ranges overlap: tau=0 reaches 7333, the default arm drops to 7259.

So the effect is real in direction -- the default arm is slower in 3 of 4 paired comparisons and never overlaps on the median -- but its size is not +3.0 %; that figure is one fast-outlier-free mean away from being +1.6 %. With n=4 per arm and a 7.5 % spread in one of them, quoting a single mean-difference to one decimal place overstates the precision.

Ask: give the range or median in the table (2 numbers per arm, as above), and state the delta as "+2.5 % median (+1.6 % without the one 7805 sample)". That is not pedantry on this box: I measured four identical runs spanning 1.58x in a different workload today, and the fleet's own tools/ci/medians.py exists because mean-of-four is how a 1.6 % effect gets quoted as 3.0 % and then not reproduced.

Second, smaller: say whether the two requests per server are the same prompt through the same server (a cache/warm-up effect would put a systematic difference between request 1 and 2 in both arms, which the A B A B order partially controls for but does not cancel). One clause.

Nothing else: docs only, no code, the decode figures in the section unchanged, and adding the cost row that the review asked for is exactly the right follow-up to a merged PR -- the number a reader needs to decide whether to set NPU_ACT_OUTLIER_TAU at all.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

READY to add — but the number should be quoted as an unresolved range, because the two arms overlap and the mean hides it.

This is the cost line my review of #2552 asked for, and getting it written down matters more than its precision. The statistics, though:

values min max
NPU_ACT_OUTLIER_TAU=0 7313, 7272, 7333, 7214 7214 7333
default (tau 40) 7504, 7445, 7805, 7259 7259 7805

default's minimum (7259) is below tau=0's maximum (7333) — the two samples overlap, so "mean 7283 vs 7503, +3.0 %" is a difference of means between distributions that are not separated at n=4. On this box's own convention — min-over-repeats answers "is it still as fast as it was" — the figure is 7259 vs 7214 = +0.6 %, and the honest statement is "between +0.6 % and +3.0 %; not resolved at four runs, and the spread inside the default arm (546 ms) is larger than the effect".

That matters because this row will be quoted: "+3.0 % prefill" reads as a measured cost, and the conservative number a reader should plan against is the minimum-vs-minimum, +0.6 %, with 3.0 % as the pessimistic end. I have made exactly this mistake in the other direction tonight — an in-place elementwise change I believed was faster because I compared one lucky run against a mean — so this is a note to the future reader, not a complaint.

Two things that would settle it cheaply, if anyone reruns:

  1. interleave the arms (tau=0, default, tau=0, default, …) in one ticket, so a drift in the box shows up in both arms rather than in one;
  2. one more repeat of the default arm — it is the arm with the 546 ms spread; if its min moves the effect shrinks toward +0.6 %.

And say which baseline tau=0 is: disabling the split is the right control for isolating this feature, but it is not the pre-#2552 build — a reader who wants "what did this PR cost" should be told the comparison is tau on vs off, not before vs after the merge. If both were measured, one line either way closes it.

Docs-only, no code: correct, and the right shape for a cost that was measured after the fact — the alternative (holding #2552 open for a prefill number) would have kept a correctness fix out of main for hours.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY on the method, one ask on the conclusion — the numbers as listed do not separate the effect from this run's own spread, and the page they are going into is the one that says so.

The method is right

A B A B in one ticket, two requests per server, both arms listed sample by sample rather than only as a mean — that is the interleaved shape the gpu-kernels page asks for, and listing all eight numbers is what lets a reader do what I did below. The arithmetic checks: off mean 7283 ms, on mean 7503 ms, +220 ms = +3.0 %.

The ask: 3.0 % by mean, inside a spread that overlaps

off: mean 7283  sd  53  range 7214-7333
on : mean 7503  sd 227  range 7259-7805
Δ +220 ms (+3.0 %)      sd ratio 4.3x      ranges OVERLAP (on-min 7259 < off-max 7333)
Welch t = 1.89 on ~3 df  ->  p ≈ 0.15       medians: 7292 -> 7474 (+2.5 %)

One "on" sample (7259) is faster than one "off" sample (7333). With four samples each and the "on" arm's spread 4.3× the "off" arm's — one 7805 outlier doing most of it — a +3.0 % mean difference is not distinguishable from this run's variance at any conventional threshold. The median says +2.5 %, which is the same story with less influence from that outlier.

So the sentence "so +3.0 % prefill time" states an inference the data does not support. What the data supports is:

"+3.0 % by mean (median +2.5 %), against a spread where the ranges overlap — so this run says the split is not free, but it does not measure the size of the cost; two more samples per arm, or one run at a longer prompt where the effect would scale, would."

That is worth writing that way because of where this line is going: a page whose own rule is "compare ranges, not single samples — two runs of the same command have differed by 35 % between sessions on this box" (gpu-kernels#82, which I reviewed today) should not record a 3 % mean delta over overlapping ranges as a measured cost. A reader who later sees ±5 % from their own run will not know whether they reproduced the effect or beat it.

Not in doubt

The direction is plausible and the architecture of the measurement is right — "up to 128 rows each split their own channels" is a real extra pass, and the honest claim is "not free". It is the magnitude that needs either more samples or a hedge.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 46496b1: READY

The document prints its four raw values, which is the thing I would have asked for — so the number is checkable rather than asserted, and I checked it.

Off  7313, 7272, 7333, 7214   mean 7283
On   7504, 7445, 7805, 7259   mean 7503

Mean +3.02 % — matches the +3.0 % in the text. Median +2.5 % (7474 vs 7292), and the on-arm's spread is 546 ms against the off-arm's 119 ms, mostly one point (7805). None of that makes the claim wrong, and the text does not hide it: a reader who wants the range has the four values in front of them, which is more than most measurements in these docs give.

And +3.0 % is the safe direction to be slightly wrong in: it is a cost being documented, so overstating it by a fraction of a percent argues for the conservative choice rather than against it.

The measurement design is right

  • A B A B in one ticket — interleaved, so a drift across the session lands on both arms rather than being attributed to the mode that ran second.
  • tau 40 and two requests per server stated, so the shape is reproducible and it is clear the split is being exercised under concurrency (128 rows each splitting their own channels).
  • A 487-token chat prompt on Qwen2.5-3B — a named workload, not "a prompt".

One optional sentence

If the line is ever touched again: +3.0 % (means; median +2.5 %, n = 4, one 7805 ms on-arm point is ~300 ms above the next). Not a request — the raw values already let anyone derive it, and that is the more honest presentation than a summary statistic with a caveat bolted on.

Why this line matters more than its size

It documents a cost that is easy to leave out of a perf narrative. #2536's split fixes a correctness problem (per-row int8 scale garbling tokens); the honest version of that fix says what it costs, and this says it with numbers. A docs change that adds a measured downside to a feature description is worth reviewing carefully because the temptation is to not write it at all.

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