You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -280,6 +284,18 @@ When compression is on, the request path picks one of three modes automatically,
280
284
|`--kv-cache-dir <path>`| — | Persist prefix cache to disk |
281
285
|`--kv-cache-budget N`| — | On-disk cache size cap |
282
286
287
+
**Bounded KV residency (KVFlash)**
288
+
289
+
Pages the attention KV cache through a fixed pool of GPU slots; cold 64-token chunks live in host RAM, bit-exact and recallable. Decode speed stops depending on context length and resident KV stays pool-sized at any context. Off by default; works on every model family. Drafter-scored residency is the default on every family: the server finds the Qwen3-0.6B drafter next to the model (or via `--prefill-drafter`) and lazy-loads it as the relevance scorer that decides which chunks stay resident — non-qwen targets (laguna, gemma4) bridge the tokenizer gap by re-tokenizing the context text for the drafter. LRU is the fallback when no drafter is present, or the explicit choice via `--kvflash-policy lru`. Per-model numbers in [Luce KVFlash →](optimizations/kvflash/README.md).
290
+
291
+
| Flag / env | Default | Effect |
292
+
|---|---|---|
293
+
|`--kvflash <tokens\|auto>`| off | Resident pool size. `auto` sizes from the GPU: half of free VRAM after weights and reserves, at the model's KV density, capped where decode speed stays near the flat optimum (default 16384, override `DFLASH_KVFLASH_MAX_POOL`) and at `--max-ctx`. Explicit values are rounded to 256, clamped to `--max-ctx`, floored at the protected minimum so eviction always has a victim. |
294
+
|`--kvflash-policy {drafter,lru}`|`drafter`| Residency policy. `lru` opts out of the drafter probe/load (recency-only paging, no extra VRAM). |
295
+
|`--kvflash-tau N`|`64`| Reselect interval floor (drafter policy only); the effective interval grows with history to cap rescore overhead. |
296
+
|`DFLASH_KVFLASH=N`| off | Env equivalent of `--kvflash`. |
297
+
|`DFLASH_KVFLASH_TAU=N`|`64`| Env equivalent of `--kvflash-tau`. |
0 commit comments