llama.cpp MoE expert LRU cache boosts RTX 5090 local inference 2.2x to 68 tok/s

abhishekkumar333 · reddit · 2026-10-22

llama.cpp PR #29887 (merged Oct 7, ported from Tether's qvac-fabric) adds an LRU cache of MoE experts in VRAM — possibly the most impactful local-inference change this year.

Why it works: expert routing has locality of reference — consecutive tokens mostly pick the same hot experts. On a hit, zero bytes move; on a miss, one 2.6 MiB expert is copied over PCIe and the LRU victim is evicted. For Qwen3.8-Flash-Next (125B total, 6B active), each token touches 1.3 GB of expert weights.

Benchmarks (same model, same machine): RTX 4090 24GB goes 25.0 → 40.7 tok/s (1.62x, 77% hit rate); RTX 5090 32GB goes 30.8 → 67.8 tok/s (2.20x, 89%); AMD R9700 32GB gains 2.5x at 94.6% hit rate.

Usage: llama-server ... -cmoe --moe-cache-mib 11000; rule of thumb is 10% of expert bytes. SGLang landed the same idea 12 days later as "paged experts" (PR #42557). The write-up includes a memory-math script and a runnable expert-cache simulator.

Original post →

More from Infra

Infra channel →