Qwen 27B at Full 262k Context on a 16GB RX 9070 XT: 80+ t/s Decode With Adaptive KV Streaming
bottlestreet3d · reddit · 2026-10-17
The author implements adaptive KV streaming plus RDNA 4/ROCm kernel optimizations in llama.cpp, running Qwen 27B (IQ4XS weights, Q8/Q4 KV cache) with its full 262,144-token context on a single 16GB RX 9070 XT at 80+ t/s decode with MTP.
Problem: the model needs 14.3GB and 262k context requires 7.4GB of KV cache, causing OOM past 65k tokens on 16GB.
Approach:
- Ported CUDA adaptive KV streaming to ROCm/HIP: full KV cache stays in host RAM (7.4GB), bounded working sets (450MiB prefill, 2,100MiB decode) stream over PCIe SDMA overlapping compute
- Incorporated community kernel optimizations (multi-column mmvq, vectorized loads, SwiGLU fusion, async HIP graphs)
- Added sibling activation reuse, in-register fused residual+RMSNorm, online Log-Sum-Exp chunked prefill with pipelined prefetch, persistent graph arenas, and optimized speculative decoding
Results: decode 36.5→9.5 t/s (1k→262k), 71.8–86.5 t/s with MTP at short contexts; prefill 1368→586 t/s. A 231W power limit costs only 3.6% prefill latency. Code is open source.
More from Infra
- Running torch nightly with CUDA 13.5 on 8x V100 via volta-forever, agent-driven setup — QuixiAI · 2026-12-02
- DeepSeek's Claimed 83.4% Ascend 950DT Margin Debunked: Losing ¥36.6/Hour at 60% Utilization — teortaxesTex · 2026-12-02
- One number = +27%: raising MLX's 20-op CUDA graph cap on DGX Spark boosts Qwen3 to 430 tok/s — AIFlow_ML · 2026-12-02
- Polymarket: Jensen Huang admits under oath Nvidia AI chips were diverted to China — Polymarket · 2026-12-02
- China pours billions into optical chips for AI data centers despite US curbs threat — pstAsiatech · 2026-12-02
- 2.5-bit quantization runs a 35B MoE with 1M context in ~13.4 GiB on a 16GB MacBook — MatMuloi9128 · 2026-12-02