mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #509] layer_split auto is 2.86x slower than a balanced K on prefill with a heterogeneous pair (3080 + V100, measured) #237
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#237
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 @meelonjisoo-commits on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/509
Platform (all values measured on this machine)
7872494f--kv q4_0,--expert-cache auto, MTP draftdrop_cachesbefore every armWhat happens
layer_split autopicks a placement that is 2.86x slower on prompt processing than an explicit balancedK:549.5 t/s vs 1572.7 t/s on the same 32,368-token prompt, same engine, same build, same links. The single-card
baseline is 975.0 t/s — so the default split is 1.77x slower than not splitting, while a balanced split is
1.61x faster than not splitting. Only the
Kdiffers.layer_split auto--layer-split 11 --split-device 0)--layer-split 24--layer-split 30At K=30 the first card is the bottleneck (30 layers x
0.69 s/layer = 20.7 s predicted, 20.6 s measured), so K=29-30is this pair's optimum and ~1600 t/s its ceiling. The V100's SM clock was sampled in every split arm
(median 1380 of 1380 MHz), so the numbers are not a clock artifact.
Why auto lands on the slow placement
MULTI_GPU.mdstates auto "keeps the one whose caches would hold the most of the expert profile". That objective isblind to the per-layer cost of the card the layers land on, and on a heterogeneous pair the cache-coverage
optimum and the time optimum diverge:
measured alone on this box), so 37 layers there makes it the pipeline's bottleneck;
The engine already estimates per-stage per-layer cost at startup for its own plan log
(
CUDA0 68 SMs at 1.78 GHz -> 0.60 ms per layer,CUDA1 80 SMs at 1.38 GHz -> 0.66 ms per layer), so atime-balanced auto would be
argmin_K max(K*t0, (48-K)*t1)plus the hand-off instead of a coverage ranking. (Your ownMULTI_GPU.mdtable shows the same, smaller, gap: auto K=22 at 2,037 t/s against "best split (K=26)" at 2,039 /2,357 t/s on a 5080+3090.)
Two things it is NOT (both measured, so nobody re-chases them)
(
bw>=20 -> 0.55 | bw<4 -> 0.00 | else 0.55*bw/26); our V100 stage probes 2.8 GB/s -> 0.00. Forcing the policy awider slot would select changed nothing at K=11:
--pcie-frac 0.14-> 549.4,0.28-> 549.2,0.55-> 549.4 t/s.With a balanced K each stage's cache covers ~100 % of its own layers' profile, so almost nothing crosses the link
during prefill at all.
--layer-split 11 --split-device 0(both stages on the one fast card, sharingweights/session/cache) costs -0.3 % against that card alone (972.4 vs 975.0 t/s).
Reproducing
--layer-split Kwith"gpu": [main, second], conversation-cache args removed (parking + split is rejected), a32K-token cold prompt,
drop_cachesbefore each run, and the V100's SM clock sampled during the arm. The engine isotherwise pristine 0.1.35: a dual-arch build is needed for the sm_70 card, which we did by lowering the CMake
compute-capability floor to 70 (upstream's below-7.5 community build option, #236, is the same idea). Any pair whose
two cards differ in per-layer cost (a 24 GB + 8 GB mix, a card in a narrow slot, an older card) should show the same
divergence; happy to re-measure a suggested placement on this machine.
Related
prompts, and it was our first suspect for this. It is not this: our slow arm (K=11) and our fast arm (K=30) run the
same 0.1.35 and the same 512-cap-free code path, and the only difference is
K.combination, which is exactly where auto's coverage objective and real time diverge most.
with this placement question.
@meelonjisoo-commits commented on GitHub (Oct 2, 2026):
Follow-up measurements on the same machine (same engine 0.1.35 build, same method: cold prompt,
drop_cachesper arm, V100 SM clock sampled — median 1380/1380 MHz).The K curve is unimodal and K=30 is its peak (32K cold prefill, t/s):
Below the peak the second stage is the bottleneck, above it the first: at K=34 stage 0 owns 34 layers x ~0.69 s = 23.3 s predicted vs 22.7 s measured. Single card = 975.0 t/s.
The gap widens at depth (a ~120K-token prompt, the payload class this box actually reviews one-shot):
--layer-split 30+74 % at 120K (vs +61 % at 32K) — the single card's prefill rate falls slightly with depth while the split holds, so the placement effect is not a short-prompt artifact.
For completeness: a split still cannot hold a parked conversation (parking +
--layer-splitis rejected by design), so the aux-call re-read cost stays — 20.3 s at K=30 vs 0.40 s on one card. That makes the balanced split a batch shape for long one-shot reads, which is the case measured above.@Niko1221 commented on GitHub (Oct 2, 2026):
Thanks for the careful sweep. Auto chose K=11 on purpose: its cost model weighs the decode window, and in your own table K=11 decodes faster (62-106 vs 54-90 tok/s) while prefilling slower. It adds the stages' times (as one decode window does), it doesn't take the slowest stage (as a pipelined prompt does), and its per-layer speed comes from SMs x clock, which doesn't see the V100's architecture. For prompt-heavy work,
--layer-split 30(or"layer_split": "30"in the config) is the right choice. A prompt-weighted auto mode is noted for later. Closing.@MarsLuay commented on GitHub (Oct 13, 2026):
Follow-up measurement from a different platform that matches the heterogeneous case in this issue: Windows, RTX 3080 Ti 12 GB + Tesla V100-PCIE-32GB, experimental CUDA 12, Strata 0.1.40, Qwen3.8 Flash Next IQ3_S (48 layers, 131K context, INT8 KV, MTP).
Two cold streamed ~10K-token prompts per arm measured:
layer_split auto(auto selected K=18): 838.7 prompt tok/s, 69.1 decode tok/s, 12.1 s TTFT.--trim-stage-weights: 1495.3 prompt tok/s, 69.3 decode tok/s, 6.8 s TTFT.This confirms the issue's conclusion on Windows as well: auto was good for decode but manual placement was substantially better for prompt/interactive latency. The selected local configuration is K=28 with trimming and bounded conversation parking. Full table and methodology are in my related comment on #2052: https://github.com/Niko1221/Strata/issues/2052#issuecomment-6136129748