mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2650] Long-session decode drift on WSL2 + RTX 3090 24 GB at 262K: 59.3 → 80.0 tok/s in the last third; --kv-grow + reserve 1216 cuts the drift from −29% to −4.5% #1056
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#1056
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 @david-zdw on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2650
Strata version, GPU, OS: engine 0.1.44.1, source build (CUDA 13.4,
sm_86) · RTX 3090 24 GB · WSL2 Ubuntu 26.04 on Windows, host 128 GB RAM,.wslconfigmemory=96GB swap=0· AMD Threadripper PRO 3975WX (AVX2, no AVX-512)Model: Qwen3.8-Flash-Next GSQ-RCO IQ3_S,
--max-context 262144 --kv int8 --expert-profile --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp … --vision --vram-reserve-mib 700, plus the experimental speed projection on (identical in both arms). One slot, no--batch.This is the long-soak arm
docs/TEST_REQUESTS.mdasks for ("an hour or more of back-to-back requests … shows drift"), and it found drift.What happened
One engine start at 17:30, back-to-back agent traffic (multi-turn tool use, contexts 10K–80K), 124 requests with the engine's own per-request
decode_tok_s,hit_rateand draft counts. Splitting that run into thirds by request order:Whole run: mean 73.4, median 76.3, p10 55.5, min 40.5.
The control that matters: hit rate stayed flat (83.4% → 84.1% → 83.1%) while decode fell 29%, and the last third ran at a shorter mean context than the first. So this is not content, not cache warming, and not context length.
It is not clocks either: at load the card sat at 1890 MHz / 69–70 °C / 210–287 W against a 350 W limit, and
SW Thermal Slowdown,HW Thermal Slowdown,HW Power BrakeandSW Power Capwere allNot Activeinnvidia-smi -q -d PERFORMANCE.The tell is the engine's own line, which escalated across the first six requests:
The sizer had priced the whole 262K K/V up front:
expert cache auto: 13.85 GiB free, 700 MiB reserved … -> 5224 slots, then after shrinkingexpert cache 6180 slots, 11.73 GiB of VRAM, leaving 274 MiB on the card before any request ran.The change, and what it did
Two flags only, everything else byte-identical, second engine start at 21:39:
At start:
elastic K/V: 16384 of 262144 cells in VRAM (0.25 of 3.35 GiB); the expert cache (7411 slots) gives the K/V room below slot 5222 as the context grows.Both arms below are the whole session — all 124 requests before, all 54 after, no windowing:
vram_free_mibat loadWhole run, and the same split:
The drift is much smaller, but it is not gone. The before-run lost 29% from its first third to its last; the after-run loses 4.5%, and its last third runs at a 2.5× longer mean context (112,170 vs 44,520) than its first — where the before-run's last third was at a shorter context. So the change bought a large level improvement and a much flatter shape, not a flat line.
Note the control now cuts the other way: hit rate and draft acceptance are lower after the change (83.6%→82.6%, 77.4%→73.3%) in exchange for +13% decode and +44% mean context. Fewer expert hits and fewer accepted drafts, still faster — so the gain is not an easier traffic mix.
What
--kv-growcosts, measuredDuring the steady climb the K/V takes ~52–57 slots per 8,192-cell step (
K/V grown to 81920 cells (1.07 GiB); the expert cache gave 56 slots for it … 6919 of 7411 slots hold experts), and it gives them back when a session ends (K/V grown to 16384 cellsagain). It is not uniform, though: the first climb through a region is far more expensive than the second. Growing to 65,536 cells cost 326 slots the first time and 56 the second, and 122,880 cells cost 218 slots in a single move — so the cache re-learns which experts it can afford as the window moves. The cache also compacts as it goes (7355 of 7411 slots hold expertsafter a give-back). The cost is a slope, not a cliff:At 70–90K the
#2065warning fires again (only 414 MiB free,only 136 MiB free) even with the 1216 MiB reserve, and decode settles at 78.1 above 90K — which is the same region the last third of the table above is measuring.Questions
--expert-cache autoprice the--max-contextreservation differently on a card this full? Setup wrote 262,144 with the whole-K/V default on a 24 GB card and left 274 MiB free at load.--kv-grow's preconditions (one GPU, expert profile, no KV streaming, all experts in RAM) were all already true here — would it be worth defaulting it on, or having setup pick it, when they hold and the whole-K/V sizing lands under ~1 GiB free?--kv-residentis not usable (the WSL NVIDIA driver pins ~1 GB, asdocs/DETAILS.mdnotes), so--kv-growis the only path on WSL2 + 24 GB + a long context. Worth a line in the WSL notes, and maybe a setup warning for that combination?Limits, stated plainly
BENCH.bat: no fresh-prompt sweep, no needle recall, no quality check, no concurrency. Nothing about correctness is claimed.--visionwas on in both — I did not test the vision-on-CPU change from #2406, which looks relevant on a card this full.Reproducing
Numbers come from the engine's own lines (
prompt … generated in … tok/s, drafts accepted …,hit rate: …,K/V grown to …) andGET /metrics, never from dividing tokens by wall time. The parsing script is two regexes overstrata-<model>.log, split atengine started; happy to add it as atools/script or abench/results/folder if that is the right shape.@david-zdw commented on GitHub (Oct 15, 2026):
strata-iq3_s.log
@MrKop-git commented on GitHub (Oct 16, 2026):
A different-workload datapoint so the reports do not get conflated: on a GTX 1080 Ti 11 GB (
--kv int8 --kv-resident 32768), with fresh prompts of 32K/128K/250K tokens (no growing session),--kv-growwas negative at every depth (prompt −2 to −4.5%, 250K decode 24.2 vs 29.5). Your −29%→−4.5% win is decode drift inside one long growing session, which these runs do not exercise — we did not find a cost or a benefit for kv-grow outside it. Also measured: KV streaming at 128K served 88.27% of 431,340 block reads from VRAM (203.9 MiB from RAM), and needles FOUND at 124,782 and 251,546 tokens. Data: #2737.@Adamyno commented on GitHub (Oct 17, 2026):
Native Linux, 2× RTX 2080 Ti, Q4_K_XL: no drift over a 60-minute soak
Counter-example to the WSL2 + 3090 drift: a one-hour soak on native Linux did not degrade.
Hardware: 2× RTX 2080 Ti 22 GB (sm_75, power limits 210/167 W), i9-7980XE, 125.5 GiB DDR4-3600, Linux 7.0.0-38, CUDA 13.0, driver 580.178.04; layer split 15. Flash-Next UD-Q4_K_XL (pack
ud-q4_k_xl), 262,144 ctx,--kv int8 --spec 3 --spec-min-p 0.54 --batch 2,STRATA_SM75_PERF=1, no--kv-grow.One engine start, 505 back-to-back requests over 60 minutes (short chats, ~1.6K-token prompts, a ~12.6K-token prompt every seventh request), 128 new tokens each:
0 errors, 0 restarts, overall median 41.3 tok/s; max GPU temperatures 43 °C / 49 °C. No drift: the last bucket is slightly faster than the first (expert cache warm-up).
So the last-third drop is not universal. WSL2's memory management and the IQ3_S pack (ours is Q4_K_XL) are the remaining candidates on your side; a native-Linux run or a Q4_K_XL pack would separate them.
@david-zdw commented on GitHub (Oct 18, 2026):
Thanks both — two different workloads, so let me keep them apart.
@MrKop-git — agreed, and it does not contradict this report. Fresh 32K/128K/250K prompts with no growing session exercise prefill, not the decode drift inside one long session. Thanks for keeping it in #2737 so the two do not get conflated.
@Adamyno — that is a real counter-example and worth having: 505 requests over 60 minutes on native Linux, no drift. But I do not think it isolates WSL2 yet, because the workload shapes differ in more than one way. Yours is ~1.6K prompts with a 12.6K one every seventh request and 128 new tokens each; mine ran contexts up to 122K/137K with long generations, one slot, no
--batch(you are at--batch 2, which may matter by itself).The part I can check in my own log argues against context length being the driver. In the before run's last third the degradation is there at a shorter context than the first third:
reused=0(cold prefill)reused>0(warm requests)So it is not cold prefill and not long context: 40 of the 42 requests are warm, at a mean of 37,294 tokens — shorter than the first third's 47,461 — and warm requests there still ran at 59.5 against 86.0 in the first third.
The same log gives a second datapoint against a length explanation: the after arm carried a longer mean context than the before arm (73,102 vs 50,791) and was still faster overall (82.8 vs 73.4), so context growth alone is not what produced the degradation.
On WSL2 vs the pack: I cannot separate those two from these logs, so I am not claiming one. The clean control is your own rig — the same box booted natively with everything else byte-identical (same pack, same slot count, same prompt profile), which would leave WSL2 as the only variable. The Q4_K_XL swap on the same rig would be the other half. Either would settle it; I would rather leave that to someone with the hardware than guess.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@Adamyno commented on GitHub (Oct 19, 2026):
Native Linux control: one slot, no
--batch, 11.6K → 110.6K context, 768-token answers — no driftFollowing the ask in your reply: the same workload shape on native Linux, so that WSL2 and the workload are separated.
Setup: 2× RTX 2080 Ti 22 GB (210/167 W), i9-7980XE, 125.5 GiB DDR4-3600, Linux 7.0.0-38, CUDA 13.0, v0.2.0-beta (
3d1fb480). Qwen3.8-Flash-Next GSQ-RCO IQ3_S,--layer-split 15, 262,144 ctx,--kv int8 --kv-resident 32768,--spec 3 --spec-min-p 0.54 --mtp mtp/rt,--batch 1(one slot, your shape), greedy, no--pipeline-windows.Workload: one conversation, nine turns; each turn appends ~12.4K tokens of file text and asks for a long answer (768 new tokens, greedy). Context and reuse are from the engine's own log; decode is the engine's
predicted_per_second.Thirds: 62.6 / 70.8 / 69.4 tok/s (first / middle / last). The rise is the expert cache warming; from the middle third to 110K the decode is flat. Nothing degrades, and no restart or error over the nine turns.
Prefill of each new chunk does fall with context, as expected: 977 → 711 tok/s for the ~12K new tokens per turn.
What this says, and what it does not: the workload shape alone (one slot, no
--batch, long answers, context past 100K) does not reproduce the drift on native Linux. So WSL2 (or something in your pack) stays the difference to chase — which is the same conclusion you had, now with a native run on the same shape rather than a different one.Limits: this reached 110.6K, not your 122–137K; the last two turns ended on the model's own EOS after 308 and 201 tokens, so their decode is over a shorter window (they still read 69.4 and 71.5 tok/s). One pack, one model, one box; a single run per turn, not medians of several sessions.