Repository navigation
serve: --flash, the single-turn NPU profile; --ctx-size reaches the forward route; an over-context request is a 400 (Refs #1785) - #2029
Conversation
…orward route; an over-context request is a 400 (Refs #1785, F5) --flash = --ctx-size 1024 + --prefix-pin, refusing what contradicts it. serve dropped --ctx-size at the hand-off to forward-serve on a model-generic container; it is carried now and forward-serve lowers its limit to it. A request that does not fit was a 500; it is a 400 with type exceed_context_size_error. Measured on the NPU. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…del or device (Refs #1785) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
ready for review at 171cf6a |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 171cf6a: READY
Checked at 171cf6a.
tests/serve_flash_test.shagainstonebitbuilt at this head: all 8 arms ok. That's five refusals by name (another ctx size before or after--flash,--prefix-slots 0, another device, no device), two acceptances, and "without --flash none of the rules apply". The acceptance arms pointserveat a missing model undertimeout 20, so they stop after argument parsing and no server is started. Nothing was left running.app/forward_serve.cppcompiles at this head. It's NPU-private, so I did a single-file compile with an existing NPU build's command, pointed at this tree.
Read for correctness:
- The 400. The existing
room < 1guard now throwsContextOverflow, caught as a 400 withexceed_context_size_error,n_prompt_tokensandn_ctxbefore any prefill. Other errors keep their old path. --ctx-sizeonly lowers the limit.e.max_context = min(model, ctx_size), with a note when asked for more, and a negative value is refused.servenow passes it to the forward route, the dropped-argument bug you corrected on #1982.--flashdoesn't quietly override. It sets 1024 +--prefix-pinonly after refusing every contradiction by name.
The device table was taken at 7a2b67e before the rebase. You state that, plus forward_serve.cpp being byte-identical since, and that's enough for a flag-and-guard change. The bar row on qwen3.5-flash:2b stays open on #1785, as you say.
VERDICT at
|
|
VERDICT: READY
if (o.ctx_size != 0 && o.ctx_size != 1024) throw … "drop --ctx-size N"
if (o.prefix_slots == 0) throw … "drop --prefix-slots 0"
if (o.device != "npu") throw … "--flash is a profile of --device npu"So a contradictory invocation refuses instead of one flag quietly winning, and each refusal names the flag to drop. That is the same discipline as #1991 Three things that make it reviewable:
One thing I would add to |
Refs #1785 (F5, single-turn flash mode). Third slice after #1941 (the pinned slot, table half) and #1982 (
--prefix-pinon the device path). The issue stays open for the bar row, see "What remains".What changes
1bit serve --flash: one word for the single-turn NPU profile,--ctx-size 1024plus--prefix-pin. It refuses what contradicts it by name instead of letting one side quietly win: another--ctx-size,--prefix-slots 0, a device other thannpu.--ctx-sizereaches the forward route.serve --ctx-size Non a model-generic container was accepted and then dropped:servebuilt the forward's arguments without it andforward-serveparsed none, so the model's own limit applied. This is the correction I posted on forward-serve: --prefix-pin, the pinned shared prefix on the device path, measured (Refs #1785) #1982; the docs sentence is fixed here.forward-serveanswersexceed_context_size_errorwithn_prompt_tokensandn_ctx, before any prefill.docs/npu.md: the flash section and the corrected context sentence.Proof
Refusals, no model and no device (new
tests/serve_flash_test.sh, ctest rowserve_flash_refusals, at this head):On main the five refusal arms fail, because
--flashis an unknown option there.On the NPU (
npu-hold -l cl-flm-1785 -t 10, packbonsai2-t2s2-perrole876,1bit serve --device npu --flash, one 341-token system prompt, three different questions, 8 answer tokens each). The server's own start lines:exceed_context_size_errorin 0.02 sThat device run was made at
7a2b67e, the same change stacked on #1982 before it merged.app/forward_serve.cppis byte-identical between7a2b67eand this head;app/serve.cppdiffers only by what main gained meanwhile. I did not repeat the device run after the rebase.tools/copyright.py --checkrc 0;tests_referenced_check.py: all 79 test scripts referenced;npu_sampling: ok.What remains on #1785
qwen3.5-flash:2b: needs that model's pack and kernels on the box, which are not there. The numbers above are on a different model and say nothing about that bar.🤖 Generated with Claude Code