Abstract
The rapid adoption of machine learning (ML) has underscored the importance of serving ML models with high throughput and resource efficiency. Traditional approaches to managing increasing query demands have predominantly focused on hardware scaling, which involves increasing server count or computing power. However, this strategy can often be impractical due to limitations in the available budget or compute resources. As an alternative, accuracy scaling offers a promising solution by adjusting the accuracy of ML models to accommodate fluctuating query demands. Yet, existing accuracy scaling techniques target independent ML models and tend to underperform while managing inference pipelines. Furthermore, they lack integration with hardware scaling, leading to potential resource inefficiencies during low-demand periods. To address the limitations, this paper introduces Loki, a system designed for serving inference pipelines effectively with both hardware and accuracy scaling. Loki incorporates an innovative theoretical framework for optimal resource allocation and an effective query routing algorithm, aimed at improving system accuracy and minimizing latency deadline violations. Our empirical evaluation demonstrates that through accuracy scaling, the effective capacity of a fixed-size cluster can be enhanced by more than $2.7\times$ compared to relying solely on hardware scaling. When compared with state-of-the-art inference-serving systems, Loki achieves up to a $10\times$ reduction in Service Level Objective (SLO) violations, with minimal compromises on accuracy and while fulfilling throughput demands.
Introduction
Modern AI applications increasingly rely on inference pipelines—sequences of interdependent models, such as an object detector followed by a classifier. Managing these pipelines under fluctuating demand is challenging. Traditional hardware scaling (adding servers) is often constrained by cost or physical limits. Conversely, accuracy scaling—swapping high-fidelity models for faster, less accurate variants—often fails in pipeline contexts because it ignores how changes in one stage propagate through the chain, creating bottlenecks and Service Level Objective (SLO) violations.
The Loki System
Loki is the first system to treat inference pipelines as first-class citizens by unifying hardware and accuracy scaling. It employs a Mixed-Integer Linear Programming (MILP) framework to optimize resource allocation periodically, accounting for workload multiplication—where an upstream model (like a detector) can significantly increase the workload for downstream tasks by identifying multiple objects per query.
Integrated Resource Allocation
Loki's controller manages resources in distinct phases based on incoming demand:
- Hardware Scaling Phase: During low demand, Loki minimizes active server counts while maintaining peak accuracy to ensure cost-efficiency.
- Accuracy Scaling Phase: When demand exceeds physical cluster capacity, Loki strategically selects lower-accuracy model variants for specific pipeline stages. By being pipeline-aware, Loki recognizes that decreasing accuracy in later stages often results in a smaller end-to-end accuracy drop than doing so in early stages, thus maximizing overall accuracy while strictly adhering to latency deadlines.
Real-time Query Management
Loki implements two key algorithms for live traffic:
- MostAccurateFirst Routing: A greedy algorithm that directs queries to the highest-accuracy available model variants.
- Opportunistic Rerouting: Loki's "secret sauce." If a query experiences delays early in the pipeline, the system dynamically reroutes it to faster, lower-accuracy paths for subsequent stages, allowing the query to "catch up" and meet its end-to-end deadline rather than being dropped.
Evaluation and Results
Loki was evaluated on a 20-GPU cluster using two real-world scenarios: a Traffic Analysis pipeline (YOLOv5, EfficientNet, VGG) and a Social Media pipeline (ResNet, CLIP-ViT), driven by Azure and Twitter traces respectively.
Key Performance Metrics
- Throughput and Capacity: Loki increases effective cluster capacity by over 2.7× compared to hardware scaling alone.
- SLO Reliability: Loki achieves a 10× reduction in SLO violations compared to pipeline-agnostic systems like Proteus.
- Efficiency: During off-peak hours, Loki utilizes 2.7× fewer servers than systems without hardware scaling capabilities.
- Resilience: During extreme demand spikes, Loki maintains service by sacrificing only 10-13% accuracy, whereas traditional systems often fail to return results for a significant portion of traffic.
Conclusion
Loki demonstrates that pipeline-aware resource management is critical for modern ML serving. By accounting for workload multiplication and inter-stage dependencies, it offers a robust solution for high-demand environments. Future work includes extending support to general Directed Acyclic Graphs (DAGs), relaxing network homogeneity assumptions, and optimizing specifically for Large Language Model (LLM) serving requirements.
Summary updated