mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #448] Layer split with a small second GPU caps prompt chunk at 512: 6.2x slower prompt reads, same decode #209
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#209
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 @DaRealDaHoodie on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/448
Environment
Engine 0.1.31, repo HEAD
9259cad(2026-10-01). Measured 2026-10-01 on:qwen3.8-flash-next-ud-q4_k_xl(Unsloth UD-Q4_K_XL split GGUF, 71.73 GiB routed expertsloaded into the RAM arena),
--max-context 262144 --kv int8 --spec 4 --mtp --expert-cache autoa small second GPU in a layer split collapses
prompt chunk autoto 512 tokens (~6x slower prompt reads)Symptom. Same model, same weights, same flags; the only difference is whether the 3080 takes a
slice of the layer split:
prompt chunk auto--layer-split auto)Decode is unchanged (±1 %). Prompt reads differ by 6.2x. On an agent workload — long prefixes,
modest generation, most requests re-reading 100-200K tokens — the pair arm is much worse overall,
so the small card's residency gain is not merely neutral, it hides a large prompt regression.
Cause.
src/program/generate.cpp:3663-3682: the chunk is the largest candidate everyparticipant can fund, and a participant is each stage's own expert cache:
CUDA1's 512-slot cache must keep the 128-slot floor, so it can fund at most ~384 slots of prompt
staging — the binding constraint for every candidate above 512 tokens. CUDA0's 8,566 slots never
get a say. The comment above
fits()states the assumption this exposes:which is right for comparable cards and wrong when a participant is a small helper card.
Worth stating precisely, because it is easy to misdiagnose: an explicit
--prefillis notsaved by the percentage cap (
fits(c, false)— the auto scan alone applieskAutoLendPct, 85 % or90 % depending on
Prefill::pinned_share()).--prefill 4096on the pair arm halves down to 512through the same slot floor and says so:
So there is currently no operator setting that keeps a large chunk while the small card is in the
split — the only lever is taking it out of the split, which is a bigger change than tuning.
Suggested fixes, roughly in order of how little they disturb the current behaviour:
demanding that the smallest cache fund the whole chunk — the large stage can carry most of the
staging.
unable to lend, letting it stream during the prompt instead of capping everyone.
prompt chunk auto: 512 tokens (CUDA1's 512-slot expert cache cannot fund more), so a 6x prompt regression is traceable in onelog line instead of needing an A/B against a single-card arm.
docs/SECOND_GPU.mdanddocs/DETAILS.mddescribe split residency and prompt lending separately; neither notes that thetwo interact through this floor.
Not a bug, for the record:
--expert-cache-device1on that same small card is the good use ofit — one stage plus a 1,800-slot tier left
prompt chunk auto: 8192intact and raised decode from84.8 to 91.1 tok/s at 167K context (hit rate 69.6 % -> 73.6 %). The tier's own cost is the
per-request synchronisation the docs warn about (
host 74 ms staging+launching, 124 ms waiting for it), and it grows with size. 1,800 vs 2,600 slots, requests of similar size:Residency rose 4.4 points and decode did not (87.7 tok/s at 182K context vs 91.1 at 167K — the
contexts differ, so the wait column is the trustworthy comparison, and it moved 2.4x on 1.5x the
launches). Later, larger requests on the 2,600 tier waited 416-597 ms. The tier has a sweet spot
well below "as much as fits", which is worth a sentence in
docs/SECOND_GPU.md.@Niko1221 commented on GitHub (Oct 2, 2026):
Thanks for the measurements. In 0.1.35: the engine's log names the card that caps the prompt chunk (its cache slots, and what the chunk would need). Setup, for a pair whose second card has under 12 GB, still offers the split but recommends the big card alone and explains why: the small card is better used as
--expert-cache-device1(docs/SECOND_GPU.md), as your numbers show. Leaving such a card out of an auto split by itself would need the engine to unload a stage it has already set up, so that part is not automatic yet. Closing. Reopen if the recommendation doesn't fit your case.