mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4821] [TUI] strata tune auto measures only the solo path: judge and tune settings under the --parallel load (opt-in) #2214
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#2214
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 @gdevenyi on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4821
Area
[TUI] (the Terminal:
strata tune auto, andstrata launch --tune)What do you want to do?
I want to serve several users with
--parallel Nand have the tuner pick the settings that are fastest for N requests at once.Today the tuner starts the server with the N slots, but it sends one request at a time. Each request stays on the solo path, so batch windows never run. A setting can be much better or worse with slots busy, and the tuner cannot see it.
The repo's own numbers show the gap (
docs/BATCHING.md, 2x RTX A6000 48 GB, IQ3_S,--batch 4, total tok/s; not my measurements):STRATA_PIPED_MTP=1with--batch-mtpA solo measurement shows no gain for either change, and the tuner needs at least +3% to accept one.
The best setting also depends on the machine, so it cannot be one fixed default. #3849 reports that
--batchlost expert-cache hits on 2x RTX 3060 12 GB (99% -> 86%), anddocs/BATCHING.mdmeasures a lone request 22% slower with 4 slots on one RTX 5070.What do you do today instead?
Tune for solo speed, then compare the batch settings by hand: restart with
--setflags, runstrata bench run --suite parallel-mixed-v1 --concurrency Nortools/serve_load.py, and usestrata bench compare. Noise control and stacking winners are left to the user.What I found in the code
Reproduction status: unconfirmed static analysis. I read the code at
c62d5e3a(0.2.9). I ran no tuner or engine for this report.WorkerEngine.measurecallsdecode_onceandprompt_oncein sequence (strata_control/tune_session.py:378-409).metric()usesdecode_tok_s, combined with prompt speed for coding (strata_control/autotune.py:139-154). It has no total throughput or first-token measure under load.ARMShas no--batch-groups,--batch-mtp,STRATA_PIPED_MTP, parallel stack switch orSTRATA_BATCH_DECODE_SHARE(strata_control/tune_knobs.py:80-121).slot_keyhashes model, context, KV format, pictures and goal (strata_control/presets.py:128-131). A result tuned atparallel1 looks reusable atparallel8 without--retune._FACTSdoes not readINFO batch_slots=N(strata_control/tune_session.py:97-106), so a candidate that ends up with fewer slots is not noticed.STRATA_BATCH_SELF_COMMIT=1(serve/server.py:3670-3679). The engine then turnsSTRATA_PIPED_MTPoff (src/program/generate.cpp:6228-6229). The server comment reports +16% for the stack at 8 requests on two A6000, anddocs/BATCHING.md:513namesSTRATA_PIPED_MTP=1the best drafts setting. I found no published run comparing them.kv_resident_64karm is judged alone, butdocs/BATCHING.md:692says a slot with KV streaming keeps per-row launches instead ofSTRATA_BATCH_ATTN_ROWS. Whether this matters in practice is unmeasured.Suggested implementation
Opt-in, with the current code path unchanged when it is not asked for. For example
strata tune auto TARGET --concurrency N, with a matching option onstrata launch. It keeps the existing seams: interleaved rounds, A/A noise, memory guards and cancel stay as they are.Measure under load. Add
clientstoRequestSet(default 1, today's behaviour). With more than 1,measureadds a phase of N streamed requests at once and fills newRunResultfields such asbatch_tok_sandttft_p95_s. Use thetools/serve_load.pyshape, with a unique nonce per prompt.parallel-mixed-v1is less suited: its N requests repeat two fixed prompts and stop at 32 or 96 tokens (strata_cli/bench.py:45-46,:599-601).Record the slots. Add
batch_slotsto_FACTS. Use it as the default forclients, and reject a candidate that runs fewer slots than the base.Judge on the load. Add a
metric()use based onbatch_tok_s, with the sameaccept_thresholdand win rule. Add guards for p95 first-token time and for solo decode, so a batch gain cannot hide a solo loss. The limits need agreeing and measuring.Add batch arms, used only in this mode:
--batch-groups 1against auto on a layer split--batch-mtp+STRATA_PIPED_MTP=1+STRATA_BATCH_SELF_COMMIT=0STRATA_BATCH_DECODE_SHARE, for a mix with long promptsEach needs an answer class. The stack's comment and
tools/batch_test.pyruns may already supportexactfor some of them.Store it. Save the concurrency and load numbers in the preset. Add the slot count to
slot_keyonly for these results, so existing presets keep their hash, and have the re-check repeat the same load.Out of scope for a first version: searching the slot count itself (
--parallel auto), and any change to a default.Limits and open questions
strata tune auto, or should the Terminal only report a load check after tuning?Related
I searched open and closed issues and pull requests and found no request for concurrency-aware tuning.
--batch-mtpfor several streams (closed)Written with AI assistance (Claude Code). I checked the code references above against the commit named. Nothing here has been built or run.
@Barmallini commented on GitHub (Oct 31, 2026):
Supportive data point from the #4687 rig (6x Tesla V100-SXM2-16GB, sm_70, split 9/9/9/8/8/5, Qwen3.8 IQ3_S,
--parallel 4 --batch 4, KV int8 resident 262K, engine 0.1.55 built from source).Your central premise — that a switch's real cost only shows up under concurrent load — we confirmed by accident yesterday, with clean A/B runs of the same 4x ~25,955-token prompt test through the OpenAI API (wall time per slot, no other load on the box):
STRATA_PREFILL_LAYER_MAJOR=0STRATA_BATCH_GROUPS_NV_SERIAL=1STRATA_DEFAULTS=026reused_kv_bytes) catches only about 1 in 5 parks (details in #4450). A tuner judged onbatch_tok_sfrom fixed short prompts would not see any of this. If the first version can afford one more load shape, "two long conversations alternating turns" (growing contexts, park/restore between turns) would rank candidates much closer to how they behave for us.STRATA_PREFILL_LAYER_MAJORon/off dominates everything else on our 6-card sm_70 split, and it is exactly the kind of setting the solo tuner cannot rank (see #4687).Noise note: on this box, back-to-back clean runs of the same configuration land within ~1 s (~1%), so a +3% accept threshold has usable headroom even without a long A/A phase — but that is one machine, one test shape.