Large-Scale LLM Inference with Heterogeneous Workloads: Prefill-Decode Contention and Asymptotically Optimal Control
Ruihan Lin, Zezhen Ding, Zean Han, Jiheng Zhang
TL;DR
This work develops a scalable stochastic-control framework for large-scale LLM inference over heterogeneous workloads by modeling the system as a multiclass, many-server queue with two GPU modes: mixed (one prefill plus decodes) and solo (decode-only). A data-driven iteration-time law yields state-dependent service rates, and a fluid limit analysis reduces scheduling to a steady-state linear program that prescribes per-class prefill occupancy and decode routing. The authors design a gate-and-route control framework that implements the LP in practice and prove asymptotic optimality in the many-GPU limit under both bundled (completion-based revenue) and separate (phase-based revenue) pricing, with SLIs like latency and fairness incorporated. Numerical experiments calibrated on production hardware demonstrate revenue and queue convergence toward fluid optima and show that SLI-aware policies can enforce targeted performance while outperforming standard heuristics. The results offer actionable guidance for pricing, resource partitioning, and SLI-aware scheduling in production LLM inference platforms. We highlight a decode-buffer elimination property, a key structural result, and provide insights into the practical trade-offs between fairness, latency, and revenue in large GPU deployments.
Abstract
Large Language Models (LLMs) are rapidly becoming critical infrastructure for enterprise applications, driving unprecedented demand for GPU-based inference services. A key operational challenge arises from the two-phase nature of LLM inference: a compute-intensive \emph{prefill} phase that processes user input, followed by a memory-bound \emph{decode} phase that generates output tokens. When these phases share GPU resources, prefill tasks throttle the processing speed of concurrent decodes, creating state-dependent contention. This contention is further complicated by workload heterogeneity, as different applications exhibit vastly different input and output lengths. We develop a stochastic control framework for scheduling heterogeneous LLM workloads across large GPU clusters. We formulate LLM inference as a multiclass many-server queueing network with state-dependent service rates, grounded in empirical iteration-time measurements. We analyze the fluid approximation of this system and solve steady-state linear programs that characterize optimal resource allocation. We design gate-and-route policies that regulate prefill admission and decode routing, and prove that they are asymptotically optimal in the many-GPU limit under both bundled and separate token-pricing schemes. We further extend the framework to incorporate Service Level Indicators (SLIs) such as latency and fairness, providing a general approach to constrained scheduling. Numerical experiments calibrated to empirical iteration-time data demonstrate that our policies outperform standard serving heuristics.
