Introduction
Deploying Large Language Models (LLMs) at scale presents a formidable challenge for infrastructure engineers. Optimizing for performance and cost requires navigating a vast configuration space, including hardware selection (e.g., NVIDIA A100 vs. H100), parallelization strategies (Tensor and Pipeline parallelism), batch sizes, and scheduling algorithms. Traditionally, identifying the optimal setup has required expensive, time-consuming trial-and-error on physical hardware.
Vidur is a high-fidelity simulation framework designed to address this bottleneck. By modeling LLM performance at the operator level, Vidur enables engineers to identify cost-effective configurations in a fraction of the time and cost. For instance, optimizing a LLaMA2-70B deployment—a task that would normally consume over 42,000 GPU hours and cost hundreds of thousands of dollars—can be completed by Vidur in just one hour on a standard CPU for approximately $10.
System Architecture and Methodology
Vidur mimics the entire LLM inference stack through a modular architecture that bridges the gap between theoretical model specifications and real-world runtime performance.
As shown in the architecture above, the framework operates on three primary pillars:
- Operator Triaging: Vidur decomposes LLMs into three functional operator types: token-level (e.g., linear layers), sequence-level (e.g., attention kernels), and communication-level (data movement between GPUs). This granularity allows for precise modeling of how different input sizes affect latency.
- Runtime Estimator: To predict execution times for unseen input sizes, Vidur employs a Random Forest regression model. This model is trained on a minimal set of experimental profiles, allowing the simulator to generalize across a wide range of request lengths without exhaustive physical profiling.
- Hierarchical Scheduler: The simulator includes a sophisticated three-tier scheduler that emulates request routing to replicas, batching logic, and pipeline stage transitions, mirroring the behavior of production-grade systems like vLLM and Sarathi-Serve.
Workload Sensitivity and Vidur-Bench
A core insight of the Vidur research is that the "optimal" deployment configuration is not universal; it is highly dependent on the specific workload. To evaluate this, the authors introduced Vidur-Bench, which includes traces like LMSys-Chat-1M (conversational), Arxiv-Summarization (long-context document processing), and Bilingual-Web-Book (long-output generation).
The sensitivity of cost to the specific workload is illustrated in the heatmap above. Using a configuration optimized for one trace (e.g., ArxivSum) on a different workload (e.g., Chat1M) can result in a 2× cost penalty. This underscores the necessity of workload-aware simulation to avoid massive financial waste in production environments.
Key Results and Insights
Vidur achieves high fidelity, estimating end-to-end inference latency with less than 9% error across various models and hardware configurations. In many dynamic scenarios, this error rate drops below 5%. Beyond accuracy, the framework provides critical insights into Service Level Objectives (SLOs). For example, the authors found that relaxing the "Time Between Tokens" (TBT) requirement by a mere 20 milliseconds could enable a 1.85× reduction in serving costs for LLaMA2-70B.
Furthermore, the framework highlights how architectural nuances—such as Group Query Attention (GQA) versus Multi-Head Attention (MHA)—drastically alter memory usage and necessitate different deployment strategies, even for models of similar parameter counts.
Conclusion and Future Work
Vidur represents a significant step toward making LLM deployment more accessible and efficient. By providing a high-fidelity, low-cost alternative to physical testing, it allows for rapid exploration of the configuration space. Future iterations of the framework aim to incorporate energy consumption modeling, support for asynchronous pipeline scheduling, and a broader range of hardware accelerators beyond the NVIDIA A100 and H100 ecosystems.
Summary updated