Breaking the GPU Memory Bottleneck: Design and Validation of an Implicit Cache Offload-Prefetch Solution for Large Model Inference

    As large language models handle increasingly long contexts, the growing KV cache footprint limits GPU memory capacity and suppresses Decode throughput. This article introduces ESS (Expanded Sparse Server), a solution from Baidu AI Cloud's technical team that offloads implicit cache to CPU memory with an asynchronous offload-prefetch mechanism. Learn how the approach decouples storage from compute, how a high-fidelity simulator was built to evaluate it, and why simulation results show throughput gains of up to 123.4% in 32K-context scenarios and 123% in extreme 128K-context tests.

    Breaking the GPU Memory Bottleneck: Design and Validation of an Implicit Cache Offload-Prefetch Solution for Large Model Inference

    1. Introduction and Motivation

    With large language models (LLMs) now widely deployed in multi-turn conversations, long-document analysis, and other long-context workloads, the ability to handle long contexts has become a key benchmark for inference system performance. Mainstream LLMs use sparsified attention mechanisms, which successfully reduce computational complexity in long-context scenarios and shorten time-to-first-token latency. However, under the Prefill-Decode (PD) disaggregated architecture widely adopted in industrial deployments, Decode throughput becomes an increasingly prominent bottleneck as input sequence lengths grow.

    The root cause lies in how the implicit cache (KV cache) that the model must maintain grows linearly with sequence length during Decode. Since GPU memory (HBM) has a hard physical limit, once the implicit cache occupies a large share of memory, the concurrent batch size the system can support can no longer scale. Because GEMM operators in the Decode phase have low computational intensity and rely heavily on large batch sizes to amortize memory-access overhead, the constrained batch size directly suppresses Decode throughput.

    Against this backdrop, the core goal of the Baidu AI Cloud technical team was: for industrial-grade large models using sparsified attention mechanisms, offload the implicit cache to CPU memory and, while strictly meeting inference latency requirements, substantially increase Decode throughput and reduce per-token inference cost.

    2. A Deep Dive into the System Bottleneck

    To solve the throughput bottleneck, we first need to clarify the relationship between GPU memory and throughput. In a typical 32K-context scenario, system throughput should in theory scale positively with batch size. But as batch size increases, the implicit cache’s HBM footprint rises sharply. When memory approaches its limit, the system not only fails to expand batch size further, but may also suffer OOM (Out of Memory) errors caused by frequent memory fragmentation.

    During autoregressive decoding, every generated token requires reading the entire historical implicit cache — a classic memory-bandwidth-bound operation. Compute units are often left waiting, leaving GPU utilization low. If batch size cannot be increased to raise compute density, the GPU’s compute advantage goes to waste. Breaking the memory wall and unlocking room for batch size growth is therefore the essential path to higher Decode throughput.

    3. The ESS (Expanded Sparse Server) Architecture

    To address this bottleneck, we designed a systematic solution called Expanded Sparse Server (ESS). ESS centers on offloading the implicit cache to achieve lossless scaling of Decode throughput.

    1. Decoupling storage from compute

    Through hardware-software co-design, ESS moves the implicit cache from expensive GPU memory to larger, lower-cost CPU memory. This decoupling frees GPU memory to be dedicated to model weights and activation computations for the current step. By removing the implicit cache’s physical constraint on batch size, the system can easily accommodate hundreds or even thousands of concurrent requests.

    2. Offload and prefetch mechanism

    Moving data to CPU memory is not free — the core challenge is PCIe communication latency. ESS therefore implements an efficient Offload-Prefetch mechanism. While the GPU computes the current batch, the system asynchronously prefetches the implicit cache needed for the next step from CPU memory to GPU over a dedicated PCIe path. With fine-grained timing control and pipelining, memory-access latency is fully hidden behind computation, achieving “zero-wait” data loading.

    3. Compatibility with mainstream optimization strategies

    In modern inference systems, a single optimization rarely delivers maximum benefit. ESS was designed from the start to seamlessly integrate with mainstream techniques such as MTP (Multi-Token Prediction) and Two-Batch Overlap. ESS can serve as an efficient enhancement component for existing inference systems, stacking multiplicatively with these optimizations to further boost overall throughput.

    4. Building and Evaluating a High-Fidelity Simulator

    Before reworking an industrial-scale system, direct large-scale engineering validation is costly and slow to iterate. We therefore built a high-fidelity simulator to realistically evaluate the performance of ESS and other optimization strategies under complex production scenarios.

    The simulator incorporates detailed hardware parameter models and precisely models the following key dimensions:

    • Model compute cost: accurately estimates GPU compute time based on operator complexity of different layer structures (e.g., Attention, FFN).
    • Communication latency: simulates realistic bandwidth and latency curves for transferring KV cache over PCIe between HBM and CPU memory.
    • Offload-Prefetch overhead and scheduling: models the timing of prefetching under different workloads at a fine granularity, evaluating the true effectiveness of overlapping memory access with computation.

    With this simulator, developers can obtain highly reliable performance estimates before writing production code, dramatically reducing trial-and-error costs and accelerating agile iteration.

    5. Simulation Experiments and Performance Validation

    Using the high-fidelity simulator, we ran multiple rounds of experiments across different context lengths and system configurations. The results strongly validate the potential of ESS.

    1. Benefit breakdown in 32K-context scenarios

    At a 32K context length, we raised the MTP count from 2 to 4. Simulation data showed overall system throughput improved by up to 123.4%. Breaking down the gain: 53.1% was directly attributable to the MTP optimization, while the remaining 70.2% came entirely from the Offload-Prefetch mechanism enabled by ESS. This demonstrates that in typical long-context scenarios, ESS’s strategy of freeing GPU memory and expanding batch size is the core driver of throughput gains.

    2. Stress test in 128K ultra-long-context scenarios

    In ultra-long-context scenarios, memory pressure from the implicit cache grows dramatically. Under extreme conditions with MTP = 2 and a 128K context length, results showed that ESS’s Offload-Prefetch mechanism delivers throughput gains of up to 123%. Without ESS, the traditional architecture can barely sustain effective concurrency for 128K contexts on a single GPU. ESS successfully broke through this limit, making high-concurrency inference over ultra-long contexts feasible.

    6. Conclusion

    Facing the memory wall in long-context LLM inference, the ESS solution proposed by the Baidu AI Cloud technical team decouples storage from compute through implicit cache offloading and asynchronous prefetching. Simulation results fully demonstrate that the solution delivers significant throughput gains in typical long-context scenarios and plays a decisive role in 128K ultra-long-context workloads. Going forward, the solution will be deployed in production environments, providing a solid technical foundation for reducing the cost and improving the efficiency of large model inference services.