TL;DR
LLMVisor is a lightweight, roofline-guided latency attribution model designed for multi-tenant LLM serving. By operating at microsecond scale directly within the scheduler loop, it accurately decomposes co-batched inference latency into additive, per-request shares, enabling fair GPU time allocation and precise post-hoc accounting.
What Problem Does This Paper Address?
To maximize GPU utilization and throughput, modern Large Language Model (LLM) serving platforms group heterogeneous requests from multiple users (tenants) into a single execution batch. While this "co-batching" strategy keeps accelerators busy, it introduces a major challenge: it couples requests together, making it incredibly difficult to determine exactly how much GPU time each individual request or tenant actually consumed.
Existing resource management approaches fall short:
- Hardware partitioning (like NVIDIA's MIG) provides isolation but lacks the flexibility required for the massive memory footprints of LLMs.
- Black-box ML predictors can estimate batch latency but lack additivity (the ability to cleanly split costs among requests) and are too slow to run inside high-frequency scheduling loops.
- Naive token-counting proxies (such as VTC) ignore critical system-level factors like context length and batching overhead, leading to poor accuracy at high percentiles.
Without an accurate, real-time, per-request latency attribution model, providers cannot enforce strict Service Level Objectives (SLOs), implement fair-share scheduling, or provide transparent billing.
Methods
The authors introduce LLMVisor, an interpretable, roofline-guided, piecewise-linear model that runs in the critical path of the inference engine scheduler.
Instead of manually calculating FLOPs and memory bytes from complex hardware specifications, LLMVisor uses a small set of request-level features that act as proxies for compute and memory I/O traffic. It models the batch latency ($T_B$) using a two-segment linear form tailored to the distinct phases of LLM inference: compute-bound prefill and memory-bound decode.
The core mathematical formulation is: $$T_B = \beta + a_1 \sum_{i} p_i + a_2 \sum_{i} c_i + a_3 \sum_{i} p_i^2 + a_4 \sum_{i} |B|$$
Where:
- $p_i$: Tokens to process for request $i$ (captures MLP and causal-attention compute).
- $c_i$: Context tokens that must be attended to (captures KV-cache memory traffic).
- $p_i^2$: Models the quadratic cost of self-attention.
- $|B|$: Batch size (captures hardware utilization gains).
- $\beta$: Fixed per-batch costs (e.g., model-weight I/O).
The model coefficients are fitted using ordinary least squares (OLS) via short warm-up profiling runs. Because the formula is linear with respect to the sums of per-request terms, it is additive by design. This allows the scheduler to compute closed-form, per-request latency attributions instantaneously.
Datasets
The model was evaluated using synthetic workloads designed to simulate realistic, highly variable multi-tenant environments. The evaluation setup included:
- Models: Llama3.1-8B, Qwen2.5-14B, and Qwen2.5-32B.
- Hardware: NVIDIA H100 SXM and A100 SXM servers across multiple tensor-parallel (TP) configurations (sizes 1, 2, and 4).
- Workloads: Concurrent requests ranging from 128 to 2,048, with heterogeneous sequence lengths pushing total token counts up to 90% of the engine's maximum KV-cache capacity.
Key Insights and Ideas
- Phase-Aware Modeling is Essential: Prefill and decode phases have entirely different hardware bottlenecks. By fitting separate coefficient sets for prefill and decode, LLMVisor accurately tracks the transition from memory-bound to compute-bound states.
- Additivity via Linear Features: By selecting features that scale linearly with the underlying physical costs (FLOPs and bytes) and summing them, the authors bypassed the need for non-linear machine learning models, ensuring that the total batch latency perfectly equals the sum of individual request attributions.
- Microsecond Efficiency: Because the model relies on a simple closed-form algebraic equation, it executes in microseconds—over 100x faster than common ML predictors like Random Forest. This allows it to run inside the scheduling loop without delaying the actual inference.
Key Results
LLMVisor was benchmarked against VTC (a state-of-the-art token-based fairness proxy) and demonstrated significant improvements in both accuracy and tail-error reduction:
- Near-Perfect Fit: LLMVisor achieved an $R^2$ score of greater than 0.97 in all evaluated scenarios, frequently hitting a perfect 1.000 during the prefill phase.
- Prefill Phase Improvements: Compared to VTC, LLMVisor reduced relative error by up to 2.5× at the 90th percentile (p90) and 3.3× at the 99th percentile (p99).
- Decode Phase Improvements: In the highly variable decode phase, LLMVisor reduced relative error by up to 3.5× at p90 and 4.4× at p99, successfully capturing the nuances of context length and batch size that token-counting models miss.
Limitations and Future Work
Not discussed in the paper.
Summary updated