mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #340] Prefill regression on sm_86 (2x RTX A5000) in 0.1.30: ~-35% on ~2K-token prompts, not recovered by STRATA_PREFILL_STREAM_MIN / GDN_PIPELINE=0 / SCORES_MULTI=0 #162
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#162
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 @riverhh76 on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/340
Summary
Upgrading 0.1.28 → 0.1.30 regressed prefill throughput on 2× RTX A5000 (sm_86)
by ~35% on ~2K-token prompts, ~12% on ~16K, and ~2% on ~48K. Decode is unaffected
(long-gen 4096 tok: 71.5 → 71.6 tok/s; TTFT actually improved 1.3 s → 0.73 s).
All knobs I could find were tried; none recovers 0.1.28's small-prompt prefill.
Suspect a prefill-kernel regression specific to sm_86 + AVX-2 hosts (0.1.29's
"sampled answers up to 40% faster" / prompt-kernel changes measured on RTX 5070 / sm_120?).
Environment
bbaaabb= 0.1.28 vs30ec18e= 0.1.30)expert-cache auto, expert profile: shipped coder profile (3584 entries) and a
full-coverage 48x256 profile (12288 entries, regenerated via make_profile.py) —
both give the same numbers
Config (identical for both versions)
Measurements (non-stream,
timings.prompt_per_second, 3-run medians, salted prompts vs LCP cache)Decode cross-check (4096-token long-gen, stream): 0.1.28 = 71.0-71.5 tok/s,
0.1.30 = 70.6-77.8 tok/s — unchanged or better. TTFT on the same long generations:
0.1.28 = 1302-1378 ms, 0.1.30 = 601-730 ms. So this is prefill-only.
Things ruled out
--prefill 8192explicit (vs auto) — no changeSTRATA_PREFILL_STREAM_MIN=8192(restore pre-0.1.30 chunk floor) — no changeSTRATA_GDN_PIPELINE=0+STRATA_SCORES_MULTI=0(pre-0.1.29 kernels) —recovers ~16K slightly (1873), 2K still ~917
--vision+ strata-vision (GPU/CPU modes) and fullydisabled — no change
head VRAM reserve); regenerated a full-coverage profile → CUDA0 3584 + CUDA1
~8550 ≈ all 12288 (layer,expert) pairs resident, hit rate 99.8-100% — still slow.
Also tried
--vram-reserve-mib 350(crashes with a concurrent vision encoder).--ple-io ram— +3-4% prefill (kept), does not close the gap--pcie-frac 0.00 --spec-min-p 0.70(83.3 tok/s on the calibration prompts, same as 0.1.28's 83.1)
Guess
The 0.1.29/0.1.30 prompt-kernel changes (#187, #188, #207, GDN recurrence
pipelining
ac6aad4, QSA block-scores multia20f3b5, routed-only stagingcf0d12c) were measured on newer GPUs (5070 / sm_120 per the commit notes).On sm_86 + AVX-2 the new path seems slower for small chunks. Happy to run
A/Bs or provide traces (
--dump-routing,--stage-timing) if useful.Repro
Same model pack (Coder IQ1_M), flags above, measure
timings.prompt_per_secondnon-stream on ~1.8K-token prompts, 0.1.28 vs 0.1.30.
@Niko1221 commented on GitHub (Oct 1, 2026):
Thanks for the careful numbers. It isn't the streaming threshold (your STRATA_PREFILL_STREAM_MIN=8192 test shows that); the extra time is a fixed ~0.4-0.9 s per request, which fits the per-stage prompt loans 0.1.30 added for splits: each card lends cache slots and refills them one after another. We're reproducing it on a two-GPU box. Meanwhile, could you run 0.1.31 with
--no-prefill-borrow --prefill 2048(0.1.28's split behaviour) and post a log with STRATA_TRACE=1?@Niko1221 commented on GitHub (Oct 1, 2026):
Update: we reproduced it on a two-GPU box. Short prompts on a layer split lose ~24% on 0.1.30 and ~37% on 0.1.31 against 0.1.29 (16K prompts only 3-4%); one GPU is not affected. Causes: 0.1.30's per-card prompt loans (every request lends cache slots on each card and refills them afterwards) and, in 0.1.31, larger prompt buffers on a split. Correction to my earlier ask: please don't try
--no-prefill-borrowon 0.1.31 - on a split it can stop the engine at start (the draft head no longer fits). ASTRATA_TRACE=1log of one 2K request is still useful. The fix is in progress for 0.1.32.@Efs-O commented on GitHub (Oct 1, 2026):
On our box the fixed per-request prompt cost shows up on one GPU as well, and it is bigger there. That may be useful next to your two-GPU repro. Both runs are 0.1.30 prebuilt, STRATA_TRACE=1, and Qwen3.8-Flash-Next IQ3_S.
Box: i9-9900KF, 128 GB DDR4-3000 dual channel. 2x RTX 5060 Ti 16 GB (sm_120) on PCIe gen3 x8/x8, Windows 10. Run with
--expert-cache auto --prefill auto --spec 4 --kv int8 --kv-resident 32768and the default--short-read 64.Loans the engine reports at start
the prompt path borrows 2405 CUDA0 cache slots (4.56 GiB)Test: a 23.8K-token prefix, then appended tails like an agent loop (tool result plus next turn). These are
strata trace: read N tokenslines from the trace:A linear fit over the batched rows:
So a 130-token tool result costs 2-3 s before the first token, on every agent round.
My guess: the loan refill is bound by PCIe bandwidth. On gen3 x8, 4.56 GiB on one card takes longer than 3.87 GiB per card on two cards refilled in parallel. That would explain why your 1-GPU run looks unaffected on a faster link while ours does not. Prebuilt 0.1.30 has no
--no-prefill-borrow, so I couldn't A/B it. I'm happy to rerun on 0.1.32 or a test build.--short-readsweep on 2 GPUs (switches the path to windows):@Niko1221 commented on GitHub (Oct 1, 2026):
Fixed in 0.1.32: a layer split refills every card's prompt loan at once, uses a smaller streaming ring, and a card with free VRAM keeps its own prompt buffers - the same output as 0.1.31. On an R9700 + RX 9070 XT: 2K prompts 993 -> 1,270 tok/s, 16K 1,852 -> 1,980.
STRATA_SPLIT_OWN=1(opt-in) gives every card its own buffers (2K 1,470 there, slightly different output). Please reopen if your A5000 pair doesn't get back to 0.1.28's speed.@Efs-O commented on GitHub (Oct 2, 2026):
Retested on 0.1.34 (prebuilt, same box: i9-9900KF, 128 GB DDR4-3200, 2x RTX 5060 Ti 16 GB on PCIe gen3 x8/x8, IQ3_S, layer split auto). The short-tail cost on a layer split is unchanged from 0.1.30 on our gen3 link, and the prompt loans don't seem to be the cause here.
Same replay as before: a ~20.9K-token prefix, then appended tails like an agent loop. Time to first token from the server's
prompt_ms:STRATA_SPLIT_OWN=1STRATA_SPLIT_OWN=1the log saysthe prompt path allocates its own buffers (too few cache slots to borrow), so nothing is borrowed. The tails cost the same, and a cold 20.9K prompt takes 38 s instead of 19 s.So on gen3 x8 the ~1.5 s fixed cost per batched read is still there with no loan to refill. My guess now is the per-run expert streaming over the slower link rather than the loan refill. Decode is fine: 60 tok/s short, 53 tok/s at 21K. I'm happy to run a
STRATA_TRACE=1log or a test build if that helps.@riverhh76 commented on GitHub (Oct 3, 2026):
Two follow-ups on a closed issue, since the thread will outlive us.
1. A correction to my Environment section. I wrote "Host CPU: no AVX-512
(AVX-2 only)". That was wrong: the CPU is an Intel Xeon Silver 4210R (Cascade
Lake) and it does have AVX-512 —
avx512f, avx512dq, avx512cd, avx512bw, avx512vl, avx512_vnni(no ifma/vbmi/bf16/amx), 10 cores / 20 threads.None of the reported numbers change, and your diagnosis (0.1.30's per-card
prompt loans, GPU side, single card unaffected) had already ruled the host CPU
out. It matters for two later readers though:
sm_86 kernel, and not an AVX-2 host;
AVX-2-only hosts (e.g. #616's
STRATA_IQ256_GATHER, +1.0% e2e on ani7-12850HX) are not comparable here — we would be on the
STRATA_IQ_GATHERside of that line.
2. Confirmation on the same host, so the fix is on record. 0.1.33 and 0.1.38,
same Coder IQ1_M pack, same
--layer-split auto, 2x RTX A5000, driver 595.80,CUDA 13.0:
STRATA_SPLIT_OWN=1A/B here: prefill +6.6% but decode -8% and concurrency -16%— net negative, so we stay on the default. Accuracy unchanged after the upgrades
(HumanEval+ 92.1% pass@1, AIME 70.0%, BFCL-style tool calls 19/19).
So the "please reopen if your A5000 pair doesn't get back to 0.1.28's speed"
condition from your 0.1.32 fix note is not triggered: 2K prefill is back at the
0.1.28 tier. Closed is right.