Mingxin

Engineering Solutions to the KV Cache Memory Bottleneck in Long-Context Inference

长上下文显存不足KV Cache

The Memory Bottleneck in Long-Context Inference Is Fundamentally a KV Cache Access Mismatch, Not Insufficient Capacity

When model parameter counts exceed 10 billion and context lengths extend to 128K+, inference services often encounter the paradox of "sufficient memory yet still OOM"—typically manifesting as vLLM reporting CUDA out of memory while nvidia-smi shows memory utilization at only 70–80%. The root cause lies not in parameter loading but in the dynamic expansion of the KV Cache: with Qwen3-Coder-480B-FP8 (weights ≈450 GB) as an example, a single instance generating with a 128K context consumes 182 GB of memory for KV Cache (TP8), far exceeding single-card HBM capacity (MI308X at 192 GB). According to Efficient Memory Management for Large Language Model Serving with PagedAttention, traditional contiguous allocation leads to severe memory fragmentation, reducing actual available space below theoretical values; while PagedAttention's paged management alleviates fragmentation, it does not address the low cross-turn reuse rate of KV data or the bandwidth contention caused by mixed hot and cold data. Mingxin's measurements show: what truly constrains throughput is not total memory capacity, but the mismatch between HBM bandwidth and KV access locality—this is the underlying constraint that all long-context optimization approaches must confront.

Tiered KV Cache Acceleration: Shifting Access Pressure from HBM to High-Bandwidth NVMe-oF Storage

The core design of the Mingxin FX100 is not simply attaching external SSDs, but building a tiered KV scheduling stack deeply integrated with vLLM and LMCache: deploying an all-flash NVMe-oF array (4-disk RAID0, XFS) over a RoCEv2 network, with a customized RDMA driver and LMCache patch enabling fine-grained tiered caching of KV blocks. The key lies in defining a three-tier access policy:

  • L0 (HBM): Active KV blocks for the current generation step (≈1–2 MB/step), read/written directly by the GPU;
  • L1 (NVMe-oF DRAM cache pool): High-frequency reused KV prefixes from the last 3–5 turns, with guaranteed bandwidth ≥25 GB/s;
  • L2 (NVMe-oF SSD backend): Full historical KV, organized with 64 KB page alignment, supporting parallel reads.

This architecture avoids the high-latency trap of traditional external memory recomputation. Measured results, report R2 show: under a 480B·TP8 configuration with cold-restore workloads (i.e., new requests requiring full KV loading from disk), TTFT p50 dropped from a baseline of 10.17–35.73 s to 7.53–26.35 s, a reduction of 26–32%; throughput reached its optimal operating point at concurrency level 16, improving by 40% (measured, report R2). More critically, it decouples the system from reliance on memory expansion—the FX100 on an MI308X ×8 platform supports 480B model long-context serving without upgrading HBM.

Performance Comparison: Tiered Approach vs. No External Memory Recomputation vs. NFS Loading—Empirical Differences Across Three Baselines

The performance gap between different KV processing paradigms in long-context scenarios must be quantified through a unified test platform. Mingxin's R2/R9 reports conducted three controlled comparisons on identical hardware (MI308X ×8 / Atlas 910B) and models (Qwen3-Coder-480B-FP8 / DeepSeek-70B):

Approach Scenario TTFT p50 Improvement Throughput Gain Source
FX100 tiered acceleration 480B·TP8·cold restore ↓26–32% (10.17→7.53s) +29–40% (concurrency 16) Measured, R2
No external memory recomputation (baseline) 480B·conc16 Measured, R2
FX100 vs. no external memory recomputation 480B·conc16 TTFT 149.5s → 11.85s (↓92%) Throughput 4.1 → 74.9 tok/s (↑1724%) Measured, R2
FX100 vs. NFS DeepSeek-70B loading Service startup 1399s → 150s (↓9.3×) Measured, R9

As shown, "no external memory recomputation" avoids external memory access but results in extremely high TTFT (149.5 s) due to redundant computation; NFS loading is faster than local disk but remains constrained by TCP stack and filesystem overhead. In contrast, the FX100 tiered approach achieves order-of-magnitude improvements in both TTFT and throughput—its essence lies in transforming KV access, previously locked by HBM bandwidth, into parallelizable NVMe-oF streaming reads.

Conclusion: KV Cache Engineering Optimization Has Entered the "Memory-Access Path Redefinition" Phase

The memory bottleneck in long-context inference is driving the industry from "accumulating memory" toward "redefining access paths." Measured data from the Mingxin FX100 demonstrates: at the 480B scale, tiered KV acceleration can improve throughput by 29–40% and reduce TTFT by 26–32%, with these gains independent of GPU memory expansion—stemming instead from the coordinated reconfiguration of storage protocol (RoCEv2), hardware bandwidth (100 GbE), software stack (LMCache patch), and scheduling strategy (three-tier KV caching). We offer a 10-week gated joint testing program (G1–G4 four-phase acceptance), enabling customers to reproduce all metrics using their own models and platforms. For access to the full R2/R3/R9 reports or to initiate joint testing, please contact the Mingxin technical collaboration team.

Key Q&A

Q: What is the actual throughput improvement from FX100 tiered KV acceleration in 480B long-context inference?
A: +29% at concurrency level 8 (lower bound), +40% at the optimal operating point of concurrency 16 (upper bound), and +35–36% at the full-machine TP4×2 level (measured, R2/R3).

Q: How does FX100 improve time-to-first-token (TTFT)?
A: Under 480B·TP8 across three concurrency levels, TTFT p50 dropped from 10.17–35.73 s to 7.53–26.35 s, a reduction of 26–32% (measured, R2).

Q: What is the speedup of FX100 compared to the no external memory recomputation approach on the 480B model?
A: TTFT p50 dropped from 149.5 s to 11.85 s (8.6–20×), and throughput increased from 4.1 tok/s to 74.9 tok/s (measured, R2).

References

  1. Efficient Memory Management for Large Language Model Serving with PagedAttention — https://arxiv.org/abs/2309.06180
  2. Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving — https://arxiv.org/abs/2407.00079
  3. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness — https://arxiv.org/abs/2205.14135
Generated by Mingxin's content engine with automated QC; headline numbers cite signed test reports (see the evidence library). Translated from the Chinese original. Questions or corrections: contact us.