Repository navigation
serve --help: --npu-streams' default back under it; --flash says a short system turn is not pinned (Refs #1785) - #2152
Conversation
…ort system turn is not pinned (Refs #1785) 880d646 put the prefix-cache lines between --npu-streams and its continuation, so '(default 1, the device exclusive)' read as --flash's default. docs/npu.md's --flash paragraph now says the pin obeys --prefix-min-gain (128) and how to pin a shorter system turn, as the #1785 thread concluded (a policy, not a change). Co-authored-by: bong-water-water-bong <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
ready for review at 2c6ea21 |
PR Reviewer Guide 🔍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 at 2c6ea21: READY
Reviewed head 2c6ea21 (refs #1785). Help text and docs only: app/serve.cpp +2/−1, docs/npu.md +5. This is the first verdict.
- The misplaced line is back where it belongs. In
usage(),(default 1, the device exclusive; docs/npu.md)now sits directly under[--npu-streams N]again, rather than under[--flash]. The--flashline gains "(a system turn shorter than --prefix-min-gain, 128 by default, is not pinned)". - The 128 is the real default.
app/npu_prefix_cache.h:61hasint min_gain = 128;, and the existing help line two above already says "Unset keeps the forward's defaults: 8 / 4096 / 128". - The documented command does what it says.
serveforwards--prefix-min-gaintoforward-servewhenever it was set (app/serve.cpp:3480), in the per-op route's argument list next to--prefix-pin, and not inside any--flash-only branch.forward-serveparses it intoprefix_opts.min_gain(app/forward_serve.cpp:1077). So--flash --prefix-min-gain 32reaches the cache. git merge-treeonto main: no conflicts. CIbuild,hrx_buildand CodeQL green.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 2c6ea21: READY
Putting --npu-streams' default back under the option in --help is the kind of fix only a reader of the help output would ask for, and it matters more than it looks: a flag whose default is not shown is a flag every operator guesses, and the guesses become benchmark variance that looks like noise. Same argument as naming the term that decided a refusal (#296/#300) — the interface should state the value it will use.
Refs #1785. This is a help text and docs change only, distinct from the speed work on #1785.
What changes
serve --help: the line(default 1, the device exclusive; docs/npu.md)is the second half of--npu-streams. Commit 880d646 inserted the prefix-cache lines between the two halves, so the help has been showing that default under--flash. It is now back under--npu-streams. The line under--flashnow says that a system turn shorter than--prefix-min-gain(128 by default) is not pinned.docs/npu.md, the--flashparagraph: says that the pin obeys--prefix-min-gainlike every other slot. A short system turn is therefore prefilled on every request, even under--flash. To pin one, pass the threshold together with the profile, for example--flash --prefix-min-gain 32for a 40-token turn. This matches the 11-11 03:04Z conclusion on npu: F5 — a single-turn flash serving mode (fixed 1k ctx, clean state per request, system prompt reused), measured against 0.49 s TTFT / 33 tok/s #1785: the threshold is the cache's tested policy (pin_at(q1, 127) == 0), so this is a configuration choice and not a code change.Checked
--prefix-min-gainreachesforward-servewhether--flashis set or not (app/serve.cpp:3480, after the--flashblock), so the documented command does what it says.serve.cppcompiles with-fsyntax-only, using the existing build's own compile command, rc 0.grep -rlovertests/).🤖 Generated with Claude Code