mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4815] [Engine] --kv-resident N is 13-20% slower than --kv-grow at a 44-token context #2209
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#2209
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 @baiqvesse on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4815
Engine: 0.1.54 (commit
8c1aea4b,strata-engine-0.1.54-windows-x86_64-cuda-cuda13)Model: Qwen3.8-Flash-Next, GSQ-RCO IQ3_S (2 shards),
--mtp,--vision(CPU)PC: Windows 11, RTX 5080 16 GB (sm_120, driver 617.42), Ryzen 9 9950X, 61.6 GB RAM, one card
Two configs that differ in exactly one flag:
--kv-growversus--kv-resident 32768Everything else identical:
--kv k8v4 --max-context 524288 --rope-scaling linear --rope-scale 2 --vram-reserve-mib 1600 --prefill 8192 --spec 4 --spec-min-p 0.5 --adapt-every 1 --adapt-swaps 160 --adapt-decay 0.97 --expert-cache auto,env STRATA_PF_FUSED=1 STRATA_PREFILL_CPU_SHARE=auto.What the docs say
strata.exe --help,--kv-resident N:So with a 44-token prompt and
--kv-resident 32768, the streaming path should not be active at all,and the two configs should measure the same.
What I measure
4 arms, mirrored (elastic → stream → stream → elastic), a fresh engine per arm, 30 s between arms,
five distinct cold 400-token prompts per arm (no prompt is repeated inside an engine) plus one
60K-token cold read. Decode tok/s is the engine's own
400 generated in ... (X tok/s)line.GPU: 52–59 °C, 2872 MHz, no throttle reason active, in every arm.
--kv-grow--kv-resident 32768--kv-resident 32768--kv-grow(85–93 tok/s for
--kv-resident 32768, 110–127 for--kv-grow), so this is not a one-offThe prefill is slower too (−17%), which suggests the difference is not only in the decode loop.
--kv-residentitself is not the problem I'm reportingI scanned it to make sure the value was not simply badly chosen (same workload, same mirrored design):
--kv-resident20480–32768 is flat (the K/V takes 0.21–0.33 GiB); 65536 costs 160 slots and 3.7%. So 32768 is the
right value; the gap to
--kv-growis not a question of tuning N.Why I need streaming at all
With
--kv-grow, a 350K–400K-token session makes the K/V grow past the cache's borrowing room andthe engine then allocates new VRAM for it ("…gave 0 slots for it … and new VRAM"), which eats the
1600 MiB reserve. I hit 15.5 / 16.0 GB with 90 MiB free and a request failed.
--kv-resident 32768keeps the VRAM flat (14.2 GiB used, 1.4 GiB free) and the K/V block reads still hit VRAM 97.5–99.96%
of the time, so streaming works — it is just consistently slower, at every context length.
Questions
looks like a bug (or an undocumented cost of the mode).
cost is significant for anyone who needs the long-context safety.
Happy to run more measurements on this PC (RTX 5080 / sm_120 / Windows) if a specific check helps.
Raw data: the two CSVs are reproducible with the same two configs; I can paste the engines' log lines
for every arm on request.
@github-actions[bot] commented on GitHub (Oct 31, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Nov 3, 2026):
Thanks, this follows the format now.