Offloading KV cache to host RAM via QSA: ~1M context on one RTX 3090 at ~5% speed cost
TheActualStudy · reddit · 2026-12-06
Using Qwen4-35B-A3B's trained sparse attention (QSA), the author offloads the full KV cache to pinned host RAM in their Rust engine inference.rs: each query attends only to the top 512 four-token blocks chosen by a compact in-VRAM indexer, so 98% of reads hit VRAM and outputs stay bit-identical. On one RTX 3090 (24GB, 128GB RAM, 4.5-bit GGUF, q8 KV): max context jumps from 192K to 1,048,576 tokens, decode drops only 3-4% (115 tok/s at 32K), 262K prompts prefill in 272s then decode at 86 tok/s, and even a 983K-token prompt runs.
More from Infra
- Author: chip bans make China supply-chain independence inevitable and set up an AI-driven recession — Dan_Jeffries1 · 2026-12-06
- TensorSharp benchmarks Qwen4-35B-A3B on Blackwell against llama.cpp, vLLM and SGLang — fuzhongkai · 2026-12-06
- David Sacks: Biden's commerce secretary said Nvidia 'should' sell deprecated chips to China — AlexTensor · 2026-12-06
- Qwen4-35B-A3B sweep on one H200: vLLM 32% faster at 1 request, SGLang wins TTFT at low load — woosuk_k · 2026-12-06
- TensorSharp hits ~870 tok/s at 16 concurrent requests on Qwen4-35B, beating llama.cpp 2x — fuzhongkai · 2026-12-06
- Qwen4-35B-A3B hits 100 tok/s on a single Tesla V100 with MTP, but instruction following disappoints — nebod99 · 2026-12-06