Skip to main content
QUICK REVIEW

[Paper Review] DeepSpeed Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale

Reza Yazdani Aminabadi, Samyam Rajbhandari|arXiv (Cornell University)|Jun 30, 2022
Advanced Neural Network ApplicationsComputer Science8 citations
TL;DR

DeepSpeed Inference introduces a unified system for efficient, scalable inference of large-scale dense and sparse (Mixture-of-Experts) transformer models across diverse hardware. By combining multi-GPU optimization, CPU/NVMe offloading via ZeRO-Inference, and specialized kernels, it achieves up to 7.3× lower latency and 1.5× higher throughput than SOTA, enabling trillion-parameter models with real-time latency on hundreds of GPUs.

ABSTRACT

The past several years have witnessed the success of transformer-based models, and their scale and application scenarios continue to grow aggressively. The current landscape of transformer models is increasingly diverse: the model size varies drastically with the largest being of hundred-billion parameters; the model characteristics differ due to the sparsity introduced by the Mixture-of-Experts; the target application scenarios can be latency-critical or throughput-oriented; the deployment hardware could be single- or multi-GPU systems with different types of memory and storage, etc. With such increasing diversity and the fast-evolving pace of transformer models, designing a highly performant and efficient inference system is extremely challenging. In this paper, we present DeepSpeed Inference, a comprehensive system solution for transformer model inference to address the above-mentioned challenges. DeepSpeed Inference consists of (1) a multi-GPU inference solution to minimize latency while maximizing the throughput of both dense and sparse transformer models when they fit in aggregate GPU memory, and (2) a heterogeneous inference solution that leverages CPU and NVMe memory in addition to the GPU memory and compute to enable high inference throughput with large models which do not fit in aggregate GPU memory. DeepSpeed Inference reduces latency by up to 7.3X over the state-of-the-art for latency-oriented scenarios and increases throughput by over 1.5x for throughput-oriented scenarios. Moreover, it enables trillion parameter scale inference under real-time latency constraints by leveraging hundreds of GPUs, an unprecedented scale for inference. It can inference 25x larger models than with GPU-only solutions, while delivering a high throughput of 84 TFLOPS (over $50\%$ of A6000 peak).

Motivation & Objective

  • Address the growing challenge of deploying large-scale, diverse transformer models—ranging from dense to MoE architectures—across heterogeneous hardware with varying memory and latency constraints.
  • Overcome the limitations of existing inference systems that are suboptimal for small-batch, latency-critical workloads and fail to scale efficiently beyond GPU memory limits.
  • Enable high-throughput, low-latency inference for models too large to fit in GPU memory by leveraging CPU and NVMe storage as extensions of the memory hierarchy.
  • Support both latency-sensitive and throughput-oriented workloads through adaptive scheduling, kernel optimization, and memory management across multi-GPU and heterogeneous systems.

Proposed method

  • Introduces ZeRO-Inference, a parameter offloading strategy that moves model weights to CPU or NVMe storage while keeping activations in GPU memory, enabling inference of models larger than GPU memory capacity.
  • Employs DeepFusion to co-locate and fuse multiple operators (e.g., linear, layernorm, softmax) into single kernels, reducing kernel launch and data movement overheads for improved latency at small batch sizes.
  • Optimizes GeMM kernels for inference workloads to maximize memory bandwidth utilization, especially critical for small-batch inference where bandwidth is the bottleneck.
  • Applies hybrid scheduling that combines pipeline and tensor parallelism with dynamic load balancing to keep all devices busy, particularly important for autoregressive generation with token dependencies.
  • Leverages all-to-all communication optimizations and expert parallelism to scale sparse MoE models efficiently across hundreds of GPUs with high memory bandwidth scalability.
  • Uses PCIe bandwidth aggregation across multiple GPUs to achieve near-linear throughput scaling, enabling high-throughput inference even for massive models.

Experimental results

Research questions

  • RQ1How can inference systems efficiently support both latency-critical and throughput-oriented workloads for large transformer models with varying model sizes and sparsity?
  • RQ2What system-level optimizations are required to achieve high memory bandwidth utilization and low kernel launch overhead at small batch sizes, where inference latency is memory-bound?
  • RQ3How can model parameters be effectively offloaded to CPU and NVMe storage without sacrificing throughput or introducing unacceptable latency?
  • RQ4What parallelism strategies and scheduling techniques are needed to maintain high device utilization in autoregressive generation, where each token depends on the previous?
  • RQ5To what extent can inference performance scale across hundreds of GPUs when using heterogeneous memory (GPU, CPU, NVMe) and mixed-precision computation?

Key findings

  • DeepSpeed Inference reduces inference latency by up to 7.3× compared to the state-of-the-art for latency-critical scenarios, primarily through kernel fusion and optimized memory access.
  • It increases throughput by over 1.5× for throughput-oriented workloads by enabling significantly larger batch sizes via ZeRO-Inference’s CPU/NVMe offloading, even for models that fit in GPU memory.
  • The system supports trillion-parameter model inference under real-time latency constraints using hundreds of GPUs, achieving 84 TFLOPS (over 50% of A6000 peak) throughput.
  • For models that fit in CPU memory, ZeRO-Inference delivers over 25× higher throughput than CPU-only inference, demonstrating the effectiveness of hybrid memory offloading.
  • On 8× A100 nodes, hybrid scheduling reduces prompt processing latency by 1.18× (PP+MP) and 3.06× (MP-only) compared to FasterTransformer, showing strong gains in autoregressive inference speed.
  • DeepSpeed Inference achieves superior memory bandwidth scalability on sparse MoE models, outperforming PyTorch baseline and maintaining high bandwidth up to 128 GPUs due to optimized all-to-all and MoE kernels.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.