mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2738] [CLOSED] batch-mtp: split the solo MTP budget across batch slots — multi-GPU multi-stream tuning (agent concurrency) #4235
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#4235
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2738
Author: @superlee-terry
Created: 10/16/2026
Status: ❌ Closed
Base:
main← Head:feat/batch-mtp-pr📝 Commits (3)
55fff53batch-mtp: proposals per slot = ceil(spec/batch) — the solo MTP budget splits across slots (spec 3 + 2 slots = 2 drafts each; 3+ slots = 1); chain-verified keep, 1+D rows per slot per window, startup note on the extra draft K/Va3ca15fbatch-mtp: D = ceil(MTP budget / batch) — use --mtp-max-t/--spec as given, not the suffix-draft spec+2 bump (the bumped spec is the verifier's window, not the drafter's)b5ea610monitor: show every parallel request - the Model state card renders one row per batch slot (reading progress / decoding tokens+tok/s+elapsed / idle-held), plus solo-path, waiting-for-slot and queued counts; the single progress bar only ever showed the newest request (#465)📊 Changes
4 files changed (+73 additions, -12 deletions)
View changed files
📝
serve/web/app.css(+11 -0)📝
serve/web/app.js(+25 -0)📝
serve/web/index.html(+1 -0)📝
src/program/generate.cpp(+36 -12)📄 Description
What
Two commits on
--batch-mtpplus one Monitor-tab improvement, aimed at multi-GPU (layer split) + multi-stream serving:batch-mtp: proposals per slot = ceil(MTP budget / batch) — the solo MTP budget is split across the batch slots (spec 3 + 2 slots → 2 drafts each; 3+ slots → 1). Chain-verified keep,1 + Drows per slot per window, and a startup note about the extra draft K/V/graph memory.batch-mtp: D uses the MTP budget as given (--mtp-max-t, else--spec) — not the suffix-draftspec+2bump. The bumped spec is the verifier's window, not the drafter's budget; without this,--spec 3 --batch 2silently drafts 3 per slot.Why — the real-world scenario
This is a tuning pass for agent workloads: connecting a local Strata endpoint to agent frameworks (Hermes, Claude Code, etc.). A large task gets split into sub-agents that fire concurrent requests; with the stock configuration those requests queue serially, and once
--batchis on,--batch-mtpon a layer split is gated off (helper expert caches) and each slot drafts only 1 proposal per window — so MTP is effectively disabled exactly when concurrency arrives, and per-stream decode collapses (measured: 1 stream 74 tok/s → 2 streams ~21 tok/s each on the pipelined default).The commits make the MTP budget follow the concurrency: 1 stream keeps the full solo budget (solo path, untouched), 2 streams split it 2+2, 3 streams run 1 each inside the
kVerifyMaxT = 8window. This is the 2×RTX 3090 / ≤3 streams corner of the design space (the window cap makes D>1 at 3 streams impossible: 3 slots × 3 rows = 9 > 8, and raising the cap touchesGMAXin the grouped-MoE kernels).Measured on 2× RTX 3090, layer split auto, IQ3_S,
--batch 3 --batch-mtp --batch-groups 1 --spec 3 --vram-reserve-mib 1024Natural-stop long-form requests (~1500-token answers,
finish=stop, notlength-truncated):Official
tools/strata_bench.py --clients 3on the production instance: 82.7 tok/s aggregate, 0 errors, TTFT p50 1.06 s / p95 1.74 s. MTP acceptance rose 59.8% → 67.2% (spec 4 → 3). Single-stream costs are within noise (agent decode 109.5 → 107.0); 4K prefill −9% is the 3 slot sessions' 1.37 GiB expert-cache tax, which is the documented--batchcost.D=2 at 2 streams was measured four independent times: net zero (acceptance decay cancels the extra draft cost) — the split formula keeps D=2 available where it helps (single-GPU builds, higher acceptance) and clamps to 1 at 3+ streams where the window demands it.
Notes
--batch-mtp; the solo path is untouched.D ≤ 8//batch − 1) is deliberate: 3 streams × D=2 overflowskVerifyMaxTand measured −19% (window rotation starves the third slot)./metricslive.slots(slots_view()); pure frontend, no engine ABI change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.