mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5515] [Engine] serve: an in-place retune (TUNE) and per-shape conversation-cache routing #5486
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5486
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rwkeyes on GitHub (Nov 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5515
Summary
Two proposals that belong together, both about settings that can only change at start-up today:
--prompt-cache,--prompt-cache-every,--short-read,--spec-min-p,--pcie-frac,prefill_chunkand theadapt_*family are all read out of the engine's options atthe moment the engine uses them, but the only way to change one is to restart the engine — which on
a real config also means a model load (93–100 s on the box I measure on). Measuring one value costs
a start; measuring six costs six.
--prompt-cache 6), a single-shot request thatwill never reuse its context still pays the parking cost. On this box that is +10.1 % prefill on a
3.5 k code prompt and +4.0 % on 4.0 k prose with the cache off; short single-shot prompts went from
0.522 s to 0.239 s TTFT in an in-place A/B. A repeated context, on the other hand, goes from
5.3 s to 0.3 s, so the cache is right for chat/agent traffic and wrong for a batch of one-shot
prompts. The traffic shape is knowable per request from the message list.
Proposed shape (implemented, see the draft PR): a
TUNE k=v ...line on the serve pipe, answeredTUNED k=v ...with arefused:tail, handled between requests after the QUIT check and before therequest's busy scope;
POST /v1/tunein front of it; and--conv-route off|shadow|on(default off)that switches
prompt_cacheper traffic shape.shadowonly labels and logs, so a deployment canmeasure its own mix first.
Measurement (before/after, same engine, same config, one Arc Pro B70)
Qwen3.8-Flash-Next GSQ-RCO Coder IQ1_M, engine 0.1.58 SYCL build (
bmg-g31AOT), Chat Completions,streaming, temperature 0, one request at a time, unique prompts:
What I am asking for
Scope agreement for the shape above — one engine feature (a retune line) plus one opt-in server
policy — before it is reviewed as a PR. Two things are a maintainer's call, and I would rather ask
than guess:
tool. The same line would let
tools/calibrate.pysweep a value without a restart, which is thefeature the measurement cost is really blocking.
adapt_every/adapt_swaps/adapt_decay/adapt_min_gain,pcie_frac,spec_min_p,prompt_cache,prompt_cache_every,short_read, andprefill_chunkdownward only. Everything that sizes memoryor the session at load (
--spec,--kv*,--max-context,--expert-cache, the resident tiers,--pcie-mode, graph/native flags) is deliberately excluded.Draft PR with the implementation, the tests and the full validation: link in the first comment.
AI assistance was used for the implementation and the measurement runs; the numbers above are from
runs on the hardware named.
@rwkeyes commented on GitHub (Nov 7, 2026):
Draft PR with the implementation, tests and the full validation: https://github.com/Niko1221/Strata/pull/5516 — draft until the two scope questions in the report above are answered.
@rwkeyes commented on GitHub (Nov 7, 2026):
Related work I should flag before you spend review time on this: #4777 (@code-martin, open) adds
ROUTE_PRIOR <v>as an engine stdin command for exactly this motivation — changing a routing prior without a restart — plus an endpoint inserve/server.py. It touches the same two places this proposal does:src/program/generate.cpp(my dispatch sits after theQUITcheck and before the request's busy scope) andserve/server.py. Whichever of the two merges second needs a small rebase at the dispatch, not a redesign.TUNE key=value …here is a line any use-time setting can join. If that direction is acceptable,route_prioris a naturalTUNEkey and the #4777 endpoint becomesPOST /v1/tune {"settings": {"route_prior": …}}— one mechanism instead of two.I am happy to rebase on #4777 and fold
route_priorin as a key, or to keep out of its way if you would rather land the single-purpose command first. What I would not do is hide the overlap and let a reviewer find it.If a general retune line is not wanted at all, say so plainly and I will close #5516: the conversation-cache routing cannot switch
prompt_cachewithout one, so it would be dropped rather than shrunk into something smaller.