High-throughput Generative Inference of Large Language Models with a Single GPU

By Ying Sheng, Lianmin Zheng, Binhang Yuan, Zhuohan Li, Max Ryabinin, Daniel Y. Fu, Zhiqiang Xie, Beidi Chen, Clark W. Barrett, Joseph Gonzalez and 4 more. 2023

797 citations recorded by the source corpus.

The high computational and memory requirements of large language model (LLM) inference make it feasible only with multiple high-end accelerators. Motivated by the emerging demand for latency-insensitive tasks with batched processing, this paper initiates the study of high-throughput LLM inference using limited resources, such as a single commodity GPU. We present FlexGen, a high-throughput generation engine for running LLMs with limited GPU memory. FlexGen can be flexibly configured under various hardware resource constraints by aggregating memory and computation from the GPU, CPU, and disk. By solving a linear programming problem, it searches for efficient patterns to store and access tensors. FlexGen further compresses the weights and the attention cache to 4 bits with negligible accuracy loss. These techniques enable FlexGen to have a larger space of batch size choices and thus significantly increase maximum throughput. As a result, when running OPT-175B on a single 16GB GPU, FlexGen achieves significantly higher throughput compared to state-of-the-art offloading systems, reaching a generation throughput of 1 token/s for the first time with an effective batch size of 144. On the HELM benchmark, FlexGen can benchmark a 30B model with a 16GB GPU on 7 representative sub-scenarios in 21 hours. The code is available at https://github.com/FMInference/FlexGen

Subfields: Artificial Intelligence, Electrical and Electronic Engineering, Materials Chemistry, Large Language Models, Efficiency & Compression

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Kurt Keutzer
  2. A. Gholami
  3. Song Han
  4. Quoc V. Le
  5. Christopher R'e
  6. Joseph E. Gonzalez
  7. Ji Lin
  8. Ion Stoica

In Electrical and Electronic Engineering

  1. Kurt Keutzer
  2. Song Han
  3. A. Gholami
  4. J. Kolter
  5. Haotian Tang
  6. Zhuang Liu
  7. Christopher R'e
  8. Shang Yang

In Materials Chemistry

  1. J. Kolter
  2. Zhuohan Li
  3. Zhangyang Wang

In Large Language Models

  1. Ion Stoica
  2. A. Gholami
  3. Song Han
  4. J. Kolter
  5. Kurt Keutzer
  6. Clark W. Barrett
  7. Zhuang Liu
  8. Sehoon Kim

In Efficiency & Compression

  1. Kurt Keutzer
  2. Song Han
  3. A. Gholami
  4. Ji Lin
  5. Sehoon Kim
  6. Zhangyang Wang
  7. Joseph E. Gonzalez
  8. Christopher R'e

Citations in the corpus