Abstract
Deploying multi-model inference pipelines at the edge requires balancing complex trade-offs between accuracy, latency, and resource costs under dynamic workloads. This paper introduces the Online Pipeline Decision (OPD) framework, which leverages Reinforcement Learning (RL) to adaptively select pipeline configurations. By integrating LSTM-based load prediction and Residual Network (ResNet) feature extraction, OPD proactively manages resources in real-world Kubernetes environments. Experimental results show that OPD significantly outperforms heuristic baselines, achieving a 21% improvement in Quality of Service (QoS) while maintaining lower operational costs than existing adaptation methods.
Introduction: The Challenge of Edge Inference Pipelines
Real-time applications like autonomous driving and IoT increasingly rely on "inference pipelines"—sequences of machine learning models where the output of one stage serves as the input for the next. Optimizing these pipelines on resource-constrained edge devices is exceptionally difficult due to several factors:
- Resource Scarcity: Edge devices have limited CPU and memory compared to cloud environments.
- Dynamic Workloads: Unpredictable traffic spikes can cause latency to skyrocket or systems to crash.
- Interdependency: Decisions at early stages (e.g., choosing a high-accuracy but slow model) constrain the remaining time and resource budget for all subsequent stages.
- Configuration Complexity: Engineers must navigate a vast search space of model variants (quantized vs. full), replica counts, and batch sizes for every stage.
Methodology: The OPD Framework
The authors frame the configuration problem as a Markov Decision Process (MDP) and solve it using Proximal Policy Optimization (PPO). The resulting framework, Online Pipeline Decision (OPD), is built on several key innovations:
- Proactive Load Prediction: An LSTM network predicts incoming traffic for the next 20 seconds based on a 2-minute historical window, allowing the system to preemptively adjust configurations.
- Deep Feature Extraction: Residual Blocks (ResNet) are used to extract complex features from system metrics such as CPU usage, latency, and throughput. This captures non-linear relationships that simple linear layers often miss.
- Custom QoS Metric: A mathematical definition of Quality of Service balances accuracy, throughput, and latency against "extra load"—the portion of requests the system fails to process due to resource exhaustion.
- Expert-Guided Training: To overcome the "cold start" problem typical of RL, an expert model guides the agent during the initial learning phases.
The system is integrated into a production-grade environment using Kubernetes, Seldon Core for model serving, Prometheus for monitoring, and Istio for intelligent traffic routing.
Experimental Results
The OPD algorithm was evaluated against three baselines: Random, Greedy (cost-minimization focused), and IPA (Inference Pipeline Adaptation).
- Superior Balance: Under fluctuating workloads, OPD improved QoS by 21% over the Greedy approach. While the IPA method achieves high QoS, it often does so at a significantly higher resource cost, whereas OPD maintains a more efficient balance.
- Scalability and Speed: As pipeline complexity increased (more stages and model variants), OPD's decision-making speed remained stable, performing up to 212% faster than IPA for complex 4-stage pipelines.
- Robustness: Temporal analysis confirmed that OPD maintains a much steadier QoS curve during traffic spikes, avoiding the massive performance dips seen in Random and Greedy methods.
Conclusion and Future Directions
OPD demonstrates that RL-based adaptive configuration is a viable and efficient solution for managing complex inference pipelines at the edge. While the current work focuses on CPU allocation for linear pipelines, future research will extend the framework to include GPU resource management and more complex Directed Acyclic Graph (DAG) structures. Additionally, ensuring the security and stability of RL-driven infrastructure remains a priority for production-ready edge deployments.
Summary updated