[GH-ISSUE #3794] [Engine] Feature request: MTP drafts in the pipelined batch-slot path (layer split, experts 100% resident, 3-GPU sm_70) #1599

Open
opened 2026-11-04 01:52:31 +07:00 by bsakaguchi · 11 comments
Owner

Originally created by @llollaalloll on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3794

Area

[Engine] (speed, kernels, models, the server and API)

What do you want to do?

Feature request: MTP drafts in the pipelined batch-slot path (--batch-groups), on layer split, for a rig where every expert is already resident in VRAM.

The idea (continuing #2235 and #2973, both closed in the 0.2.0-beta tracker reset — closed, not rejected) is to give the pipelined groups per-slot MTP drafts, so a multi-GPU layer split can pipeline and draft at the same time. PR #2985 (STRATA_PIPED_MTP, opt-in) was the same idea but was closed unmerged — is this still on your roadmap, and is that branch's approach still the shape you'd want?

Why this matters on our rig — every expert is resident (100%), so the current batch-MTP calculus does not apply:

Upstream's own measurement (commit 3ff62ec1) is that batch MTP pays only when the experts do not fit (it measured -21.9% with all experts in VRAM on 2x R9700). We measure the same wall on our box, and our box cannot buy the upside: the experts always fit (we keep the quant small enough), so serial --batch-mtp --batch-groups 1 is a pure loss, and the pipelined default has no drafts. Result: on batch slots we permanently give up MTP, and single requests slow down when the slots are shared (measured: solo 5.9 s -> 9.5 s with 2 concurrent).

Rig (3 cards, mixed Volta/Turing, sm_70 layer split, experts 100% resident):

Strata v0.1.41 (prod, build from source for sm_70;75)
Model Qwen3.8-Flash-Next IQ3_XXS (GSQ-RCO)
GPUs 2x Tesla V100-PCIE-32GB (sm_70) + 1x RTX 2080 Ti 22GB (sm_75), "gpu": [2,0,1], "layer_split": "20,28"
Batch "parallel": 6 (--batch 6, 3 pipelined groups of 2 slots)
Spec --spec 4 --spec-min-p 0.5
KV --kv int8 --kv-resident 32768, ctx 262,144
CPU experts --pool-workers 18
RAM 251 GB (experts fully in RAM arena + hot cache in VRAM)
CPU 2x Xeon E5-2673 v3, 2 NUMA nodes
Uptime serving 24/7 as a single-box agent + multi-bot backend (this one engine is the orchestrator and every production bot)

Measured on this box (A-B-A, same binary, only flags/env changed per arm):

  • Serial batch MTP (STRATA_BATCH_MTP=1, --batch-groups 1): -26% vs pipelined default -> rolled back; runs pipelined-only since.
  • Pipelined default (current prod): batch slots decode with 0 drafts offered; solo path keeps MTP (draft accept ~78% on tool-call JSON).
  • Sharing slowdown: single request 5.9 s -> 9.5 s wall when 2 requests share the slots.
  • STRATA_BATCH_MTP=0 / STRATA_BATCH_MTP_SERIAL=0 verified in the live process env (running config above).

What do you do today instead?

We stay on the pipelined default and give up drafts on batch slots (owner policy: no serial batch MTP, no patching upstream source ourselves), and we watch upstream releases for pipelined MTP. We would test any opt-in build on this rig (it is not idle hardware — 24/7 production) and report numbers back.

Not tested: no same-day comparison against 0.2.x on this box (prod stays on 0.1.41 per our upgrade gate); AMD/HIP; --pipeline-windows; STRATA_SPEC_LANES (havok2-htwo's fork numbers in #2235 are on 0.1.44.1 + their own patches, not upstream code).

Originally created by @llollaalloll on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3794 ### Area [Engine] (speed, kernels, models, the server and API) ### What do you want to do? **Feature request: MTP drafts in the pipelined batch-slot path (`--batch-groups`), on layer split, for a rig where every expert is already resident in VRAM.** The idea (continuing #2235 and #2973, both closed in the 0.2.0-beta tracker reset — closed, not rejected) is to give the pipelined groups per-slot MTP drafts, so a multi-GPU layer split can pipeline *and* draft at the same time. PR #2985 (`STRATA_PIPED_MTP`, opt-in) was the same idea but was closed unmerged — is this still on your roadmap, and is that branch's approach still the shape you'd want? **Why this matters on our rig — every expert is resident (100%), so the current batch-MTP calculus does not apply:** Upstream's own measurement (commit `3ff62ec1`) is that batch MTP pays only when the experts do not fit (it measured **-21.9%** with all experts in VRAM on 2x R9700). We measure the same wall on our box, and our box cannot buy the upside: the experts *always* fit (we keep the quant small enough), so serial `--batch-mtp --batch-groups 1` is a pure loss, and the pipelined default has no drafts. Result: on batch slots we permanently give up MTP, and single requests slow down when the slots are shared (measured: solo 5.9 s -> 9.5 s with 2 concurrent). **Rig (3 cards, mixed Volta/Turing, sm_70 layer split, experts 100% resident):** | | | |---|---| | Strata | v0.1.41 (prod, build from source for sm_70;75) | | Model | Qwen3.8-Flash-Next IQ3_XXS (GSQ-RCO) | | GPUs | 2x Tesla V100-PCIE-32GB (sm_70) + 1x RTX 2080 Ti 22GB (sm_75), `"gpu": [2,0,1]`, `"layer_split": "20,28"` | | Batch | `"parallel": 6` (`--batch 6`, 3 pipelined groups of 2 slots) | | Spec | `--spec 4 --spec-min-p 0.5` | | KV | `--kv int8 --kv-resident 32768`, ctx 262,144 | | CPU experts | `--pool-workers 18` | | RAM | 251 GB (experts fully in RAM arena + hot cache in VRAM) | | CPU | 2x Xeon E5-2673 v3, 2 NUMA nodes | | Uptime | serving 24/7 as a single-box agent + multi-bot backend (this one engine is the orchestrator and every production bot) | **Measured on this box (A-B-A, same binary, only flags/env changed per arm):** - Serial batch MTP (`STRATA_BATCH_MTP=1`, `--batch-groups 1`): **-26%** vs pipelined default -> rolled back; runs pipelined-only since. - Pipelined default (current prod): batch slots decode with **0 drafts offered**; solo path keeps MTP (draft accept ~78% on tool-call JSON). - Sharing slowdown: single request 5.9 s -> 9.5 s wall when 2 requests share the slots. - `STRATA_BATCH_MTP=0` / `STRATA_BATCH_MTP_SERIAL=0` verified in the live process env (running config above). ### What do you do today instead? We stay on the pipelined default and give up drafts on batch slots (owner policy: no serial batch MTP, no patching upstream source ourselves), and we watch upstream releases for pipelined MTP. We would test any opt-in build on this rig (it is not idle hardware — 24/7 production) and report numbers back. **Not tested:** no same-day comparison against 0.2.x on this box (prod stays on 0.1.41 per our upgrade gate); AMD/HIP; `--pipeline-windows`; `STRATA_SPEC_LANES` (havok2-htwo's fork numbers in #2235 are on 0.1.44.1 + their own patches, not upstream code).
Author
Owner

@llollaalloll commented on GitHub (Oct 25, 2026):

We tested PR #2985 (STRATA_PIPED_MTP) on the rig behind this request and can confirm the pipelined groups do draft, and it is a real win for the cases that matter to us — first measured numbers on Volta, offered as a data point for whatever you decide on #3794.

Rig: 2× Tesla V100-PCIE-32GB (sm_70) + 1× RTX 2080Ti (sm_75), layer split 20,28, experts 24,576/24,576 (100% resident), --kv int8 --kv-resident 32768, ctx 262,144, engine v0.1.41 + the PR's branch cherry-picked clean (no conflicts on 0.1.41).

Setup: --batch 3 --batch-groups 3 (one slot per group, 3 stages) + STRATA_PIPED_MTP=1 STRATA_BATCH_MTP=1, vs prod baseline --batch 6 --batch-groups 3 (no drafts in pipelined slots). Same harness as our earlier #2985 comment: 10 single-stream cases (temp 0), dual-stream and 4-stream aggregate, engine-side drafts_accepted/offered read from /metrics after each case.

Evidence drafts really run in the pipelined groups (baseline in this shape is always 0/0):

  • drafts_accepted/offered 596/777 (76.7%), 286/415, 10/12 across bench cases.

Results (tok/s, decode):

case baseline 6/3 PIPED_MTP 3/3 Δ
warm500 74.7 77.4 +3.6%
warm1000 77.6 88.3 +13.8%
peak2000a 83.9 83.5 −0.5%
peak2000b 103.4 105.2 +1.7%
reasoning 98.8 104.8 +6.1%
tool-call 40.8 54.5 +33.6%
thai 62.3 66.9 +7.4%
longinput / prompt-cache JSON ~equal ~equal ±0
cold100 49.4 49.2 ±0
2-stream aggregate 99.5 123.8 +24.4%
4-stream aggregate 105.4 98.1 −6.9%

Output identity: identical sha for the deterministic cases; the longer reasoning cases diverge (different decode path with drafts) but answer correctly — tool-call JSON arguments come out exact, Thai prose intact.

The honest cost: with the PR's one-slot-per-group constraint we had to drop 6 slots to 3, so a 4-request burst loses ~7% aggregate. On our own traffic profile (1-2 concurrent agent sessions, tool-call heavy) the trade is clearly worth it — tool-call +34% and dual-stream +24% are exactly our workload, and we have switched our production box to this build today.

Two notes for whoever picks this up:

  1. The cherry-pick onto v0.2.2 (engine 0.1.47) is not clean — beyond the 6 textual conflicts, generate.cpp moved the pump lambda and the Prefill API, so a real port is needed. We stayed on 0.1.41 to isolate the feature.
  2. If the one-slot-per-group rule could relax (e.g. 2 slots per group with paired draft rows, or drafts only on the first slot of each group), the burst regression would likely disappear and the win would extend to higher concurrency.

Happy to run any variant you want to try on sm_70 and send back per-case JSON, same as we did in #73 and #2985.

<!-- gh-comment-id:6395175478 --> @llollaalloll commented on GitHub (Oct 25, 2026): We tested PR #2985 (STRATA_PIPED_MTP) on the rig behind this request and can confirm **the pipelined groups do draft, and it is a real win for the cases that matter to us** — first measured numbers on Volta, offered as a data point for whatever you decide on #3794. **Rig:** 2× Tesla V100-PCIE-32GB (sm_70) + 1× RTX 2080Ti (sm_75), layer split `20,28`, experts 24,576/24,576 (100% resident), `--kv int8 --kv-resident 32768`, ctx 262,144, engine v0.1.41 + the PR's branch cherry-picked clean (no conflicts on 0.1.41). **Setup:** `--batch 3 --batch-groups 3` (one slot per group, 3 stages) + `STRATA_PIPED_MTP=1 STRATA_BATCH_MTP=1`, vs prod baseline `--batch 6 --batch-groups 3` (no drafts in pipelined slots). Same harness as our earlier #2985 comment: 10 single-stream cases (temp 0), dual-stream and 4-stream aggregate, engine-side `drafts_accepted/offered` read from `/metrics` after each case. **Evidence drafts really run in the pipelined groups** (baseline in this shape is always 0/0): - `drafts_accepted/offered 596/777` (76.7%), `286/415`, `10/12` across bench cases. **Results (tok/s, decode):** | case | baseline 6/3 | PIPED_MTP 3/3 | Δ | |---|---|---|---| | warm500 | 74.7 | 77.4 | +3.6% | | warm1000 | 77.6 | 88.3 | +13.8% | | peak2000a | 83.9 | 83.5 | −0.5% | | peak2000b | 103.4 | 105.2 | +1.7% | | reasoning | 98.8 | 104.8 | +6.1% | | **tool-call** | 40.8 | 54.5 | **+33.6%** | | thai | 62.3 | 66.9 | +7.4% | | longinput / prompt-cache JSON | ~equal | ~equal | ±0 | | cold100 | 49.4 | 49.2 | ±0 | | **2-stream aggregate** | 99.5 | 123.8 | **+24.4%** | | 4-stream aggregate | 105.4 | 98.1 | −6.9% | Output identity: identical sha for the deterministic cases; the longer reasoning cases diverge (different decode path with drafts) but answer correctly — tool-call JSON arguments come out exact, Thai prose intact. **The honest cost:** with the PR's one-slot-per-group constraint we had to drop 6 slots to 3, so a 4-request burst loses ~7% aggregate. On our own traffic profile (1-2 concurrent agent sessions, tool-call heavy) the trade is clearly worth it — tool-call +34% and dual-stream +24% are exactly our workload, and we have switched our production box to this build today. Two notes for whoever picks this up: 1. The cherry-pick onto v0.2.2 (engine 0.1.47) is **not** clean — beyond the 6 textual conflicts, `generate.cpp` moved the `pump` lambda and the `Prefill` API, so a real port is needed. We stayed on 0.1.41 to isolate the feature. 2. If the one-slot-per-group rule could relax (e.g. 2 slots per group with paired draft rows, or drafts only on the first slot of each group), the burst regression would likely disappear and the win would extend to higher concurrency. Happy to run any variant you want to try on sm_70 and send back per-case JSON, same as we did in #73 and #2985.
Author
Owner

@wannagoxuf commented on GitHub (Oct 25, 2026):

We ported PR #2985 to a 0.1.49.2 base and it works: +30% aggregate on 4 concurrent streams — and two gotchas make the feature silently do nothing

We are the 4×RTX 4090 / 4-GPU-split / experts-100%-resident rig this request describes (engine 0.1.49.2, --layer-split 13,27,38, --batch 4, --spec 4 --spec-min-p 0.25, experts 100% resident, --kv k8v4 --kv-resident 524288). We ported PR #2985 (STRATA_PIPED_MTP) onto our base and measured it.

Result: 365.9 -> 477.8 tok/s aggregate on 4 concurrent streams (+30.5%), and every slot still decodes exactly the tokens it decodes alone. Upstream PR #4121 carries the port (against current main; the port was small — 2 conflict hunks in batch_groups.hpp and 6 in generate.cpp, all "keep both features", and src/core/verify.cpp merged clean).

Metric, because it matters: we measured a fixed 30 s window (four streams, the tokens that arrived in it) rather than "generate N tokens". With the latter, the requests stop at different times, so the batch window's shape changes and the same configuration measures 270 or 343 rows/s — a 27% swing that has nothing to do with the feature. With the fixed window the spread is ±0.4%.

arm 3 runs (tok/s) median
pipelined groups (default, no drafts) 329.4 / 366.7 / 365.9 365.9
STRATA_PIPED_MTP=1 477.8 / 478.2 / 474.4 477.8 (+30.5%)

The engine's own batch line agrees: 381 rows/s at 1.00 rows/step without drafts, 496 rows/s at 1.72 rows/step with them (6016 of 8320 proposals kept, 72%). N=2 (2.29 rows/step, 66% kept) and N=3 (2.70 rows/step, 58% kept) measured slightly below N=1, so N=1 is the sweet spot on our split.

This is the opposite of the -21.9% that 3ff62ec1 measured for batch MTP with all experts in VRAM. The reason we think the pipelined groups win where the serial windows lose: with the groups, all four cards stay busy; the serial-window batch leaves three of four waiting for the hand-off, which is what the "30-40% of the four streams' total" in #2985's summary measured.

VRAM is much cheaper than the warning text says. On our split the four slot drafters cost 50 MiB of private K/V state and buffers each (the solo drafter's weights are shared), not "about 0.9 GB per slot" — 200 MiB on the last stage's card, and the expert cache stayed 100% resident.

Two gotchas that make the feature silently do nothing (worth fixing in the PR)

1. --batch-groups given explicitly disables the feature. In batch_groups::resolve the two new lines sit inside if (!in.set && r.would_be > 1), and in.set is true whenever --batch-groups was given — a number or auto:

strata generate: WARNING: --batch-mtp is off: it does not combine with --batch-groups (pipelined slot groups) yet

The drafts are off and the message does not say why. --batch-groups auto is the documented way to configure a layer split, and the PR's own unit test never sets in.set, so it did not catch this. Moving the two assignments out of that block fixes it (PR #4121 does, with three unit tests). Not passing --batch-groups at all works too: the 0.1.41 default for a layer split with --batch >= 2 is already auto = one group per stage.

2. --remote-expert-opt blocks the feature even where it does nothing. The gate checks the flag:

        if (why == nullptr && !stages.empty() && (remote_caches || o.remote_expert_opt))
            why = "it is not run with helper expert caches on a layer split";

but the object it guards only exists with a helper expert cache:

    if (o.remote_expert_opt && o.expert_cache_remote[0] > 0) remote_opt = std::make_unique<strata::core::RemoteExpertOpt>();

Without --expert-cache-device1..3 the flag is inert (every remote_opt-guarded branch takes the else path) and the gate still refuses --batch-mtp. Checking the object instead of the flag would unblock the feature for anyone who has the flag on for no reason. We left this one to the maintainer in #4121.

Exactness

tools/batch_test.py, 4 slots on a 4-GPU split, 300 tokens, STRATA_IQ_MT_MIN=1 --adapt-swaps 0 --pcie-frac 0: every slot decodes exactly the tokens it decodes alone, with the feature on and with it off.

Not done

We did not relax the one-slot-per-group rule. The operator's suggestion in this thread — two slots per group with paired draft rows, or drafts only on the first slot of each group — is the natural next step, since it lifts the "4 slots need 4 groups" ceiling and would remove the burst regression at higher concurrency. If anyone has a rig to try that on, we would very much like to see the numbers.

Happy to rebase #4121 onto main whenever it moves, and to report more cases (tool-call heavy traffic, 2 streams, long contexts) the way we did in #73 and #2985.

<!-- gh-comment-id:6400051223 --> @wannagoxuf commented on GitHub (Oct 25, 2026): ### We ported PR #2985 to a 0.1.49.2 base and it works: +30% aggregate on 4 concurrent streams — and two gotchas make the feature silently do nothing We are the 4×RTX 4090 / 4-GPU-split / experts-100%-resident rig this request describes (engine 0.1.49.2, `--layer-split 13,27,38`, `--batch 4`, `--spec 4 --spec-min-p 0.25`, experts 100% resident, `--kv k8v4 --kv-resident 524288`). We ported PR #2985 (`STRATA_PIPED_MTP`) onto our base and measured it. **Result: 365.9 -> 477.8 tok/s aggregate on 4 concurrent streams (+30.5%)**, and every slot still decodes exactly the tokens it decodes alone. Upstream PR **#4121** carries the port (against current `main`; the port was small — 2 conflict hunks in `batch_groups.hpp` and 6 in `generate.cpp`, all "keep both features", and `src/core/verify.cpp` merged clean). **Metric, because it matters:** we measured a *fixed 30 s window* (four streams, the tokens that arrived in it) rather than "generate N tokens". With the latter, the requests stop at different times, so the batch window's shape changes and the same configuration measures 270 or 343 rows/s — a 27% swing that has nothing to do with the feature. With the fixed window the spread is ±0.4%. | arm | 3 runs (tok/s) | median | | --- | ---: | ---: | | pipelined groups (default, no drafts) | 329.4 / 366.7 / 365.9 | 365.9 | | `STRATA_PIPED_MTP=1` | 477.8 / 478.2 / 474.4 | **477.8 (+30.5%)** | The engine's own batch line agrees: 381 rows/s at 1.00 rows/step without drafts, 496 rows/s at 1.72 rows/step with them (6016 of 8320 proposals kept, 72%). `N=2` (2.29 rows/step, 66% kept) and `N=3` (2.70 rows/step, 58% kept) measured slightly below `N=1`, so `N=1` is the sweet spot on our split. **This is the opposite of the `-21.9%` that `3ff62ec1` measured for batch MTP with all experts in VRAM.** The reason we think the pipelined groups win where the serial windows lose: with the groups, all four cards stay busy; the serial-window batch leaves three of four waiting for the hand-off, which is what the "30-40% of the four streams' total" in #2985's summary measured. **VRAM is much cheaper than the warning text says.** On our split the four slot drafters cost **50 MiB of private K/V state and buffers each** (the solo drafter's weights are shared), not "about 0.9 GB per slot" — 200 MiB on the last stage's card, and the expert cache stayed 100% resident. ### Two gotchas that make the feature silently do nothing (worth fixing in the PR) **1. `--batch-groups` given explicitly disables the feature.** In `batch_groups::resolve` the two new lines sit *inside* `if (!in.set && r.would_be > 1)`, and `in.set` is true whenever `--batch-groups` was given — a number *or* `auto`: ``` strata generate: WARNING: --batch-mtp is off: it does not combine with --batch-groups (pipelined slot groups) yet ``` The drafts are off and the message does not say why. `--batch-groups auto` is the documented way to configure a layer split, and the PR's own unit test never sets `in.set`, so it did not catch this. Moving the two assignments out of that block fixes it (PR #4121 does, with three unit tests). Not passing `--batch-groups` at all works too: the 0.1.41 default for a layer split with `--batch >= 2` is already `auto` = one group per stage. **2. `--remote-expert-opt` blocks the feature even where it does nothing.** The gate checks the *flag*: ```cpp if (why == nullptr && !stages.empty() && (remote_caches || o.remote_expert_opt)) why = "it is not run with helper expert caches on a layer split"; ``` but the object it guards only exists with a helper expert cache: ```cpp if (o.remote_expert_opt && o.expert_cache_remote[0] > 0) remote_opt = std::make_unique<strata::core::RemoteExpertOpt>(); ``` Without `--expert-cache-device1..3` the flag is inert (every `remote_opt`-guarded branch takes the `else` path) and the gate still refuses `--batch-mtp`. Checking the object instead of the flag would unblock the feature for anyone who has the flag on for no reason. We left this one to the maintainer in #4121. ### Exactness `tools/batch_test.py`, 4 slots on a 4-GPU split, 300 tokens, `STRATA_IQ_MT_MIN=1 --adapt-swaps 0 --pcie-frac 0`: every slot decodes exactly the tokens it decodes alone, with the feature on and with it off. ### Not done We did not relax the one-slot-per-group rule. The operator's suggestion in this thread — two slots per group with paired draft rows, or drafts only on the first slot of each group — is the natural next step, since it lifts the "4 slots need 4 groups" ceiling and would remove the burst regression at higher concurrency. If anyone has a rig to try that on, we would very much like to see the numbers. Happy to rebase #4121 onto `main` whenever it moves, and to report more cases (tool-call heavy traffic, 2 streams, long contexts) the way we did in #73 and #2985.
Author
Owner

@wannagoxuf commented on GitHub (Oct 25, 2026):

Update from our rig (4x RTX 4090, layer split 13,27,38, --batch 4): the draft PR is now extended to more than one slot per group — a group's window carries each of its slots' rows, and every slot's proposals are judged, committed and drafted on their own (the last stage's final residuals are copied per slot's block; the chain catches up on its own rows only, with its own picks and positions).

Measured over four concurrent streams, fixed 30 s windows, three interleaved rounds (the arms' order rotated per round — the arm-to-arm noise is ~3%, so single rounds are not enough to compare):

shape rows per window aggregate
no drafts 1.00 366 tok/s
one slot per group, N=1 1.72 473 tok/s (+29%)
one slot per group, N=2 2.29 510 tok/s (+39%)
one slot per group, N=3 2.43 464 tok/s (+27%)
two slots per group, N=1 3.42 372 tok/s
two slots per group, N=2 4.21 360 tok/s

The two-slots-per-group shape does amortise as intended (1.72 -> 3.42 rows per window), but it is slower here: two groups occupy two of the four stages, so half the cards idle. With as many groups as stages and two slots each (eight slots) it would have both, but that costs the slot sessions' VRAM — on our rig eight slots would leave the expert cache without room. So on four cards, the number of pipeline streams is worth more than the extra rows per window.

Two proposals per slot per window is the best of the three: more rows amortise the weights better, but the proposals' acceptance falls as the window grows (72% at N=1, 64% at N=2, 58% at N=3), so the extra rows start to cost more than they save.

Correctness: with tools/batch_test.py in its strict protocol (STRATA_IQ_MT_MIN=1 --adapt-swaps 0 --pcie-frac 0), every slot's tokens are identical to the same request run alone — for one slot per group and for two, and for N=1, 2 and 3.

<!-- gh-comment-id:6401301823 --> @wannagoxuf commented on GitHub (Oct 25, 2026): Update from our rig (4x RTX 4090, layer split 13,27,38, `--batch 4`): the draft PR is now extended to **more than one slot per group** — a group's window carries each of its slots' rows, and every slot's proposals are judged, committed and drafted on their own (the last stage's final residuals are copied per slot's block; the chain catches up on its own rows only, with its own picks and positions). Measured over four concurrent streams, fixed 30 s windows, three interleaved rounds (the arms' order rotated per round — the arm-to-arm noise is ~3%, so single rounds are not enough to compare): | shape | rows per window | aggregate | |---|---|---| | no drafts | 1.00 | 366 tok/s | | one slot per group, N=1 | 1.72 | 473 tok/s (+29%) | | **one slot per group, N=2** | 2.29 | **510 tok/s (+39%)** | | one slot per group, N=3 | 2.43 | 464 tok/s (+27%) | | two slots per group, N=1 | 3.42 | 372 tok/s | | two slots per group, N=2 | 4.21 | 360 tok/s | The two-slots-per-group shape does amortise as intended (1.72 -> 3.42 rows per window), but it is slower here: two groups occupy two of the four stages, so half the cards idle. With as many groups as stages *and* two slots each (eight slots) it would have both, but that costs the slot sessions' VRAM — on our rig eight slots would leave the expert cache without room. So on four cards, the number of pipeline streams is worth more than the extra rows per window. Two proposals per slot per window is the best of the three: more rows amortise the weights better, but the proposals' acceptance falls as the window grows (72% at N=1, 64% at N=2, 58% at N=3), so the extra rows start to cost more than they save. Correctness: with `tools/batch_test.py` in its strict protocol (`STRATA_IQ_MT_MIN=1 --adapt-swaps 0 --pcie-frac 0`), every slot's tokens are identical to the same request run alone — for one slot per group and for two, and for N=1, 2 and 3.
Author
Owner

@wannagoxuf commented on GitHub (Oct 26, 2026):

Further measurements on the same rig (4x RTX 4090, layer split 13,27,38, fixed 30 s windows, two interleaved rounds), now that the multi-slot shape is in the PR:

shape 4 concurrent 8 concurrent
one slot per group (--batch 4), no drafts 366 tok/s 4 streams served, 4 starved (no slots)
one slot per group (--batch 4) 489 tok/s 4 streams served, 4 starved (no slots)
two slots per group (--batch 8, --kv-resident 262144) 390 tok/s 421 tok/s, all 8 served
two slots per group (--batch 8, --kv-resident 131072) 501 tok/s 522 tok/s, all 8 served

With eight slots the requests do spread over the four groups (the busy slots are 0, 2, 4, 6 and the engine reports 2.16 rows per step, i.e. one live slot per group). The gap at four concurrent is not the spreading but the VRAM: eight slot sessions take 10.18 GiB on CUDA0, so the expert cache shrinks from 9.41 GiB to 8.01 GiB (-15%) and the decode fetches more experts over PCIe — batch 4 with --kv-resident 262144 (the cache unchanged) measures 496 tok/s, and batch 8 with --kv-resident 131072 (the cache back to 9.41 GiB) measures 514.

One fix in the server came out of it: for groups of several slots, pick_slot used to sort only by "fill a hole below a busy slot of the same group", so a hole pulled a new request back into a group that already had one (another stage idle). It now takes the group with the fewest busy slots first, then the hole, then the usual order.

<!-- gh-comment-id:6405932080 --> @wannagoxuf commented on GitHub (Oct 26, 2026): Further measurements on the same rig (4x RTX 4090, layer split 13,27,38, fixed 30 s windows, two interleaved rounds), now that the multi-slot shape is in the PR: | shape | 4 concurrent | 8 concurrent | |---|---|---| | one slot per group (--batch 4), no drafts | 366 tok/s | 4 streams served, 4 starved (no slots) | | one slot per group (--batch 4) | 489 tok/s | 4 streams served, 4 starved (no slots) | | two slots per group (--batch 8, `--kv-resident 262144`) | 390 tok/s | 421 tok/s, all 8 served | | two slots per group (--batch 8, `--kv-resident 131072`) | 501 tok/s | **522 tok/s, all 8 served** | With eight slots the requests do spread over the four groups (the busy slots are 0, 2, 4, 6 and the engine reports 2.16 rows per step, i.e. one live slot per group). The gap at four concurrent is not the spreading but the VRAM: eight slot sessions take 10.18 GiB on CUDA0, so the expert cache shrinks from 9.41 GiB to 8.01 GiB (-15%) and the decode fetches more experts over PCIe — batch 4 with `--kv-resident 262144` (the cache unchanged) measures 496 tok/s, and batch 8 with `--kv-resident 131072` (the cache back to 9.41 GiB) measures 514. One fix in the server came out of it: for groups of several slots, `pick_slot` used to sort only by "fill a hole below a busy slot of the same group", so a hole pulled a new request back into a group that already had one (another stage idle). It now takes the group with the fewest busy slots first, then the hole, then the usual order.
Author
Owner

@noahark commented on GitHub (Oct 26, 2026):

Same shape of rig as yours (three sm_70 cards, every expert resident), so here is a measurement of the workaround your issue points at: the documented "keep the drafts" path for batch slots, --batch-groups 1 + --batch-mtp.

Setup

2x Tesla PG500-216 32 GB + 1x Tesla V100-PCIE-32GB, PCIe 3.0 x16 each, no NVLink, 2x Xeon E5-2696 v3, 128 GB DDR3L-1600, Windows. Qwen3.8-Flash-Next UD-IQ4_XS, 262144 context, --kv int8 --kv-resident 32768, --spec 4 + MTP, --layer-split 16,32 (16/16/16), STRATA_STAGE_TRIM=1. 100% expert residency on all three cards (8192/8192 each, 24576 total) — same premise as yours: the experts always fit, so upstream's "batch MTP pays only when they do not fit" calculus does not apply. Engine 0.1.48.

Method

Two clients posting at the same instant from threads, different nonces (no prefix reuse), ~4.6K-token prompt + 256 tokens each, temperature 0, 3 rounds per arm, one full restart per arm. Reported: the engine's own per-request predicted_per_second, aggregate generated tokens / wall time of the pair, and the wall time at which the first and the last request finished.

Results

layout decode per request aggregate first finished last finished
1 slot + --pipeline-windows 2 112.3 38.7 6.59 s 13.21 s
2 slots, engine default (2 groups, pipelined, no drafts) 51.6 38.5 13.29 s 13.32 s
2 slots, --batch-groups 1 + --batch-mtp 48.6 37.1 13.77 s 13.80 s

Three things fell out of it:

  1. The one-group + --batch-mtp path is 3.6% worse in aggregate than the pipelined default here (37.1 against 38.5), and 5.8% worse per request. So on a 3-stage rig where the experts are resident, serial windows plus per-slot drafts do not claw back what dropping the pipeline costs. That is consistent with upstream's -21.9% datapoint (2x R9700, all experts in VRAM) in sign, just smaller in size.
  2. Neither two-slot layout makes anyone finish earlier. Aggregate is the same in all three (37-39 tok/s, the machine is the limit), and the slowest request finishes at 13.2 / 13.3 / 13.8 s. Two slots merely split the same throughput: each request gets ~half speed and both land at the time the serial case takes for two.
  3. A single slot with the windows on beats every two-slot layout on every column: same aggregate, 2.2x the per-request speed, and the first client is done in half the time.

What this implies for the feature request

The thing worth having on this rig is not per-slot drafts in the pipelined path — it is the pipeline itself, and it already works on three stages today (see the three-stage comment in #859). Even if #2985's STRATA_PIPED_MTP were merged, a 3-stage V100 would be comparing it against a single slot that is already at 112 tok/s per request; two slots would have to more than double their per-request rate to break even, which the 2-group default demonstrably does not do.

What would actually help, if you are taking requests: making the prompt half of the window cheaper, since that is where the 4K prefill cost of enabling the windows shows up (-10% in my numbers).

Limits

  • One rig, one model, one split, two clients; not 4-8 streams, and no long-context legs (36.7K max).
  • No bit-exactness check against the serial loop.
  • --batch-mtp started without error and the engine reported the slot drafters, but I did not verify from the log that all 2 slots actually drafted every window — the throughput numbers are the only evidence I have that it ran as configured.
<!-- gh-comment-id:6407313526 --> @noahark commented on GitHub (Oct 26, 2026): Same shape of rig as yours (three sm_70 cards, every expert resident), so here is a measurement of the workaround your issue points at: the documented "keep the drafts" path for batch slots, `--batch-groups 1` + `--batch-mtp`. ## Setup 2x Tesla PG500-216 32 GB + 1x Tesla V100-PCIE-32GB, PCIe 3.0 x16 each, no NVLink, 2x Xeon E5-2696 v3, 128 GB DDR3L-1600, Windows. Qwen3.8-Flash-Next UD-IQ4_XS, 262144 context, `--kv int8 --kv-resident 32768`, `--spec 4` + MTP, `--layer-split 16,32` (16/16/16), `STRATA_STAGE_TRIM=1`. **100% expert residency on all three cards** (8192/8192 each, 24576 total) — same premise as yours: the experts always fit, so upstream's "batch MTP pays only when they do not fit" calculus does not apply. Engine 0.1.48. ## Method Two clients posting at the same instant from threads, different nonces (no prefix reuse), ~4.6K-token prompt + 256 tokens each, `temperature 0`, 3 rounds per arm, one full restart per arm. Reported: the engine's own per-request `predicted_per_second`, aggregate generated tokens / wall time of the pair, and the wall time at which the first and the last request finished. ## Results | layout | decode per request | aggregate | first finished | last finished | | --- | ---: | ---: | ---: | ---: | | **1 slot + `--pipeline-windows 2`** | **112.3** | 38.7 | **6.59 s** | 13.21 s | | 2 slots, engine default (2 groups, pipelined, no drafts) | 51.6 | 38.5 | 13.29 s | 13.32 s | | 2 slots, `--batch-groups 1` + `--batch-mtp` | 48.6 | 37.1 | 13.77 s | 13.80 s | Three things fell out of it: 1. **The one-group + `--batch-mtp` path is 3.6% *worse* in aggregate than the pipelined default here** (37.1 against 38.5), and 5.8% worse per request. So on a 3-stage rig where the experts are resident, serial windows plus per-slot drafts do not claw back what dropping the pipeline costs. That is consistent with upstream's -21.9% datapoint (2x R9700, all experts in VRAM) in sign, just smaller in size. 2. **Neither two-slot layout makes anyone finish earlier.** Aggregate is the same in all three (37-39 tok/s, the machine is the limit), and the slowest request finishes at 13.2 / 13.3 / 13.8 s. Two slots merely split the same throughput: each request gets ~half speed and both land at the time the serial case takes for two. 3. **A single slot with the windows on beats every two-slot layout on every column**: same aggregate, 2.2x the per-request speed, and the first client is done in half the time. ## What this implies for the feature request The thing worth having on this rig is **not** per-slot drafts in the pipelined path — it is the pipeline itself, and it already works on three stages today (see the three-stage comment in #859). Even if #2985's `STRATA_PIPED_MTP` were merged, a 3-stage V100 would be comparing it against a single slot that is already at 112 tok/s per request; two slots would have to more than double their per-request rate to break even, which the 2-group default demonstrably does not do. What would actually help, if you are taking requests: making the *prompt* half of the window cheaper, since that is where the 4K prefill cost of enabling the windows shows up (-10% in my numbers). ## Limits - One rig, one model, one split, two clients; not 4-8 streams, and no long-context legs (36.7K max). - No bit-exactness check against the serial loop. - `--batch-mtp` started without error and the engine reported the slot drafters, but I did not verify from the log that all 2 slots actually drafted every window — the throughput numbers are the only evidence I have that it ran as configured.
Author
Owner

@wannagoxuf commented on GitHub (Oct 26, 2026):

Thanks to both of you — and credit to @JacobSussan for #2985, which #4121 ports (you two tested it on sm_70 before any of us did).

Two measurements from this week answer the questions in this thread directly.

@llollaalloll: your note 2 is implemented — the one-slot-per-group rule is gone

#4121 now lets a group's window carry several slots: the group's rows are split per slot, and each slot's proposals are judged, committed and drafted on their own (its own accepted prefix, its own picks and positions; the last stage's final residuals are copied per slot's block, and the chain catches up on that slot's rows only). With one slot per group it is exactly the original behaviour.

Measured on 4x RTX 4090 (layer split 13,27,38, experts 100% resident, --batch 4 / --batch 8, fixed 30 s windows, two interleaved rounds):

shape 4 concurrent 8 concurrent
one slot per group (--batch 4), no drafts 366 tok/s 4 served, 4 starved
one slot per group (--batch 4), STRATA_PIPED_MTP=2 489 tok/s 4 served, 4 starved
two slots per group (--batch 8, --kv-resident 131072) 501 tok/s 522 tok/s, all 8 served

The burst regression you measured disappears by construction: the ceiling is no longer one slot per stage, so a three-stage rig can keep six slots and serve a four-request burst instead of dropping to three.

What the extra slots do not do is make a request faster — the aggregate is machine-bound, so two slots per group split it: 501 tok/s over eight requests is 63 tok/s each, against 489 tok/s over four requests at 122 tok/s each. The two-slot shape is worth having when there are more concurrent requests than stages; on a three-stage rig that trade is decided by whether you need more requests than stages, and we have not measured that shape on three stages — we would rather have your sm_70 numbers than guess.

One trap if you try the multi-slot shape on the original #2985: the verifier's window was sized from --spec alone, so a group of several slots overflows it and the whole pipeline dies with verify: batch rows out of range. #4121 sizes it for a group's rows.

@noahark: we ran your two layouts on a four-stage rig, and the gap grows with the stage count

Your comparison (--batch-groups 1 + --batch-mtp against the pipelined default) on 2x V100 + 1x V100-PCIE: 37.1 against 38.5 tok/s aggregate, per request 48.6 against 51.6. Same two layouts on 4x RTX 4090 (layer split 13,27,38, experts 100% resident, clients posting at the same instant, fixed 30 s windows), plus the pipelined path with the drafts this PR adds:

layout 2 concurrent (aggregate / steady) 4 concurrent (aggregate / steady) per request at 4
one group + --batch-mtp (your layout) 0.3 / 1.0 tok/s 212 / 246 tok/s 53
pipelined groups, no drafts 211 / 227 tok/s 364 / 430 tok/s 91
pipelined groups + STRATA_PIPED_MTP=2 (this PR) 307 / 357 tok/s 481 / 584 tok/s 120

Two things fall out of it.

1. The serial path's disadvantage grows with the stage count. At four concurrent it is 212 tok/s against the pipelined default's 364 — a 42% loss, which reproduces the 30-40% that #2985's summary reports for four stages (we had not measured that layout ourselves before this week). At three stages you measured 3.6%; at four it is 42%.

2. At two concurrent the serial path does not merely lose, it starves. The first client got 10 tokens in 30 s (first token at 24 s) and the second never got one. The engine's own log says why — the prompt read is walked serially between the stages, and with a slot to spare the decode has nothing to hide it behind:

strata batch: the prompt read gives way at 102838 of 186841 tokens; slot 0 holds it
strata batch: 8 windows, avg 1.75 rows, 12.68 ms/window

Eight windows in the whole 30 s, where the pipelined path on the same rig ran thousands. The pipeline is what makes a long read hideable, and that is the same property the drafts then exploit (+45% over the pipelined default at two clients, +32% at four).

So your conclusion — on a three-stage rig the pipeline itself is what is worth having, and the serial path with per-slot drafts does not claw back what dropping the pipeline costs — is what we see too; the drafts simply belong on the pipelined path, which is the arm you were missing and what #4121 adds.

A measurement caveat, since both of you measure with fixed windows

A fixed 30 s window counts the first-token ramp: with four streams admitted together the first token arrives at 1.3-5.2 s each, because the prompt reads are serial — a read costs 1.2 s on an idle engine but 4.5 s when the expert cache is occupied (28-63 GB of expert reads instead of 8-11 GB). The window number therefore reads 9-27% below the steady rate; one of our runs reads 512 tok/s in the window and 634 tok/s steady. The arm-to-arm comparisons hold (every arm has the same shape), but the absolute numbers in our earlier comments here are low, and a fixed-window "per request" rate is a steady rate that excludes the ramp.

If you compare against our numbers, compare window to window, and check your own first-token latency.

<!-- gh-comment-id:6414772452 --> @wannagoxuf commented on GitHub (Oct 26, 2026): Thanks to both of you — and credit to @JacobSussan for #2985, which #4121 ports (you two tested it on sm_70 before any of us did). Two measurements from this week answer the questions in this thread directly. ### @llollaalloll: your note 2 is implemented — the one-slot-per-group rule is gone #4121 now lets a group's window carry several slots: the group's rows are split per slot, and each slot's proposals are judged, committed and drafted on their own (its own accepted prefix, its own picks and positions; the last stage's final residuals are copied per slot's block, and the chain catches up on that slot's rows only). With one slot per group it is exactly the original behaviour. Measured on 4x RTX 4090 (layer split `13,27,38`, experts 100% resident, `--batch 4` / `--batch 8`, fixed 30 s windows, two interleaved rounds): | shape | 4 concurrent | 8 concurrent | |---|---:|---:| | one slot per group (`--batch 4`), no drafts | 366 tok/s | 4 served, 4 starved | | one slot per group (`--batch 4`), `STRATA_PIPED_MTP=2` | 489 tok/s | 4 served, 4 starved | | two slots per group (`--batch 8`, `--kv-resident 131072`) | 501 tok/s | 522 tok/s, all 8 served | The burst regression you measured disappears by construction: the ceiling is no longer one slot per stage, so a three-stage rig can keep six slots and serve a four-request burst instead of dropping to three. What the extra slots do **not** do is make a request faster — the aggregate is machine-bound, so two slots per group split it: 501 tok/s over eight requests is 63 tok/s each, against 489 tok/s over four requests at 122 tok/s each. The two-slot shape is worth having when there are more concurrent requests than stages; on a three-stage rig that trade is decided by whether you need more requests than stages, and we have not measured that shape on three stages — we would rather have your sm_70 numbers than guess. One trap if you try the multi-slot shape on the original #2985: the verifier's window was sized from `--spec` alone, so a group of several slots overflows it and the whole pipeline dies with `verify: batch rows out of range`. #4121 sizes it for a group's rows. ### @noahark: we ran your two layouts on a four-stage rig, and the gap grows with the stage count Your comparison (`--batch-groups 1` + `--batch-mtp` against the pipelined default) on 2x V100 + 1x V100-PCIE: 37.1 against 38.5 tok/s aggregate, per request 48.6 against 51.6. Same two layouts on 4x RTX 4090 (layer split `13,27,38`, experts 100% resident, clients posting at the same instant, fixed 30 s windows), plus the pipelined path with the drafts this PR adds: | layout | 2 concurrent (aggregate / steady) | 4 concurrent (aggregate / steady) | per request at 4 | |---|---:|---:|---:| | one group + `--batch-mtp` (your layout) | **0.3 / 1.0 tok/s** | 212 / 246 tok/s | 53 | | pipelined groups, no drafts | 211 / 227 tok/s | 364 / 430 tok/s | 91 | | pipelined groups + `STRATA_PIPED_MTP=2` (this PR) | **307 / 357 tok/s** | **481 / 584 tok/s** | 120 | Two things fall out of it. **1. The serial path's disadvantage grows with the stage count.** At four concurrent it is 212 tok/s against the pipelined default's 364 — a 42% loss, which reproduces the 30-40% that #2985's summary reports for four stages (we had not measured that layout ourselves before this week). At three stages you measured 3.6%; at four it is 42%. **2. At two concurrent the serial path does not merely lose, it starves.** The first client got 10 tokens in 30 s (first token at 24 s) and the second never got one. The engine's own log says why — the prompt read is walked serially between the stages, and with a slot to spare the decode has nothing to hide it behind: ``` strata batch: the prompt read gives way at 102838 of 186841 tokens; slot 0 holds it strata batch: 8 windows, avg 1.75 rows, 12.68 ms/window ``` Eight windows in the whole 30 s, where the pipelined path on the same rig ran thousands. The pipeline is what makes a long read hideable, and that is the same property the drafts then exploit (+45% over the pipelined default at two clients, +32% at four). So your conclusion — on a three-stage rig the pipeline itself is what is worth having, and the serial path with per-slot drafts does not claw back what dropping the pipeline costs — is what we see too; the drafts simply belong on the pipelined path, which is the arm you were missing and what #4121 adds. ### A measurement caveat, since both of you measure with fixed windows A fixed 30 s window counts the first-token ramp: with four streams admitted together the first token arrives at 1.3-5.2 s each, because the prompt reads are serial — a read costs 1.2 s on an idle engine but 4.5 s when the expert cache is occupied (28-63 GB of expert reads instead of 8-11 GB). The window number therefore reads **9-27% below the steady rate**; one of our runs reads 512 tok/s in the window and 634 tok/s steady. The arm-to-arm comparisons hold (every arm has the same shape), but the absolute numbers in our earlier comments here are low, and a fixed-window "per request" rate is a steady rate that excludes the ramp. If you compare against our numbers, compare window to window, and check your own first-token latency.
Author
Owner

@noahark commented on GitHub (Oct 26, 2026):

Thanks for the invitation — here are the three-stage sm_70 numbers for the multi-slot shape, plus the one-slot-per-group comparison on the same engine.

Build: #4121 at 9241a24 compiled clean on Windows / CUDA 12.4 / sm_70 (no source changes; the engine reports 0.1.51 + the port). Same rig as my earlier comment: 2x PG500-216 32 GB + 1x V100-PCIE-32GB, PCIe 3.0 x16, 2x E5-2696 v3, 128 GB DDR3L-1600, Windows. Layer split 16/16/16, experts 100% resident on all three cards in every arm (the 6-slot arms included — the numbers below are not cache eviction), ctx 262144, --kv int8 --kv-resident 32768, --spec 4, --spec-min-p 0.5, STRATA_STAGE_TRIM=1.

Method: your fixed 30 s window, window-to-window as you suggested. N streams posted at the same instant, distinct nonces (no prefix reuse), 4,411-4,445-token prompts, temperature 0; the model thinks first, and thinking tokens are decode tokens, so they count. One discarded warm round per point, a fresh server per arm, 3 rounds per point (2 for the 4-concurrent burst points). Rates are the engine's own batch summary over the window (its rows are committed tokens — we cross-checked 1:1 against the per-slot generated counters on a run where both were readable).

shape 3 concurrent 4 concurrent 6 concurrent
one slot per group (--batch 3), no drafts 101.0
one slot per group, STRATA_PIPED_MTP=2 122.3 (+21%)
two slots per group (--batch 6), no drafts 87.7 55.2
two slots per group, STRATA_PIPED_MTP=2 98.1 (+12%) 59.0 (+7%)

MTP acceptance 60-67 % across the draft arms; round-to-round spread ±2 %. Per stream, the one-slot shape goes 33.7 -> 40.8 tok/s with the drafts on.

The multi-slot shape itself is what loses here, and it is the prompt reads. TTFT is a perfect ladder — one stream's first token every +3.9 s: 3.7 / 7.7 / 11.7 / 15.7 / 19.7 / 23.8 s for streams 1-6. Each 4.4k-token read costs ~3.7 s (~1,150-1,200 t/s) and the reads stay serial between the stages, so at six streams admission eats ~24 s of the 30 s window. That is the gap between 59 and what the same six streams decode at once; on this DDR3L rig the read tax is the shape's cost, not VRAM and not the experts.

The burst case answers your question the other way round on three stages: a four-request burst through six slots (98.1, all four admitted) is still ~20 % below the three-slot shape serving three with one queued (122.3) — the opposite of the by-construction expectation, again because the serial admission dominates. So on this rig: one slot per group + STRATA_PIPED_MTP=2 is the shape to run, and we found no concurrency where the two-slot shape pays — the extra slots only make sense on hardware where the prompt read hides (your four 4090s amortize a read in 1.2-4.5 s; a 4.4k read costs us 3.7 s and there are three stages, not four, to hide it behind).

The feature itself is a clean win on sm_70 regardless of shape debates: +21 % aggregate at N=2 with ~63 % acceptance, and correctness is intact — a temperature-0 probe (count 1..40) is byte-identical across the no-drafts baseline and both draft shapes.

<!-- gh-comment-id:6429565932 --> @noahark commented on GitHub (Oct 26, 2026): Thanks for the invitation — here are the three-stage sm_70 numbers for the multi-slot shape, plus the one-slot-per-group comparison on the same engine. **Build:** #4121 at 9241a24 compiled clean on Windows / CUDA 12.4 / sm_70 (no source changes; the engine reports 0.1.51 + the port). Same rig as my earlier comment: 2x PG500-216 32 GB + 1x V100-PCIE-32GB, PCIe 3.0 x16, 2x E5-2696 v3, 128 GB DDR3L-1600, Windows. Layer split 16/16/16, experts 100% resident on all three cards in **every** arm (the 6-slot arms included — the numbers below are not cache eviction), ctx 262144, `--kv int8 --kv-resident 32768`, `--spec 4`, `--spec-min-p 0.5`, `STRATA_STAGE_TRIM=1`. **Method:** your fixed 30 s window, window-to-window as you suggested. N streams posted at the same instant, distinct nonces (no prefix reuse), 4,411-4,445-token prompts, temperature 0; the model thinks first, and thinking tokens are decode tokens, so they count. One discarded warm round per point, a fresh server per arm, 3 rounds per point (2 for the 4-concurrent burst points). Rates are the engine's own batch summary over the window (its rows are committed tokens — we cross-checked 1:1 against the per-slot generated counters on a run where both were readable). | shape | 3 concurrent | 4 concurrent | 6 concurrent | |---|---:|---:|---:| | one slot per group (`--batch 3`), no drafts | 101.0 | | | | one slot per group, `STRATA_PIPED_MTP=2` | **122.3 (+21%)** | | | | two slots per group (`--batch 6`), no drafts | | 87.7 | 55.2 | | two slots per group, `STRATA_PIPED_MTP=2` | | 98.1 (+12%) | 59.0 (+7%) | MTP acceptance 60-67 % across the draft arms; round-to-round spread ±2 %. Per stream, the one-slot shape goes 33.7 -> 40.8 tok/s with the drafts on. **The multi-slot shape itself is what loses here, and it is the prompt reads.** TTFT is a perfect ladder — one stream's first token every +3.9 s: 3.7 / 7.7 / 11.7 / 15.7 / 19.7 / 23.8 s for streams 1-6. Each 4.4k-token read costs ~3.7 s (~1,150-1,200 t/s) and the reads stay serial between the stages, so at six streams admission eats ~24 s of the 30 s window. That is the gap between 59 and what the same six streams decode at once; on this DDR3L rig the read tax is the shape's cost, not VRAM and not the experts. **The burst case answers your question the other way round on three stages:** a four-request burst through six slots (98.1, all four admitted) is still ~20 % below the three-slot shape serving three with one queued (122.3) — the opposite of the by-construction expectation, again because the serial admission dominates. So on this rig: **one slot per group + `STRATA_PIPED_MTP=2` is the shape to run, and we found no concurrency where the two-slot shape pays** — the extra slots only make sense on hardware where the prompt read hides (your four 4090s amortize a read in 1.2-4.5 s; a 4.4k read costs us 3.7 s and there are three stages, not four, to hide it behind). The feature itself is a clean win on sm_70 regardless of shape debates: +21 % aggregate at N=2 with ~63 % acceptance, and correctness is intact — a temperature-0 probe (count 1..40) is byte-identical across the no-drafts baseline and both draft shapes.
Author
Owner

@Niko1221 commented on GitHub (Oct 27, 2026):

Thank you. #4121 is in 0.2.7 as an opt-in: STRATA_PIPED_MTP=1 with --batch-mtp, with changes found in review (the group count was printed as the slot count; with the variable unset the engine is exactly as before). On two RTX A6000 cards with a batch of slots, two streams gained 15.4% (five of five pairs), four streams 4.7%, one stream nothing; the merged build gave +12.2% and +0.2% in three pairs. Every slot decodes exactly the tokens it decodes alone. We could not repeat your four-card result (+39% on four RTX 4090). On two NVIDIA cards the plain batch drafting is 15 to 18% slower than the pipelined way even without your switch; the owner is deciding whether that becomes the default. Could you try 0.2.7 on your four cards and tell us your numbers?

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7

<!-- gh-comment-id:6446080484 --> @Niko1221 commented on GitHub (Oct 27, 2026): Thank you. #4121 is in 0.2.7 as an opt-in: STRATA_PIPED_MTP=1 with --batch-mtp, with changes found in review (the group count was printed as the slot count; with the variable unset the engine is exactly as before). On two RTX A6000 cards with a batch of slots, two streams gained 15.4% (five of five pairs), four streams 4.7%, one stream nothing; the merged build gave +12.2% and +0.2% in three pairs. Every slot decodes exactly the tokens it decodes alone. We could not repeat your four-card result (+39% on four RTX 4090). On two NVIDIA cards the plain batch drafting is 15 to 18% slower than the pipelined way even without your switch; the owner is deciding whether that becomes the default. Could you try 0.2.7 on your four cards and tell us your numbers? Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7
Author
Owner

@Adamyno commented on GitHub (Oct 27, 2026):

STRATA_PIPED_MTP=1 on an sm_75 3-card split: +15% aggregate with two clients, TTFT unchanged

Tested the shipped opt-in (0.2.7, engine 0.1.52) on the rig this thread is about: a 3× RTX 2080 Ti layer split serving two concurrent clients.

Hardware: 3× RTX 2080 Ti 22 GB (210/167/200 W), i9-7980XE, 125.5 GiB DDR4-3600, kernel 7.0.0-38, driver 580.178.04, CUDA 13.0. layer_split 16,32, Qwen3.8-Flash-Next UD-Q4_K_XL, 262,144 ctx, --kv int8 --spec 3 --spec-min-p 0.54 --mtp mtp/rt --batch 2, STRATA_NO_LARGEPAGES=1 STRATA_BF16_TC=1.

Arms (same binary, environment + one flag):

  • A: stock (--batch-groups auto → 2 groups of 1 slot)
  • B: STRATA_PIPED_MTP=1 + --batch-mtp

Engine start confirms B takes the path: STRATA_PIPED_MTP: 2 pipelined groups of 1 slot draft up to 1 MTP proposal per slot each window and --batch-mtp: 2 slot drafters on CUDA2 (312 MiB of private K/V state and buffers each, sharing the solo drafter's weights).

Measured with tools/strata_bench.py --clients 2 (three bursts of two simultaneous requests):

metric A (stock) B (STRATA_PIPED_MTP=1) Δ
2 clients, total throughput 53.8 tok/s (50.9–56.3) 61.7 tok/s (56.2–65.5) +14.7%
2 clients, request latency p50 4.747 s 4.03 s −15%
2 clients, first token p50 1.143 s 1.148 s 0%
single-stream chat decode 70.9 (59.4–82.3) 67.9 (60.5–82.9) −4% (ranges overlap)
agent-session decode 74.0 (60.6–83.5) 75.2 (64.5–81.6) +2%
4K prompt read 586.6 tok/s 578.0 −1.5%
16K prompt read 1,342.1 tok/s 1,322.5 −1.5%

No errors in either arm, and slot count stayed 2.

Reading it: on this rig the pipelined groups were already keeping both cards busy but emitting one token per slot per window; adding the per-slot drafts turns that into ~1.15 tokens per slot per window without breaking the pipeline — so the aggregate rises and the per-request latency drops, while the single-stream and prompt paths stay where they were (the small prefill drop is at the edge of this box's noise).

This also explains why the earlier --batch-mtp result on sm_75 was negative (my note in #2235 / #2738: −22% with --batch-groups 1): that arm serialised the slots and lost the pipeline. The pipelined version keeps both.

Caveats: three bursts per arm (n=3), one model/pack/context; the chat-decode ranges are wide enough that I would not claim the −4% as real. Happy to repeat with more bursts or a 32K prompt if you want a tighter number.

<!-- gh-comment-id:6452367657 --> @Adamyno commented on GitHub (Oct 27, 2026): ## `STRATA_PIPED_MTP=1` on an sm_75 3-card split: +15% aggregate with two clients, TTFT unchanged Tested the shipped opt-in (0.2.7, engine 0.1.52) on the rig this thread is about: a 3× RTX 2080 Ti layer split serving two concurrent clients. **Hardware:** 3× RTX 2080 Ti 22 GB (210/167/200 W), i9-7980XE, 125.5 GiB DDR4-3600, kernel 7.0.0-38, driver 580.178.04, CUDA 13.0. `layer_split 16,32`, Qwen3.8-Flash-Next UD-Q4_K_XL, 262,144 ctx, `--kv int8 --spec 3 --spec-min-p 0.54 --mtp mtp/rt --batch 2`, `STRATA_NO_LARGEPAGES=1 STRATA_BF16_TC=1`. **Arms (same binary, environment + one flag):** - A: stock (`--batch-groups auto` → 2 groups of 1 slot) - B: `STRATA_PIPED_MTP=1` + `--batch-mtp` Engine start confirms B takes the path: `STRATA_PIPED_MTP: 2 pipelined groups of 1 slot draft up to 1 MTP proposal per slot each window` and `--batch-mtp: 2 slot drafters on CUDA2 (312 MiB of private K/V state and buffers each, sharing the solo drafter's weights)`. **Measured with `tools/strata_bench.py --clients 2` (three bursts of two simultaneous requests):** | metric | A (stock) | B (`STRATA_PIPED_MTP=1`) | Δ | |---|---:|---:|---:| | 2 clients, total throughput | **53.8 tok/s** (50.9–56.3) | **61.7 tok/s** (56.2–65.5) | **+14.7%** | | 2 clients, request latency p50 | 4.747 s | 4.03 s | −15% | | 2 clients, first token p50 | 1.143 s | 1.148 s | 0% | | single-stream chat decode | 70.9 (59.4–82.3) | 67.9 (60.5–82.9) | −4% (ranges overlap) | | agent-session decode | 74.0 (60.6–83.5) | 75.2 (64.5–81.6) | +2% | | 4K prompt read | 586.6 tok/s | 578.0 | −1.5% | | 16K prompt read | 1,342.1 tok/s | 1,322.5 | −1.5% | No errors in either arm, and slot count stayed 2. **Reading it:** on this rig the pipelined groups were already keeping both cards busy but emitting one token per slot per window; adding the per-slot drafts turns that into ~1.15 tokens per slot per window without breaking the pipeline — so the aggregate rises and the per-request latency drops, while the single-stream and prompt paths stay where they were (the small prefill drop is at the edge of this box's noise). This also explains why the earlier `--batch-mtp` result on sm_75 was negative (my note in #2235 / #2738: −22% with `--batch-groups 1`): that arm serialised the slots and lost the pipeline. The pipelined version keeps both. **Caveats:** three bursts per arm (n=3), one model/pack/context; the chat-decode ranges are wide enough that I would not claim the −4% as real. Happy to repeat with more bursts or a 32K prompt if you want a tighter number.
Author
Owner

@orochifj commented on GitHub (Nov 1, 2026):

0.2.9: the automatic parallel settings switch STRATA_PIPED_MTP off

Adding this here because this thread is where people find the switch.

Environment: Strata v0.2.9 (c62d5e3a, engine 0.1.55) built from source for sm_86 with the repo Dockerfile, no changes. Linux 6.8, NVIDIA 610.57.04. 2x RTX 3090 24 GB at 250 W, layer split auto (24 / 24). Swift-1.5 Qwen3.8-Flash-Next IQ4_XS, --max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 --spec 4 --spec-min-p 0.5, "parallel": 4 (2 pipelined groups of 2 slots). Expert cache 5,224 + 4,896 slots, so not every expert is resident.

Reproduce: config "parallel": 4, args --batch-mtp, env STRATA_PIPED_MTP=1, started through serve/server.py.

Expected: the pipelined groups draft (the STRATA_PIPED_MTP: 2 pipelined groups of 2 slots draft up to 1 MTP proposal per slot each window line).

Actual: the server sets the nine settings that are new in 0.2.9 (PARALLEL_STACK_ENV), STRATA_BATCH_SELF_COMMIT=1 among them, and the engine prints

strata generate: WARNING: STRATA_PIPED_MTP is off: it does not combine with STRATA_BATCH_SELF_COMMIT (the window would keep its rows itself)

then runs the groups without drafts. With "STRATA_BATCH_SELF_COMMIT": "0" in the config's env the drafts run.

Reproduction status: reproduced locally.

Measurements (same unmodified build, 250 W; N requests at once, each a different ~1.5K-token prompt, 512 output tokens, greedy, thinking off; aggregate = completion tokens / wall time; one run per cell; a 5-question answer check passed 5/5 in every arm):

arm 1 stream 2 streams 4 streams proposals kept at 4
as shipped (the nine settings, no drafts) 140 115 136 –
+ --batch-mtp, STRATA_PIPED_MTP=1 (SELF_COMMIT still 1: drafts off) 138 114 137 –
+ STRATA_BATCH_SELF_COMMIT=0, STRATA_PIPED_MTP=1 139 144 155 89 %
STRATA_PIPED_MTP=3 136 159 169 77 %
STRATA_PIPED_MTP=3 + STRATA_PIPED_CONCURRENT=1 136 165 189 75 %

Limit of this harness: the warm-up request used request 0's prompt, so in some runs one request started from a cached prompt. With a per-run salt at the start of every prompt (every prompt read cold), the last arm measured 96 / 126 / 146 and 93 / 126 / 146 tok/s in two runs; the other arms were not repeated that way.

So on a split whose experts do not all fit, the piped drafts still pay at 4 streams (+14 %, +24 %, +39 % over the shipped stack in the rows above). A suggestion: leave STRATA_BATCH_SELF_COMMIT out of the automatic settings when STRATA_PIPED_MTP is set, or say in the parallel-stack note that it has to be 0 for the piped drafts.

<!-- gh-comment-id:6552365702 --> @orochifj commented on GitHub (Nov 1, 2026): **0.2.9: the automatic parallel settings switch `STRATA_PIPED_MTP` off** Adding this here because this thread is where people find the switch. **Environment:** Strata v0.2.9 (`c62d5e3a`, engine 0.1.55) built from source for sm_86 with the repo Dockerfile, no changes. Linux 6.8, NVIDIA 610.57.04. 2x RTX 3090 24 GB at 250 W, layer split auto (24 / 24). Swift-1.5 Qwen3.8-Flash-Next IQ4_XS, `--max-context 524288 --rope-scaling yarn --rope-scale 2 --kv int8 --kv-resident 32768 --spec 4 --spec-min-p 0.5`, `"parallel": 4` (2 pipelined groups of 2 slots). Expert cache 5,224 + 4,896 slots, so not every expert is resident. **Reproduce:** config `"parallel": 4`, args `--batch-mtp`, env `STRATA_PIPED_MTP=1`, started through `serve/server.py`. **Expected:** the pipelined groups draft (the `STRATA_PIPED_MTP: 2 pipelined groups of 2 slots draft up to 1 MTP proposal per slot each window` line). **Actual:** the server sets the nine settings that are new in 0.2.9 (`PARALLEL_STACK_ENV`), `STRATA_BATCH_SELF_COMMIT=1` among them, and the engine prints ```text strata generate: WARNING: STRATA_PIPED_MTP is off: it does not combine with STRATA_BATCH_SELF_COMMIT (the window would keep its rows itself) ``` then runs the groups without drafts. With `"STRATA_BATCH_SELF_COMMIT": "0"` in the config's `env` the drafts run. **Reproduction status:** reproduced locally. **Measurements** (same unmodified build, 250 W; N requests at once, each a different ~1.5K-token prompt, 512 output tokens, greedy, thinking off; aggregate = completion tokens / wall time; one run per cell; a 5-question answer check passed 5/5 in every arm): | arm | 1 stream | 2 streams | 4 streams | proposals kept at 4 | |---|---|---|---|---| | as shipped (the nine settings, no drafts) | 140 | 115 | 136 | – | | + `--batch-mtp`, `STRATA_PIPED_MTP=1` (SELF_COMMIT still 1: drafts off) | 138 | 114 | 137 | – | | + `STRATA_BATCH_SELF_COMMIT=0`, `STRATA_PIPED_MTP=1` | 139 | 144 | 155 | 89 % | | `STRATA_PIPED_MTP=3` | 136 | 159 | 169 | 77 % | | `STRATA_PIPED_MTP=3` + `STRATA_PIPED_CONCURRENT=1` | 136 | 165 | 189 | 75 % | Limit of this harness: the warm-up request used request 0's prompt, so in some runs one request started from a cached prompt. With a per-run salt at the start of every prompt (every prompt read cold), the last arm measured 96 / 126 / 146 and 93 / 126 / 146 tok/s in two runs; the other arms were not repeated that way. So on a split whose experts do not all fit, the piped drafts still pay at 4 streams (+14 %, +24 %, +39 % over the shipped stack in the rows above). A suggestion: leave `STRATA_BATCH_SELF_COMMIT` out of the automatic settings when `STRATA_PIPED_MTP` is set, or say in the parallel-stack note that it has to be 0 for the piped drafts.
Author
Owner

@cjmckenna commented on GitHub (Nov 1, 2026):

Second box, same finding. Here is what each of 0.2.9's new automatic settings does on our split, measured one arm at a time.

Setup: 2x RTX 3090, layer split 28, Qwen3.8-Flash-Next IQ3_S. Strata v0.2.9 (c62d5e3a, engine 0.1.55) plus two small local patches (a CPU-share gate and a client tag on /metrics; neither touches the batch window). --batch 2 --batch-mtp --batch-groups auto (2 pipelined groups of 1 slot), STRATA_PIPED_MTP=2, --short-read 64, STRATA_CKPT_POOL=1. Expert cache 10,006 + 8,756 slots, so not every expert is resident. Started through serve/server.py.

Method: idle box, one restart per arm, seeded requests. "Two conversations" means two ~90K-token conversations decoding at the same time, aggregate tok/s over the wall clock, one run per arm. A repeat arm in an earlier sweep on this box moved ±3%. Solo decode is a least-squares fit over 6 runs per arm at 16K, 97K and 160K, with draft acceptance as a covariate. Cold reads are single prompts of 30K, 97K and 170K.

Arm Automatic parallel settings GDN kernels Two conversations Solo decode vs 0.2.7 Cold 30K / 97K / 170K
0.2.7 (same patches), two runs n/a n/a 148 / 149 tok/s ref 9.6 / 26.4 / 46.9 s
0.2.9 as shipped all on on 115 -0.6 ±0.8 9.5 / 26.1 / 46.1
GDN off all on off 119 +0.1 ±0.9 9.7 / 26.4 / 46.9
only STRATA_BATCH_SELF_COMMIT=0 others on on 146 +0.1 ±0.9 9.6 / 26.1 / 46.2
all eight =0 (CKPT_POOL kept) off on 149 +0.6 ±0.9 9.6 / 26.2 / 46.3
all eight =0, GDN off off off 157 -0.3 ±0.9 9.7 / 26.4 / 46.6

What it shows on this box:

  • STRATA_BATCH_SELF_COMMIT=1 explains the whole loss. Turning that one switch off brings two conversations back to the 0.2.7 level. The other seven new settings neither help nor hurt at --batch 2, within one run's noise.
  • The GDN prompt kernels are a separate matter. Cold reads are 0.9-1.7% faster at every size. With the piped drafts on, the three arms landed at 146-157 for two conversations, one run each, so I can't separate any GDN effect on decode from the noise.
  • Solo decode and warm follow-ups are unchanged in every arm.

We run the "all eight =0" arm in production now. +1 to orochifj's suggestion: leave STRATA_BATCH_SELF_COMMIT out of the automatic settings when STRATA_PIPED_MTP is set. The engine already knows the two don't combine; today the user's explicit choice loses to a default with only a warning in the log.

Not measured: more than one two-conversation run per arm; 0.2.9 without STRATA_PIPED_MTP against 0.2.9 with SELF_COMMIT; more than two slots; answer quality beyond a tool-call smoke test.

Developed with an AI coding assistant; every number above was measured on the machine described.

<!-- gh-comment-id:6553019300 --> @cjmckenna commented on GitHub (Nov 1, 2026): Second box, same finding. Here is what each of 0.2.9's new automatic settings does on our split, measured one arm at a time. **Setup:** 2x RTX 3090, layer split 28, Qwen3.8-Flash-Next IQ3_S. Strata v0.2.9 (`c62d5e3a`, engine 0.1.55) plus two small local patches (a CPU-share gate and a client tag on `/metrics`; neither touches the batch window). `--batch 2 --batch-mtp --batch-groups auto` (2 pipelined groups of 1 slot), `STRATA_PIPED_MTP=2`, `--short-read 64`, `STRATA_CKPT_POOL=1`. Expert cache 10,006 + 8,756 slots, so not every expert is resident. Started through `serve/server.py`. **Method:** idle box, one restart per arm, seeded requests. "Two conversations" means two ~90K-token conversations decoding at the same time, aggregate tok/s over the wall clock, one run per arm. A repeat arm in an earlier sweep on this box moved ±3%. Solo decode is a least-squares fit over 6 runs per arm at 16K, 97K and 160K, with draft acceptance as a covariate. Cold reads are single prompts of 30K, 97K and 170K. | Arm | Automatic parallel settings | GDN kernels | Two conversations | Solo decode vs 0.2.7 | Cold 30K / 97K / 170K | |---|---|---|---|---|---| | 0.2.7 (same patches), two runs | n/a | n/a | 148 / 149 tok/s | ref | 9.6 / 26.4 / 46.9 s | | 0.2.9 as shipped | all on | on | **115** | -0.6 ±0.8 | 9.5 / 26.1 / 46.1 | | GDN off | all on | off | **119** | +0.1 ±0.9 | 9.7 / 26.4 / 46.9 | | only `STRATA_BATCH_SELF_COMMIT=0` | others on | on | 146 | +0.1 ±0.9 | 9.6 / 26.1 / 46.2 | | all eight =0 (`CKPT_POOL` kept) | off | on | 149 | +0.6 ±0.9 | 9.6 / 26.2 / 46.3 | | all eight =0, GDN off | off | off | 157 | -0.3 ±0.9 | 9.7 / 26.4 / 46.6 | What it shows on this box: - `STRATA_BATCH_SELF_COMMIT=1` explains the whole loss. Turning that one switch off brings two conversations back to the 0.2.7 level. The other seven new settings neither help nor hurt at `--batch 2`, within one run's noise. - The GDN prompt kernels are a separate matter. Cold reads are 0.9-1.7% faster at every size. With the piped drafts on, the three arms landed at 146-157 for two conversations, one run each, so I can't separate any GDN effect on decode from the noise. - Solo decode and warm follow-ups are unchanged in every arm. We run the "all eight =0" arm in production now. +1 to orochifj's suggestion: leave `STRATA_BATCH_SELF_COMMIT` out of the automatic settings when `STRATA_PIPED_MTP` is set. The engine already knows the two don't combine; today the user's explicit choice loses to a default with only a warning in the log. Not measured: more than one two-conversation run per arm; 0.2.9 without `STRATA_PIPED_MTP` against 0.2.9 with SELF_COMMIT; more than two slots; answer quality beyond a tool-call smoke test. Developed with an AI coding assistant; every number above was measured on the machine described.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1599
No description provided.