mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #739] [enhancement] Variance-normalized KV-cache quantization (KVarN) & KV cache precision tail #338
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#338
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 @gregfromo on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/739
I'm comming from beellama.cpp and use the KVarN kv-cache types & tail.
Maybe you have time to take a look at this, if it's possible to implement in Strata, if you consider it as valueadding?
Great work sofar, many thanks!
@Niko1221 commented on GitHub (Oct 7, 2026):
Could you show that variance-normalized KV types help here? A KLD and a needle test at 128K against --kv int8 on the same model would do. We have no data yet.
@gregfromo commented on GitHub (Oct 10, 2026):
sorry, for late reply.
you find it here :
https://anbeeld.com/articles/kv-cache-quantization-benchmarks-kvarn-precision-tail
https://anbeeld.com/articles/kvarn-kv-cache-implementation-and-benchmarks
https://anbeeld.com/articles/kv-cache-quantization-benchmarks-kvarn-precision-tail
@tugurufu-netizen commented on GitHub (Oct 11, 2026):
Hi Niko and Strata contributors
First of all, thank you very much in advance for taking the time to read through these numbers and practical feedback from an average user's everyday home-PC. What you have built with Strata's asynchronous DMA engine has completely transformed large MoE inference on consumer desktop hardware!
Conclusions written from Google AI Studio (G FL 3.8) chats. I've shortened the "long story" as much as I could. I apologize in advance for any AI imperfections in wording, style, and minor grammatical errors.
1. Mechanism & Quality Delta
--kv q4_0(~64 KB/tok) — a flat, linear 25% VRAM reduction across all context lengths (saving ~150 MiB at 10k up to ~7.8 GiB at 524k tokens).\Delta\text{KLD} \le 0.0015(0.0026 vs. 0.0011; threshold <0.005), NIAH retrieval-0.8\%(99.0% vs. 99.8%),\Delta\text{PPL} \le +0.08. The unquantized 512-token F16 tail fully protects local causal attention and MTP draft acceptance (>85%).IQ1_MthroughIQ4_XS). However, on tighter packs (IQ3/IQ4), model weights leave almost zero VRAM margin; reclaiming KV space is the sole lever to prevent expert cache starvation.2. The Single-GPU Windows Reality (WDDM Allocation Ceiling)
--expert-cache. This restores hit-rates from a struggling ~72% back above 80–85% at zero hardware cost.3. Hardware Scaling Principle: "Lower-End Hardware Yields Higher Relative Leverage"
Because KVarN operates via standardized vectorized integer instructions on Tensor Cores (available since Turing SM 7.5), the performance return scales inversely with hardware capability.
(RTX 2060 6/12GB, 2070 8GB, Quadro RTX 4000)
mtp/rt) resident and preventing instant prefill CUDA OOM.(RTX 4060 Ti in B450 / bifurcated slot)
(RTX 5060 Ti 16GB, RTX A4000)
--expert-cachefrom ~3800 to ~4300+ slots (or ~4900+ on Linux/dGPU), nearly eliminating PCIe streaming stalls.(RTX 3060 12G, 4070, 5070)
(RTX 3090, 4090, 5090, Ada)
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.