Is the GPU Half-Empty or Half-Full? Practical Scheduling Techniques for LLMs

Ferdi Kossmann, Bruce Fontaine, Daya Khudia, Michael J. Cafarella, Samuel MaddenarXiv 2024 · DOI

Introduction

Large Language Model (LLM) serving is fundamentally constrained by GPU memory, specifically the memory required for the "KV cache." This cache stores intermediate mathematical states to prevent redundant computations during text generation. However, the KV cache grows unpredictably, making efficient scheduling a significant challenge. This paper introduces LARRY and SAL, two lightweight scheduling techniques designed to reduce latency by optimizing request ordering and server load balancing.

The Problem: Memory Uncertainty and HOL Blocking

In current production systems, First-Come-First-Served (FCFS) scheduling is the standard due to its simplicity. However, FCFS often leads to Head-of-Line (HOL) blocking. A single resource-intensive request—such as summarizing a long document—can occupy the front of the queue, hogging memory and forcing smaller, latency-sensitive chat queries to wait. If memory is exhausted, the system must "preempt" (pause and evict) running requests, a process that incurs significant overhead when resuming.

Methods: LARRY and SAL

The authors propose a two-tiered approach to address these inefficiencies without requiring complex predictive models.

System architecture showing the load balancer and engine-level schedulers across multiple servers.
  1. LARRY (Load-Adaptive Request Reordering): Operating at the engine level, LARRY replaces strict FCFS with a scoring mechanism. Under heavy load, it prioritizes requests with shorter prompts, which have a smaller initial memory footprint. To ensure fairness and prevent "starvation" of large requests, the priority score increases based on waiting time.
  2. SAL (Server-Aware Load Balancer): For multi-server deployments, SAL improves upon standard load balancers. Instead of merely counting active requests, SAL estimates wait times by analyzing a server’s available memory and the total token count in its queue.

Key Insights: The Prompt Dominance Realization

A core finding of this research is that in most real-world applications, the initial prompt tokens occupy over 70% of the total KV cache. This "Prompt Dominance" allows the system to accurately estimate a request's memory impact using only its input length, obviating the need for complex output-length predictors.

Distribution of memory consumption showing that prompts dominate the KV cache in both chat and code workloads.

Furthermore, the authors emphasize that simplicity is crucial for deployment. While academic literature often suggests using auxiliary models (like DistilBERT) to predict generation lengths, LARRY demonstrates that simple heuristics based on prompt length and wait time can achieve superior results with minimal implementation overhead.

Evaluation and Results

The techniques were evaluated using production traces from Azure Functions and Azure OpenAI, covering both chat (SW-Chat) and coding (SW-Code) workloads on Llama-3 models.

  • Latency Improvements: LARRY reduced the median (p50) Time-To-First-Token (TTFT) by 1.8x to 2.1x compared to standard FCFS.
  • Tail Latency: At the 95th percentile (p95), TTFT improved by 1.2x to 1.4x, indicating broad benefits across different request types.
  • Scalability: Combined with SAL, the system achieved up to 1.5x lower p50 TTFT compared to standard balancing methods like "Power of Two Choices" (P2C).
  • Ease of Adoption: LARRY was integrated into the vLLM framework with only 20 lines of code, highlighting its practical utility for industry.

Conclusion

LARRY and SAL provide a pragmatic path toward more efficient LLM serving. By leveraging the predictable nature of prompt memory consumption and implementing simple reordering and balancing logic, these techniques significantly improve user-perceived latency. Future work includes integrating these methods with prefix caching and exploring more sophisticated preemption strategies like CPU swapping.

Summary updated

BibTeX
@misc{kossmann2024is,
  author = {Ferdi Kossmann and Bruce Fontaine and Daya Khudia and Michael J. Cafarella and Samuel Madden},
  title = {{Is the GPU Half-Empty or Half-Full? Practical Scheduling Techniques for LLMs}},
  year = {2024},
  eprint = {2410.17840},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.17840},
}
Figure