Fairness in Serving Large Language Models

Ying Sheng, Shiyi Cao, Dacheng Li, Banghua Zhu, Zhuohan Li +3 more
12/31/2023
146 citations
cs.AIcs.LGcs.PF

Official code: Ying1123/VTC-artifact (52 stars, Python, Apache-2.0, last commit 2024-06-07).

Abstract

High-demand LLM inference services (e.g., ChatGPT and BARD) support a wide range of requests from short chat conversations to long document reading. To ensure that all client requests are processed fairly, most major LLM inference services have request rate limits, to ensure that no client can dominate the request queue.

Show full abstract

However, this rudimentary notion of fairness also results in under-utilization of the resources and poor client experience when there is spare capacity. While there is a rich literature on fair scheduling, serving LLMs presents new challenges due to their unpredictable request lengths and their unique batching characteristics on parallel accelerators. This paper introduces the definition of LLM serving fairness based on a cost function that accounts for the number of input and output tokens processed. To achieve fairness in serving, we propose a novel scheduling algorithm, the Virtual Token Counter (VTC), a fair scheduler based on the continuous batching mechanism. We prove a 2x tight upper bound on the service difference between two backlogged clients, adhering to the requirement of work-conserving. Through extensive experiments, we demonstrate the superior performance of VTC in ensuring fairness, especially in contrast to other baseline methods, which exhibit shortcomings under various conditions. The reproducible code is available at https://github.com/Ying1123/VTC-artifact

View on arXivView PDF

Code Implementations(1)

Apache-2.0
527Python, CudaApr 26, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{sheng2023fairness,
  title  = {Fairness in Serving Large Language Models},
  author = {Ying Sheng and Shiyi Cao and Dacheng Li and Banghua Zhu and Zhuohan Li and Danyang Zhuo and Joseph E. Gonzalez and Ion Stoica},
  year   = {2023},
  eprint = {2401.00588},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2401.00588v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2401.00588.svg)](https://codeofpaper.com/paper/2401.00588)

Discussion