Repository navigation
docs/npu.md: the draft loop, and the measured answer on whether to serve it - #1150
Conversation
…ve it The brief's deliverable includes the serve recipe for the MTP draft route, and until now that answer lived only outside the tree. It belongs next to the head-import section, because the two questions are the same one asked twice: what the head is, and what running it buys. Every number here is measured on the 27B with the pb16i-exact head at k=4, and each is stated with the setting it was measured under: * live acceptance equals the offline protocol at every depth over 8 prompts x 64 (+0.00 / +0.55 / +0.09 / +1.08 pp), text byte-identical, 0 stream mismatches -- and the cursor/stream rule that makes it so (engine#820) is written down, because breaking it is silent; * the chain is prompt-dependent (1.80-4.33 tokens/pass, mean 3.14), the draft route is faster only above a break-even of 3.2-4.1 measured two independent ways, so the answer is: do not enable it; * OMP_WAIT_POLICY=passive is free and worth 1.2-2.4x on every batched pass; tau redistributes cost rather than moving it (0.598-0.623 s/token across arms differing 2x in chain, 4x in head calls); * the fold is refuted by measurement (chain 2.82 -> 1.07, depth-1 82 % -> 6.9 %), and the hidden-lag shortcut is a silently broken loop (0/92 accepted, mismatch counter 0); * the two ways these numbers have been misread here (cross-window arms; acceptance length vs tokens per pass) are stated next to them. Docs only.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
The page is accurate about the code it describes, and the numbers are the lane's own record transcribed without drift.
Checked in the tree at this head:
- The file table matches
npu/mtp/:draft.h,forward_base.h,mtp_head.{h,cpp}, andtools/mtp_acceptance.cpp. - Every flag the text promises exists and is parsed:
--offline(:286),--match(:290),--batchcheck(:288),--live/--positions-in/--positions-outin the same block. - The run-report strings it tells a reader to trust are real output:
:602prints... stream %d rows, %d mismatch, and:679printsmatch p%d: %zu offline chains at this loop's own positions. DraftStreamis the checked object the paragraph credits (npu/mtp/draft.h:82), and the engine#820 it cites is merged (2026-11-02), titled "the live MTP loop fed the drafter a truncated stream".- The two negative claims hold:
app/forward_serve.cpphas no draft route (onestep()per emitted token,:442), and1bit serve --mtpis a different path (app/serve.cpp:2848).
Numbers: every figure in the page is identical to the lane's recorded per-depth table (75.14 / 63.24 / 73.26 / 84.13 %, hit counts 86/136, 84/134, 60/82, 49/59, +0.00/+0.55/+0.09/+1.08 pp), to chain 1.80-4.33 mean 3.14, break-even 3.2-4.1 (wall/passes 3.87; the 4.12 / 3.20 split), OMP_WAIT_POLICY=passive 1.2-2.4x, fold 2.82 -> 1.07 and 82 % -> 6.9 %, the 0/92 lagged-hidden run, and k = 6 buying +0.05. I did not re-run them: the runs need the NPU device, the owner's Bonsai serve holds that lock, and no artifact survives on this box for me to score independently. So this is a transcription and structure check, not a re-measurement.
One nit, and it is in the paragraph that warns about the confusion rather than practising it: "The tool prints both, named" is not quite true. --offline does print expected tokens per pass (chain) %.2f = 1 + sum_j c_hit[j]/c_tot[0] (:252), but the --live summary prints acceptance length under the label acceptance length %.2f tokens/pass (:888) and alongside it passes/token, which is the reciprocal. A reader who goes to the tool after reading this paragraph will find the two quantities it is told to keep apart printed with the same name. Either the label wants to be tokens/iter, or the sentence wants to say which subcommand names which.
PR Reviewer Guide 🔍(Review updated until commit f721ffc)Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
Re-verdicted at 466c95c3. The delta since ddbb82d2 is Merge remote-tracking branch 'ssh-origin/main' plus the one paragraph the merged #1130 needs: container.tile_order, documented where the plan's other three decisions are. It is accurate against the code that landed:
npu/plan/plan.h:138std::string tile_order = "engine-1";,:187p.tile_order = c.value("tile_order", "engine-1")- so "Absent meansengine-1, so every container written before the field existed keeps loading" is exactly right, and it is the reason #1130 needed no format bump.:188-190refuses anything else by name:"plan: " + path + " container.tile_order \"" + …- which is what "an id this decoder does not implement is a refusal naming it" says, and it is now in the page's own list of names the forward refuses (docs/npu.md:75).
The framing is the useful part and it is honest about why the field exists: the tile order "cannot be probed at all" from the plan side, every structural check passes on a wrong order (same names, dtypes, byte counts, chunk kinds), the container loads and the model "answers badly" - the same class as #1109/#1110. That is the sentence a future reader needs before they wonder why a static field is trusted.
Everything from my ddbb82d2 review is unchanged and still holds: the tool/flag/string claims against tools/mtp_acceptance.cpp (--offline :286, --batchcheck :288, --match :290, stream %d rows, %d mismatch :602), DraftStream at npu/mtp/draft.h:82, forward-serve running one step() per token (app/forward_serve.cpp:442), and the per-depth numbers identical to the lane's recorded window. One nit from that review still stands and is now the only one on this PR: mtp_acceptance.cpp:888 prints acceptance length under the label tokens/pass, while the paragraph tells a reader to trust that the tool "prints both, named".
|
Persistent review updated to latest commit f41e1ad |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at f41e1ad3 — the push is a main merge, and this PR's one file is byte-identical to the head I reviewed.
- Own diff is still
docs/npu.md, +61/-0.git diff 466c95c3 f41e1ad3touches six files and notdocs/npu.md, so every line I checked (the draft loop, the "what is measured and what is not" answer, theapp/forward_serve.cpp:442one-step getter and thenpu/mtp/forward_base.hrow) is unchanged. - The merge brought in
#1143's comment rewrite ofnpu/mtp/forward_base.h. Re-read the consequence: this page describes that file only as a table row ("BaseModelover the realQ4nxNpuForward, with the deferred GDN commit"), which the rewrite leaves accurate — and the page's prefix-cache paragraph already states the same consequence#1143pinned (restoring a prefix applies the last token's GDN update twice). - CI at this head:
buildSUCCESS,CodeQL+ fiveAnalyzelegs SUCCESS,hw_gateSKIPPED,pr_agentfail (expected).
BEHIND is main moving under it, not a conflict.
|
Persistent review updated to latest commit f721ffc |
What
One new subsection in
docs/npu.md(61 lines, docs only): "The draft loop, and whether to serve it", placed underAdd-on routes directly after The MTP head (FastFlowLM's container -> ours) — the two are the same question asked
twice, and the head-import section already ends with "the mode-1 or Q4_K forms are the ones to run" without saying what
running them buys.
The MTP brief's fourth deliverable is the serve recipe for the draft route. That answer existed only in this lane's
working directory, which is not a place a recipe can live: it is owner-facing, it decides a serve default, and it is
the one artefact that must survive the lane.
What it says, each number with the setting it was measured under
npu/mtp/draft.hpolicy,mtp_head.*drafter,forward_base.hadapter with thedeferred GDN commit,
tools/mtp_acceptancemeasurements) and what--offline/--live/--live --match/--batchcheckeach measure.--matchis called out because it is what makes the two per-depth tables onemeasurement sampled two ways instead of two computations that quietly differ.
current chain is silent (drafts get worse, text stays right), and it cost 69 % → 14 % first-draft acceptance until
the cursor became a checked object (engine#820). The run's
stream N rows/N mismatchlines are stated as thecheck.
+0.09 / +1.08 pp (75.14 / 63.24 / 73.26 / 84.13 %), greedy text byte-identical, 0 stream mismatches — and the chain
is prompt-dependent, 1.80-4.33 tokens/pass, mean 3.14.
pass count = 3.87; the 8-prompt split — faster on exactly the three above 4.12 at 0.73-0.77×, slower on all five
below 3.20 at 1.08-1.74×, median 1.14×).
1bit forward-servehas no draft route at all today (onestep()pertoken), and
1bit serve --mtpis the HRX/llama path, a different thing — so nobody re-derives that.OMP_WAIT_POLICY=passive, free, 1.2-2.4× on every batched pass; andtauredistributes cost rather than moving it (0.598-0.623 s/token across arms differing 2× in chain and 4× inhead calls), while
tau = 0.6leaves depths 3-4 with no offers — hencetau = 0for any per-depth measurement.6.9 %), and lagging the hidden without lagging the cursor (0/92 accepted with the mismatch counter at 0 — a
silently broken loop, not a slow one).
above 3.9 (
k = 6bought +0.05; depth 6 measured 0 %).is host-bound, so load inflates it and flatters the route) and acceptance length vs tokens per pass.
Docs only — no code, no test, no device;
tools/copyright.py --checkclean. Nothing here is a projection: everyfigure is from a measured window of 2026-11-05, and the gates that would reopen the answer are named with the lane
that owns them.