Repository navigation
npu: make the quantiser header's speed figure one that a re-run reproduces (follow-up to #908) - #919
Conversation
…duces #908's reviewer measured the same mix on this box and got 6.56x (1.539 ns/element scalar, 0.235 AVX2) where the comment claimed 7.2-7.4x (1.72-1.76, 0.238). The AVX2 side agrees; the scalar figure was ~12 % optimistic, so a later re-run would look like a regression. The comment now carries the range both runs measured, labelled as two independent measurements on the same box and mix. Comment-only change: no code, no behaviour, no re-gate.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at f389e8a7e — comment-only, and it now says what two independent runs measure. Mine is one of the two: in my #908 review I re-measured the shipping mix myself and got scalar 1.539 ns/element (3.56 ms/token) against AVX2 0.235 ns/element (0.54 ms/token), 6.56x, against the body's then-6.5x-to-7.4x spread. The new text (3.56-4.05 ms/token scalar (1.54-1.76 ns/element), 0.54-0.55 ms/token (0.235-0.238 ns/element), 6.6-7.4x) brackets both numbers exactly, so a re-run now lands inside the quoted range instead of contradicting it.
No code touched: the diff is five // lines in npu/forward/include/quant_i8.h. The 288-projection / 2,310,144-element/token arithmetic and the bit-identity argument are unchanged from the head I verified with 82,241 differential comparisons, and the quant_i8_row ctest still covers the identity independently of the comment.
There was a problem hiding this comment.
🟡 Changes recommended
The updated savings range still excludes the second measurement’s 3.02 ms/token improvement and should be corrected to approximately 3.0–3.5 ms/token.
1 open issue
What changed in this PR
This comment-only follow-up to #908 updates the NPU activation quantiser’s performance figures to reflect both independent measurements. Runtime behavior is unchanged.
Changes:
- Broadens the documented scalar and AVX2 timing ranges and speedup range.
- Records the measurement date and adjusts the headline to “6–7x cheaper.”
| File | Description |
|---|---|
npu/forward/include/quant_i8.h |
Updates benchmark figures and measurement context in the header comments. |
Review effort: Balanced
…points Copilot's review of #919: the comment said 6.6-7.4x is 'about 3.4-3.5 ms' saved, but the slower scalar run (3.56) minus the faster AVX2 run (0.54) is 3.02 ms, so the range excluded the second measurement. Now stated as the subtraction it is: 3.0-3.5 ms/token (3.56-0.54 to 4.05-0.55), i.e. 0.73-0.85 % of a ~415 ms token. Comment-only; no code, no behaviour, no re-gate.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 4085d71f5 (re-verdict; my tprs-ready label was at f389e8a7e).
Delta is comment-only, 2 lines in npu/forward/include/quant_i8.h, and the arithmetic is now right: the two runs give 3.56 - 0.54 = 3.02 and 4.05 - 0.55 = 3.50, so "a saving of 3.0-3.5 ms in a ~415 ms decode token" is what the quoted ranges actually support. The previous wording ("about 3.4-3.5 ms") took the top of the range as if it were the range.
The rest of the comment — the 6.6-7.4x ratio, the 0.235-0.238 ns/element AVX2 figure, best-of-7 twice — is unchanged from the head I reviewed, where I traced it to the run logs behind #908.
PR Reviewer Guide 🔍(Review updated until commit f6ce374)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit f6ce374 |

Follow-up to the one thing #908's review asked for, on a PR that had already merged.
Root cause. The header comment in
npu/forward/include/quant_i8.hquoted a single measurement(
3.96-4.05 ms/tokenscalar,1.72-1.76 ns/element,7.2-7.4x). The review measured the same mix on the samebox and got 6.56x (
1.539 ns/elementscalar ->3.56 ms/token;0.235AVX2 ->0.54 ms/token). The AVX2side matches to 1 %; the scalar figure was ~12 % optimistic, so the next person to re-measure finds a
"regression" that is only a stale number.
Fix. Comment-only: the figure is now the range both runs measured, labelled as two independent measurements
on this box and mix.
The
made 7x cheaperline at the top of the file becomesmade 6-7x cheaper, so the summary does not contradictthe detail.
No behaviour change, so no gate and no device run: nothing outside comments changed
(
git diff --stat= 1 file, +6/-5, every line a//).