mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2310] [Feature]: --kv-grow with --prefill auto: let the prompt path's loan shrink as the K/V grows (auto stops a 262K config at ~115K on a 12 GB card) #933
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#933
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 @JawadN00r on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2310
Goal: with
--kv-grow, get both--prefill auto's fast prompts while a conversation is short and the full--max-contextwhen it gets long, without choosing one at startup.What happens today.
--prefill autosizes the prompt path's loan once at startup (the largest chunk up to 8192whose buffers fit in ≤85% of the expert cache;
plan_lendingenerate.cpp), and--kv-growgrows the K/V only intothe slots below that loan (
kvg_start(lend_first)). Neither looks at--max-context. On a 12 GB card the loan is solarge that the K/V cannot reach the configured context:
The client (an agent harness, told the model has 262,144 tokens) then gets an error at ~100-115K and the task is lost.
Nothing at startup says that this loan and
--max-context 262144cannot both be served.Setup: v0.1.43.1 (
a0116b2), Linux, RTX 3060 12 GB (driver 595.58.03, CUDA 13.0 build), Ryzen 7 5700X,62 GiB DDR4-3200; UkisAI Swift 1.5 Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS (3258 cache slots),
--expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp mtp/rt --max-context 262144 --kv int8 --kv-grow --prompt-cache 2 --vram-reserve-mib 512.Measured (same model and flags, only the prompt chunk changed):
auto(8192)409630722048auto+STRATA_PREFILL_LEND_PCT=33(picks 2816, 227-slot ring)auto+STRATA_PREFILL_LEND_PCT=38(picks 3584, 227-slot ring)(One 256-token answer per long prompt: decode at 251K was 42.8-61.5 tok/s across the arms, so the K/V taking slots
from the cache costs little at this length.)
Workaround today: a fixed
--prefill 2048. It reaches the full 262K, but every prompt is read 17-19% slower at7K-18.5K tokens than with
auto, also in the short conversations that never need the room.STRATA_PREFILL_LEND_PCTworks as a cap, but the smaller ring it picks makes prompts slower still (744-838 tok/s), and it is not documented.
What would help (any of these, in order of value):
kvg_ensurereaches the cache floor below the loan,re-plan the prompt path one step smaller (8192 → 4096 → 2048 ...; the
relendpath used under--vram-elasticlooks like the place) and hand the freed slots to the K/V; step back up when a short request trims the K/V. Short
conversations keep 8192-token chunks; a long one pays the smaller chunk only while it is long.
autoaware of--kv-growand--max-context: pick the largest chunk whose loan still leaves the K/V room for--max-contextcells (here: ≤ ~1300 of 3258 slots), or accept--prefill auto:max-contextto ask for that.--max-context 262144 cells; --prefill 2048 reaches it", like the existing VRAM-reserve warning.
Happy to test a branch on this card.
@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.