ConServe: Fine-Grained GPU Harvesting for LLM Online and Offline Co-Serving

Yifan Qiao, Shu Anzai, Shan Yu, Haoran Ma, Shuo Yang, Yang Wang, Miryung Kim, Yongji Wu, Yang Zhou, Jiarong Xing, Joseph E. Gonzalez, Ion Stoica, Harry XuarXiv 2024

TL;DR

ConServe is a novel large language model (LLM) co-serving system designed to harvest idle GPU resources during low-traffic periods by running latency-tolerant offline batch jobs alongside latency-critical online requests. By shifting from coarse request-level management to fine-grained token-level scheduling, layer-wise preemption, and incremental KV caching, ConServe boosts offline throughput by 2.2× while reducing online tail latency by 2.9×.

What Problem Does This Paper Address?

Deploying online LLM services (like chatbots or coding assistants) is incredibly expensive, requiring thousands of high-performance GPUs. To guarantee a smooth user experience and meet strict Service Level Objectives (SLOs), providers must provision enough hardware to handle peak traffic. However, real-world user traffic is highly volatile and bursty, fluctuating drastically within seconds.

Figure 1: User traffic to ChatGPT within a campus exposes high load variability at various time scales.

This overprovisioning leads to massive resource waste, leaving GPUs heavily underutilized during off-peak hours.

Figure 2: GPU utilization and the P99 TTFT across request rates measured with Llama-3.1 8B on an H100 GPU. Utilization is defined as the offered load relative to the GPU’s maximum achievable load.

While "harvesting" these idle cycles with best-effort offline tasks (like batch data analytics or model benchmarking) seems like an ideal fix, existing serving systems fail to do so efficiently. They manage resources at a coarse granularity (the request or iteration level). When an online traffic spike occurs, an in-flight offline batch can block the GPU for hundreds of milliseconds, violating online latency guarantees. Furthermore, preempting offline requests under existing architectures forces a costly dilemma: either discard the massive Key-Value (KV) cache and pay a huge recomputation penalty later, or stall the GPU to swap it to host memory.

Figure 3: P99 online latencies and offline throughput when co- serving online and offline requests with preemptive or non-premptive scheduling with Llama-3.1 8B on one H100 GPU.

Methods

ConServe breaks through these iteration- and request-level barriers by introducing three core fine-grained techniques that operate at the sub-request and sub-iteration level:

Figure 4: Design overview of ConServe.
  1. SLO-Aware Token-Level Scheduling: Instead of using a static chunk size, ConServe employs an offline-trained, context-aware polynomial cost model. This model predicts iteration latency based on active compute tokens and pre-existing context tokens in the KV cache, dynamically adjusting the number of offline tokens added to a batch to safely exploit available SLO slack.
  2. Layer-Wise Preemption: To avoid waiting for a full iteration to finish, ConServe instruments the LLM with lightweight "safepoints" between transformer layers. Workers check a preemption flag via a fast device-to-host memory load. If triggered, offline tasks exit mid-iteration within single-digit milliseconds, safely cleaning up hidden states without stalling the engine.
  3. Incremental KV Cache Management: Capitalizing on the fact that KV caches are append-only and immutable, ConServe manages states at the token level. It asynchronously checkpoints only the newly generated token's KV cache to host memory after each iteration, completely overlapping the I/O with the next batch's computation and enabling near-zero-cost preemption and background prefetching.

Datasets

The authors evaluated ConServe using real-world online and offline workloads:

  • BurstGPT: A real-world dataset containing user request traces to ChatGPT/GPT-4 on a university campus, used to simulate realistic online traffic.
  • DuReader: A Chinese machine reading comprehension dataset used to simulate offline model benchmarking tasks.
  • MultiNews: A large-scale multi-document summarization dataset representing offline summarization tasks.
  • VCSUM: A meeting summarization dataset representing long-context offline workloads.

Key Insights and Ideas

  • The Immutability of the KV Cache is a Superpower: Because the KV cache only grows and never modifies past tokens, you don't need to swap the whole monolithic state. Incremental, token-by-token asynchronous checkpointing turns a massive I/O bottleneck into a background task that can be completely hidden behind GPU compute.
  • Static Chunking is Unsafe for Co-serving: Standard chunked-prefill assumes constant execution time for a given chunk size. However, memory pressure from existing context tokens heavily inflates latency. A context-aware model is mandatory to safely mix workloads.
  • Layers are Natural Boundaries: Breaking the atomicity of a GPU iteration at the transformer layer boundary provides millisecond-level responsiveness to traffic spikes without introducing complex state-reconstruction overheads.

Key Results

ConServe was evaluated against state-of-the-art preemptive co-serving baselines (such as Sarathi-Preemptive and DistServe-Preemptive) using Llama-3.1 (8B/70B) and Qwen-2.5 (14B) models:

  • Latency Reduction: ConServe reduces online serving tail latency (P99 Time-to-First-Token and Time-Between-Tokens) by an average of 2.9×, keeping online latencies within 25% of an isolated, "Online-Only" setup.
  • Throughput Improvement: ConServe delivers an average of 2.2× (and up to 7.48× in specific high-load scenarios) higher offline throughput compared to preemptive baselines, capturing 82.3% of the absolute theoretical maximum throughput.
  • Low Overhead: The layer-wise preemption safepoint checks introduce a negligible 1.1% total latency overhead when no preemption occurs, reacting to traffic spikes within 13ms.

Limitations and Future Work

  • Host Memory Constraints: While the host memory footprint is bounded by physical GPU memory capacity, extreme memory pressure could force individual token evictions and fallback to recomputation.
  • Distributed Scaling: Although evaluated with tensor parallelism (up to 4 H100s for Llama-3.1 70B), extending this fine-grained harvesting to pipeline-parallel setups or geo-distributed clusters with higher network latencies remains an open area for exploration.

Summary updated

BibTeX
@misc{qiao2024conserve,
  author = {Yifan Qiao and Shu Anzai and Shan Yu and Haoran Ma and Shuo Yang and Yang Wang and Miryung Kim and Yongji Wu and Yang Zhou and Jiarong Xing and Joseph E. Gonzalez and Ion Stoica and Harry Xu},
  title = {{ConServe: Fine-Grained GPU Harvesting for LLM Online and Offline Co-Serving}},
  year = {2024},
  eprint = {2410.01228},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.01228},
}
Figure