Loading Cost-Aware Model Caching and Request Routing for Cooperative Edge Inference

Mianyang Yao, Long Chen, Jun Zhang, Jiale Huang, Jigang WuICC 2022

Introduction

As mobile applications increasingly integrate sophisticated AI features, the demand for low-latency inference has surged. "Edge Inference" has emerged as a critical solution, offloading Deep Neural Network (DNN) tasks to nearby edge servers rather than distant cloud data centers. However, edge servers face a significant hardware constraint: limited RAM. While a server might have dozens of models stored on its disk, only a few can reside in fast-access memory simultaneously.

Most existing literature overlooks the "loading cost"—the non-trivial time required to swap a model from disk to RAM. This paper addresses this gap by proposing a joint optimization framework for model caching and request routing that explicitly accounts for loading delays and batching efficiencies.

System Architecture and Problem Formulation

The researchers consider a cooperative edge environment where multiple Small Base Stations (SBSs), each equipped with an edge server, are interconnected via high-speed wired links. End devices generate inference requests for various DNN models (e.g., VGG16, ResNet34).

System architecture for cooperative edge inference, highlighting the distinction between cached models and those requiring loading from disk.

As shown in the architecture above, the system must decide whether to process a request locally, route it to a neighboring server, or wait to batch it with other requests. Crucially, if the required model is not in RAM, the server must incur a loading penalty. The objective is to maximize total system throughput while ensuring every request meets its specific latency deadline.

The Online Caching Algorithm (OCA)

Because the joint optimization of caching and routing is NP-hard, the authors developed the Online Caching Algorithm (OCA). This approach utilizes a randomized rounding technique to make discrete decisions in real-time:

  1. Linear Relaxation: The complex integer problem is first relaxed into a linear program that can be solved efficiently.
  2. Observation Windows: The algorithm operates over short time horizons, predicting request patterns to optimize caching decisions.
  3. Randomized Rounding: Fractional solutions from the linear program (e.g., "cache 60% of a model") are treated as probabilities to decide which models to actually load into RAM.
  4. Loading-Aware Constraints: The model explicitly includes a variable for loading time ($\lambda$), preventing the scheduler from assigning tasks to a model that is still being transferred from disk.

Performance Evaluation

The framework was evaluated using popular DNN architectures—VGG16, ResNet34, and AlexNet—profiled on standard hardware (Intel i7-6700 CPU and Nvidia GTX 1080Ti GPU). The study also included a real-world testbed using Raspberry Pi 4 units to simulate end devices.

Key Results

In large-scale simulations, OCA demonstrated a 42.7% throughput improvement over the Service Placement and Request routing (SPR) baseline. The algorithm proved highly effective at balancing the trade-off between the cost of loading a new model and the benefits of processing requests locally versus routing them.

Throughput performance of the OCA algorithm compared to the SPR baseline and theoretical Upper Bound (UB) under varying latency requirements.

As illustrated in the results above, OCA consistently outperforms the baseline across different latency requirements, achieving approximately 65.5% of the theoretical upper bound. In the physical Raspberry Pi testbed, the algorithm maintained its edge, showing a 5.6% improvement and proving its viability for real-world hardware deployments.

Conclusion

By incorporating model loading costs into the optimization loop, this research provides a more realistic and efficient framework for edge AI. The OCA algorithm offers a practical way to manage limited edge resources while providing provable performance guarantees. Future work will focus on decentralizing the control logic and using game-theoretic models to incentivize cooperation between independent edge service providers.

Summary updated

BibTeX
@inproceedings{yao2022loading,
  author = {Mianyang Yao and Long Chen and Jun Zhang and Jiale Huang and Jigang Wu},
  title = {{Loading Cost-Aware Model Caching and Request Routing for Cooperative Edge Inference}},
  booktitle = {ICC},
  year = {2022},
  doi = {10.1109/icc45855.2022.9838823},
}
Figure