TL;DR
DOPD (Dynamic Optimal Prefill/Decoding) is a dynamic LLM inference framework that continuously optimizes GPU resource allocation between prefill and decoding instances based on real-time workload forecasting. By combining an analytical allocation formula with a length-aware request scheduler, DOPD boosts system goodput by up to 1.5× and achieves over 99% SLO attainment under highly volatile, real-world traffic.
What Problem Does This Paper Address?
Large Language Model (LLM) inference consists of two distinct phases: the prefill stage (processing the input prompt, which is highly compute-bound) and the decoding stage (generating tokens one by one, which is memory-bandwidth bound). To prevent compute-heavy prefill tasks from delaying memory-bound decoding steps, state-of-the-art systems use a "Prefill-Decoding (PD) Disaggregation" architecture, separating these phases onto different specialized GPUs.
However, real-world user requests are highly unpredictable, bursty, and vary wildly in length. Static allocations of prefill vs. decoding instances lead to a severe producer-consumer mismatch: either prefill instances sit idle while decoding instances are overwhelmed, or vice versa. This results in massive resource waste or missed Service-Level Objectives (SLOs).
Methods
DOPD introduces a three-pronged approach to solve this imbalance dynamically:
- Analytical P/D Ratio Optimization: The authors derive a mathematical formula to calculate the exact ratio of prefill to decoding instances needed to maximize throughput. This formula keeps both instance types fully utilized under hardware memory capacity and bandwidth constraints.
- Proactive Workload Forecasting: Instead of reacting after an overload occurs, DOPD uses a lightweight ARIMA time-series model to predict upcoming request concurrency, average input sequence length (ISL), and output sequence length (OSL). A multiplicative scaling factor corrects for prediction bias in real-time.
- Length-Aware Request Scheduling: To handle mixed-length requests, DOPD groups requests by length. Long requests are processed immediately. Short requests are smartly batched using a knapsack-style algorithm bounded by a maximum waiting timeout to ensure high kernel efficiency without violating latency goals. Crucially, ultra-short requests bypass the disaggregation entirely and are processed directly on decoding instances (PD-aggregation) to eliminate unnecessary Key-Value (KV) cache network transfer overhead.
Datasets
The framework was evaluated using realistic production workload traces:
- Microsoft Azure Traces: Includes BurstGPT, Azure Code Traces, and Azure Conversation traces, which capture real-world burstiness and wide variance in sequence lengths.
- ShareGPT: Used to provide actual text content for the requests during trace replay.
Key Insights and Ideas
- One size does not fit all request lengths: Mixing long and short requests under a single static P/D ratio hurts both. Long requests need more prefill power, while short requests decode quickly.
- Disaggregation isn't always optimal: For extremely short prompts, the network latency of transferring the KV-cache from a prefill GPU to a decoding GPU can actually exceed the time it takes to just do the prefill locally. Selectively re-aggregating these ultra-short requests yields significant latency savings.
- Proactive beats reactive: Traditional reactive scaling triggers adjustments only after a system is already overloaded. Proactive time-series forecasting allows DOPD to scale out before traffic spikes hit, maintaining strict SLOs.
Key Results
- Goodput & Latency: Compared to vLLM (aggregation-based) and DistServe (static disaggregation), DOPD improves overall system goodput by up to 1.5×.
- SLO Attainment: DOPD achieved an exceptional 99.4% SLO attainment rate under the highly volatile BurstGPT trace, compared to just 80.8% for load-based reactive scaling (DYN-LOAD) and 87.3% for SLA-aware scaling (DYN-SLA).
- Tail Latency: It reduced P90 Time-to-First-Token (TTFT) by up to 67.5% and P90 Time-per-Output-Token (TPOT) by up to 22.8%.
Limitations and Future Work
- Ultra-long prompts: Rare, unpredictable, ultra-long prompts can still transiently degrade performance since they violate average-length signals used by the predictor. The authors suggest deploying an auxiliary specialized node to prioritize these requests.
- Fixed Tensor Parallelism: The current implementation does not dynamically adjust the Tensor Parallelism (TP) size of individual instances at runtime, which could offer finer-grained optimization.
- Extensions: Future work includes extending DOPD to Multimodal Large Language Models (MLLMs) and integrating it with speculative decoding and sparse attention mechanisms.
Summary updated