NEO: Saving GPU Memory Crisis with CPU Offloading for Online LLM Inference

Xuanlin Jiang, Yang Zhou, Shiyi Cao, Ion Stoica, Minlan Yu

TL;DR

NEO is an online large language model (LLM) serving system that relieves GPU memory pressure by offloading a targeted portion of the KV cache and decoding attention computations to the local host CPU. By employing asymmetric GPU-CPU execution pipelining alongside dynamic, load-aware scheduling, NEO unlocks significantly larger batch sizes—achieving up to 7.5× higher throughput on memory-constrained GPUs like the NVIDIA T4 and up to 79.3% on A10G instances with high-bandwidth CPUs, all without sacrificing interactive latency or model accuracy.

What Problem Does This Paper Address?

Serving LLMs in online settings requires low latency alongside high throughput to justify expensive GPU costs. Serving engines rely on request batching to saturate GPU compute; however, batch size is severely bottlenecked by available GPU memory (HBM), which is rapidly exhausted by storing the Key-Value (KV) cache for active requests.

Prior offloading systems exhibit critical flaws for interactive, online serving:

  • Offline offloaders (e.g., FlexGen): Use layer-by-layer disk/CPU weight and KV-cache swapping with massive batch sizes, trading away interactive response latency.
  • Full attention offloaders (e.g., FastDecode): Offload all KV caches and decoding attention to CPUs. Because CPUs have lower compute and memory bandwidth than GPUs, they become a massive bottleneck unless supported by expensive, multi-socket remote CPU clusters.
  • Static schedules: Assume fixed prompt/generation lengths, collapsing under unpredictable real-world traffic.

Methods

NEO treats the host CPU—which already comes bundled and paid for in standard cloud VM instances—as a co-processor for memory-bound decoding attention. Its key architectural components include:

  • Partial Offloading: Instead of an all-or-nothing offload, requests are designated as either GPU-requests or CPU-requests. Requests are prioritized in GPU memory, and only the overflow is routed to the CPU cache.
  • Asymmetric GPU-CPU Pipelining: Rather than splitting batches symmetrically (which causes idle CPU/GPU bubbles), NEO forms two asymmetric sub-batches per iteration:
  • Batch-0: Consolidates all compute-heavy prefilling requests and GPU decoding requests with a few CPU requests (creating a long linear compute phase on the GPU).
  • Batch-1: Contains the bulk of CPU decoding requests (a long attention phase on CPU, paired with a short linear phase on GPU).
  • These two phases overlap, allowing the slow CPU attention calculations to hide behind the GPU's dense matrix multiplications.
  • Layer-Wise KV Swapping: Newly prefilled tokens destined for CPU memory transfer their KV values over PCIe layer-by-layer as each layer finishes, hiding transfer overhead behind subsequent GPU computation.
  • Load-Aware Scheduler: An adaptive per-iteration scheduler evaluates queue states and dynamically solves a heuristic optimization problem: balance CPU/GPU execution times, hide CPU delays, and greedy-compare against pure-GPU execution to fall back if offloading offers no benefit.
  • PACPU (Paged Attention for CPU): Custom SIMD C++ kernels written in Intel ISPC that implement PagedAttention on CPUs across AVX2, AVX-512, and ARM Neon with core-level parallelism inspired by FlashDecoding.
+--------------------------------------------------------------------+
|                         Iteration Timeline                         |
|                                                                    |
| GPU: [ Batch-0 Prefill + Linear ] ---> [ Batch-1 Linear + Attention]
|                 | (overlaps)                     | (overlaps)      |
| CPU: [ Batch-1 Attention (PACPU)] ---> [ Batch-0 Attention (PACPU) ]
+--------------------------------------------------------------------+

Datasets

NEO was evaluated on both real-world traces and synthetic benchmarks:

  • Azure LLM Inference Trace for Coding (AC): A production coding trace from Azure cloud environments featuring longer sequence lengths.
  • OpenAI Summarization Comparison (OSC): Real-world chatbot conversations and summarization prompts featuring shorter sequences.
  • Synthetic Workloads: Input and output lengths sampled uniformly around fixed configurations (e.g., inputs of 500–2,000 tokens; outputs of 50–300 tokens).

Key Insights and Ideas

  • Bandwidth Matters More Than FLOPS for Decoding: While an A10G GPU has ~100× the compute FLOPS of a CPU (125 vs. 1.2 TFLOPS), its memory bandwidth advantage is only ~3× (600 vs. 200 GB/s). Because auto-regressive decoding attention has low arithmetic intensity and is memory-bandwidth bound, CPUs can serve as surprisingly effective attention executors.
  • PCIe Latency Can Be Hidden: GPU dense operations take 5–10× longer than the PCIe activation transfer time per token, allowing memory transfers to be fully overlapped with compute.
  • Embracing Asymmetry Eliminates Bubbles: Trying to balance identical sub-batches fails due to dynamic sequence lengths and the imbalance between attention and linear layers. Pairing prefill-heavy batches with CPU-attention-heavy batches turns pipeline latency discrepancies into complementary stages.

Key Results

  • Throughput Improvements: Compared to GPU-only serving (vLLM and SwiftLLM) under identical latency constraints:
  • Up to 7.5× (563%) throughput gain on memory-starved NVIDIA T4 GPUs (Llama-2-7B).
  • Up to 26% higher throughput on A10G (Llama-3.1-8B).
  • Up to 14% higher throughput on 2×H100 (Llama-3.1-70B).
  • CPU Scaling: On AWS g5.16xlarge instances with higher CPU memory bandwidth, NEO achieved up to a 79.3% throughput gain over the GPU-only baseline.
  • Outperforming Full Offloading: Against FastDecode+ (which fully offloads attention), NEO avoids severe CPU bottlenecking as output lengths grow, whereas FastDecode+ throughput drops to <60% of baseline.

Limitations and Future Work

  • Workload Sensitivity: When requests have very short output lengths, the GPU is primarily compute-bound on prefill; offloading attention provides minimal gain and introduces slight scheduling/swapping overheads.
  • Energy Footprint: Offloading drives host CPU utilization higher, increasing total server power draw. While cost-neutral in standard public clouds where CPU cores are bundled into instance pricing, throughput-per-watt may not improve on higher-end setups.
  • Multi-GPU Optimizations: The current implementation relies on SwiftLLM with basic Ray/NCCL parallelism; integrating NEO's scheduler into heavily optimized multi-GPU engines like production vLLM and SGLang remains future work.
  • Integration with Chunked Prefill: While currently evaluated separately, integrating NEO with chunked prefill could allow finer-grained CPU-GPU workload balance during long-context prefilling.

Summary updated

BibTeX
@inproceedings{jiang2025neo,
  author = {Xuanlin Jiang and Yang Zhou and Shiyi Cao and Ion Stoica and Minlan Yu},
  title = {{NEO: Saving GPU Memory Crisis with CPU Offloading for Online LLM Inference}},
  booktitle = {MLSys},
  year = {2025},
  url = {https://openreview.net/forum?id=umgy9tWBLA},
}
Figure