KVarN Reduces VRAM for 27B Long Context
logickkk1 · hn · 2026-07-15
This post shares benchmark results from porting the KVarN structured KV cache quantization to the Bonsai runtime, aiming to reduce VRAM usage and boost generation speed for long contexts.
Core Findings
- On Bonsai-27B Q10, 120K context, RX 9070 XT:
- q80 cache: 43.4 tok/s, total VRAM 13.1GB
- kvarn4 cache: 73.0 tok/s, total VRAM 9.8GB
- Compared to the original method, the author reports a +68% speed boost and 3.3GB VRAM saved.
Method
- KVarN is based on concepts from KIVI and QuIP#.
- It applies quantization after Walsh-Hadamard transform and Sinkhorn variance equalization to mitigate quality loss from low-bit KV caches.
Practical Observations
- The author believes this approach is more valuable for scenarios requiring long context retention.
- They compared it to TurboQuant, noting that while the latter is faster, it carries a higher quality risk.
- They also mention this modification 100% breaks DFlash, but it doesn't impact their use case.
Reproduction Info
- The author ported the solution to the Bonsai runtime, modifying about 23 files / 1300 lines.
- Recommended for trying dense model long-context inference in Bonsai or similar setups: --cache-type-k kvarn4 --cache-type-v kvarn4.
More from Infra
- RTK Terminal Compression Cuts Tokens but Leaves Your AI Coding Bill Unchanged — Bartaseth · 2026-09-11
- SF Compute founder: buying compute is 'an absolutely awful experience' right now — IgorCarron · 2026-09-11
- SmolVM open-sources persistent computer infrastructure for agents that outlive chat sessions — aniketmaurya · 2026-09-11
- PyTorch Day Korea 2026 launches first offline conf, CFP closes Sept 13 — PyTorch · 2026-09-11
- Local LLM server dilemma: 4x CMP-170HX (price up 53% in 20 days) vs Mac Studio M5 Ultra — rumboll · 2026-09-11
- llama.cpp lands Flash Attention tuning for RDNA4, big prefill gains on AMD — pmttyji · 2026-09-11