Physically Partitioned KVCache Format for CPU--GPU Load Balancing in MoE Inference
Organizations: National University of Defense Technology China
Abstract
Single-GPU long-context inference with Mixture-of-Experts (MoE) models requires spilling the key-value cache (KVCache) to CPU memory. The spilled KV serves two complementary purposes---transferring to the GPU for attention computation, or computing in-place on the CPU---which demand opposing physical states. The optimal split between them varies with workload, yet existing KVCache abstractions offer only storage semantics over a monolithic object of a single physical state, and cannot express dynamic load balancing. We propose InplaceKVCache, the first KVCache abstraction whose format fixes each byte's physical residency at write time, so that the CPU--GPU load balance can be adjusted without moving data after placement. It realizes this as a four-region layout along two dimensions---device affinity and access pattern---turning load balancing into pure scheduling. Built on this abstraction, WriteScope splits CPU--GPU shares along the sequence dimension, and a portable roofline performance model determines the optimal CPU share as sequence length evolves, with online feedback tracking CPU cost drift. On three MoE models (DeepSeek-V2-Lite, Qwen3-30B-A3B, Mixtral-87B) with a 32~GB VRAM budget, WriteScope supports end-to-end inference at the 1M-token aggregate scale. In the long-context regime (8K), it achieves geometric-mean speedups of -- on A100 and -- on V100 over four reproduced baselines, while vLLM, SGLang, and KTransformers fail even with a doubled KV budget. A DeepSeek-V4-Flash case study validates composition with native sparse attention.
Figures & tables
| Model | Weights | KV | CUDA | Temp | Total |
| DeepSeek-V2-Lite | 31.4 | 4.1 | 2.4 | 1.2 | 39.1 |
| Qwen3-30B-A3B | 61.1 | 12.9 | 2.4 | 1.8 | 78.2 |
| Mixtral-8 7B | 93.4 | 17.2 | 2.4 | 1.7 | 114.7 |
| Model | Ping-pong | D-window | Unpinned | Pinned |
| DS2 | 37.8 MB | 255 MB | 15.95 GB | 16.66 GB |
| Qwen3 | 67.1 MB | 805 MB | 61.95 GB | 41.13 GB |
| Mixtral | 134.2 MB | 1074 MB | 103.08 GB | 34.36 GB |
| Request | solo | adaptive | solo | fixed- | adaptive |
| bs8/8K | 0.469 | 0.375–0.438 | 499 | 779 | 651 |
| bs8/16K | 0.469 | 0.18–0.469 | 664 | 959 | 827 |
| bs4/8K | 0.438 | 0–0.28 | 386 | 1010 | 436 |
| bs16/16K | 0.547 | 0.18–0.547 | 1095 | 1253 | 1134 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Baseline | Deviation | Favors | Rationale |
| SolidAttention | SSD DRAM | baseline | removes the I/O bottleneck; PCIe streaming hits the H2D peak (25.4 GB/s) |
| Solid./Scout. | KV retention set to 80% | mixed | the quality-retention point reported in the original papers; keeps the comparison on transfer/compute mechanisms |
| HybridGen | CXL tier unavailable | neutral | 502 GB host DRAM already holds the full KV; the capacity tier does not arise on this workload |
| FastDecode | multi-node single-node | against | the unified single-box platform is the constant across all systems |
| Baseline | Anchor | Original (reported) | Reproduction (measured) |
| SolidAttention | I/O bandwidth ceiling | 7.5 GB/s (SSD) | 25.4 GB/s (DRAM, H2D peak) |
| ScoutAttention | vs. full-KV attention, 8K | 1.78 (Qwen3-8B) | 1.26 e2e (same magnitude once the MoE expert share is accounted for) |
| HybridGen | vs. MoE-Lightning | 1.87–3.02 (OPT-13B) | 1.32–3.14 (Mixtral, native reference) |
| FastDecode | vs. MoE-Lightning | — | 1.39–2.94 (Mixtral, native reference) |
| HGCA | paradigm equivalence | — | non-AF ScoutAttention arm HGCA design (static split, sparsified CPU remainder, cross-engine merge) |
KV-Cache Management
Key-value (KV) cache management reduces and coordinates Transformer attention state to make long-context inference faster and more memory-efficient.
See all 201 papers