DeepSpeed-FastGen: High-throughput Text Generation for LLMs via MII and DeepSpeed-Inference

Connor Holmes, Masahiro Tanaka, Michael Wyatt, Ammar Ahmad Awan, Jeff Rasley, Samyam Rajbhandari, Reza Yazdani Aminabadi, Heyang Qin, Arash Bakhtiari, Lev Kurilenko, Yuxiong HearXiv 2024 · DOI

Introduction

Serving Large Language Models (LLMs) is a complex balancing act between two distinct computational phases: Prompt Processing (Prefill) and Token Generation (Decoding). Prefill is compute-heavy, processing many tokens simultaneously, while Decoding is memory-heavy, often leaving GPU compute units underutilized.

Existing systems like vLLM often prioritize new prompts by preempting ongoing generations, leading to significant latency spikes. Others, like Orca, attempt to run these phases side-by-side but struggle with long prompts that "hog" the GPU. DeepSpeed-FastGen addresses these inefficiencies with a novel scheduling strategy called Dynamic SplitFuse.

Methods: Dynamic SplitFuse

The core innovation of DeepSpeed-FastGen is Dynamic SplitFuse, which moves away from treating prompts as indivisible blocks. Instead of allowing a long prompt to stall the system, it employs three key mechanisms:

  • Decomposition: Long prompts are broken into smaller, manageable chunks.
  • Fusion: These chunks are fused into a single forward pass alongside the single tokens being generated for other requests.
  • Consistent Batching: By splitting and fusing, the system maintains a consistent "token budget" for every GPU cycle, creating a steady, high-volume stream of work.
Comparison of scheduling strategies: vLLM (preemption), Orca (side-by-side), and DeepSpeed-FastGen (Dynamic SplitFuse).

This architecture is built on the synergy between DeepSpeed-MII (serving infrastructure) and DeepSpeed-Inference (high-performance backend kernels and blocked KV-caching).

Performance Evaluation

The system was evaluated using simulated workloads mimicking real-world chat and summarization scenarios across Llama-2 (7B, 13B, 70B), Mistral-7B, and OPT models. Testing was conducted on NVIDIA A100 (80GB), H100, and A6000 GPUs using distributions that reflect unpredictable production traffic.

Key Insights

  • Token-Driven Latency: The primary determinant of forward pass latency is the total number of tokens processed, regardless of the number of sequences in the batch.
  • Throughput Efficiency: Throughput follows a concave curve, rising sharply before plateauing. Efficiency is maximized by distributing tokens as evenly as possible across forward passes.

Key Results

DeepSpeed-FastGen significantly outperforms vLLM across critical production metrics:

  • Effective Throughput: Achieves up to 2.3x higher throughput while adhering to strict Service Level Agreements (SLAs).
  • Latency Reduction: Reduces average latency by 2x and tail latency (P95) by up to 3.7x.
  • Linear Scalability: Demonstrates near-perfect scaling; a 16-GPU replica setup increased total throughput by 16x (from 1.46 to 23.7 queries/sec).
DeepSpeed-FastGen demonstrates significantly higher throughput and lower latency compared to vLLM.

Limitations and Future Work

While the current alpha release provides a powerful foundation for Llama-2, Mistral, and OPT on NVIDIA hardware, the roadmap includes expanding model architecture support and collaborating with partners for additional hardware backends. Future updates will also focus on feature parity, including broader quantization support and further kernel-level optimizations to push throughput limits even further.

Summary updated

BibTeX
@misc{holmes2024deepspeed,
  author = {Connor Holmes and Masahiro Tanaka and Michael Wyatt and Ammar Ahmad Awan and Jeff Rasley and Samyam Rajbhandari and Reza Yazdani Aminabadi and Heyang Qin and Arash Bakhtiari and Lev Kurilenko and Yuxiong He},
  title = {{DeepSpeed-FastGen: High-throughput Text Generation for LLMs via MII and DeepSpeed-Inference}},
  year = {2024},
  eprint = {2401.08671},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.08671},
}
Figure