Many Hands Make Light Work: Accelerating Edge Inference via Multi-Client Collaborative Caching

Wenyi Liang, Jianchun Liu, Hongli Xu, Chunming Qiao, Liusheng HuangarXiv 2024

TL;DR

This paper introduces CoCa, a novel framework that accelerates edge inference by enabling multiple clients to collaboratively cache and share model inference results. CoCa tackles the challenges of non-IID and long-tail data distributions by using a server-managed global cache and dynamic client-side cache allocation, achieving significant latency reductions with minimal accuracy loss.

What Problem Does This Paper Address?

Edge inference, the process of running AI models directly on devices near data sources, is crucial for real-time applications like autonomous driving and augmented reality. These applications have strict performance requirements (Service-Level Objectives or SLOs), often demanding low latency and high accuracy. Caching intermediate inference results is a common technique to speed up these tasks. However, existing caching methods struggle when data across different edge devices is not identically distributed (non-IID) or when certain classes of data appear much more frequently than others (long-tail distributions). These data imbalances lead to reduced cache hit rates and increased latency, hindering the effectiveness of edge inference.

Methods

CoCa proposes a multi-client collaborative caching mechanism with a client-server architecture.

  • Client-Side: Each client pre-configures its model with multiple cache layers. During inference, it performs sequential lookups at these layers.
  • Server-Side: The server maintains a two-dimensional global cache that aggregates information from all clients. This global cache helps mitigate the effects of non-IID data.
  • Dynamic Cache Allocation: CoCa dynamically allocates personalized caches to each client. This allocation is based on evaluating class importance using frequency and recency of access. It specifically prioritizes frequently occurring "hot-spot" classes to address long-tail distributions.
  • Adaptive Cache Layer Activation: CoCa dynamically activates cache layers to balance the overhead of cache lookups with the potential accuracy gains.
  • Collaborative Updates: Clients periodically upload their inference status and semantic vectors to the server. The server uses this information to update the global cache, improving its representational power and thus inference accuracy.

Datasets

The paper uses the following datasets for evaluation:

  • ImageNet-100: A subset of ImageNet with 100 classes, used to simulate temporal locality by batching samples of the same class.
  • UCF101: An action recognition dataset with 101 action classes, used to simulate temporal locality and for experiments with non-IID and long-tail distributions.
  • Environmental Sound Classification-50 (ESC-50): A benchmark for environmental sound classification, used for experiments with non-IID data.

The authors also construct datasets with varying non-IID levels (using Dirichlet distribution) and long-tail distributions (exponential decay in sample sizes) to simulate real-world scenarios.

Key Insights and Ideas

  • Collaboration is Key for Non-IID Data: Simply caching locally isn't enough when data is diverse across clients. A global, shared cache that aggregates information is crucial for handling non-IID data effectively.
  • Dynamic Allocation Outperforms Static: The effectiveness of caching hinges on intelligently selecting which classes and which layers to cache. CoCa's dynamic approach, adapting to class frequency and recency, is more effective than fixed strategies.
  • Balancing Act: There's a trade-off between cache size, lookup time, and accuracy. Too many cache layers or too many hot-spot classes can increase latency. CoCa's dynamic layer activation and hot-spot class selection aim to find this optimal balance.
  • Global Updates Improve Accuracy: Periodically updating the global cache with client data not only helps with non-IID data but also improves the accuracy of cache hits by making the cached representations more representative of current data.

Key Results

CoCa demonstrates significant improvements in edge inference performance:

  • Latency Reduction: CoCa reduces inference latency by 23.01% to 45.19% across VGG, ResNet, and AST models compared to baselines like Edge-Only. It also achieves a 16.67% to 21.26% reduction on ResNet101 compared to other advanced baselines.
  • Accuracy: The framework achieves these latency reductions with a slight loss of accuracy (less than 3%).
  • Robustness to Non-IID Data: CoCa consistently reduces latency as non-IID levels increase, outperforming other baselines. For example, it shows a 9.08% latency decrease for ResNet101 at the highest non-IID level compared to the IID case.
  • Effectiveness on Long-Tail Data: CoCa achieves lower inference latency in long-tail distributions compared to uniform distributions, reducing latency by 4.01% while maintaining competitive accuracy.

Limitations and Future Work

  • Threshold Tuning: The paper acknowledges that selecting optimal thresholds for sample selection (Γ and Δ) and cache allocation requires careful tuning based on specific SLOs and empirical testing. The authors suggest thresholds that balance accuracy and absorption ratio.
  • Combinatorial Optimization: The core cache allocation problem is combinatorial and computationally complex. While CoCa proposes a heuristic Adaptive Cache Allocation (ACA) algorithm to find suboptimal solutions, finding the absolute optimal allocation remains challenging.
  • Future Work: The authors suggest investigating the specific effects of dynamic cache allocation (DCA) and global cache updates (GCU) as two main components of CoCa. They also mention exploring the impact of update cycles and the number of clients on system load and scalability.

Summary updated

Abstract

Edge inference is a technology that enables real-time data processing and analysis on clients near the data source. To ensure compliance with the Service-Level Objectives (SLOs), such as a 30% latency reduction target, caching is usually adopted to reduce redundant computations in inference tasks on stream data. Due to task and data correlations, sharing cache information among clients can improve the inference performance. However, the non-independent and identically distributed (non-IID) nature of data across different clients and the long-tail distributions, where some classes have significantly more samples than others, will reduce cache hit ratios and increase latency. To address the aforementioned challenges, we propose an efficient inference framework, CoCa, which leverages a multi-client collaborative caching mechanism to accelerate edge inference. On the client side, the model is pre-set with multiple cache layers to achieve a quick inference. During inference, the model performs sequential lookups at cache layers activated by the edge server. On the server side, CoCa uses a two-dimensional global cache to periodically aggregate information from clients, mitigating the effects of non-IID data. For client cache allocation, CoCa first evaluates the importance of classes based on how frequently and recently their samples have been accessed. CoCa then selects frequently recurring classes to address long-tail distribution challenges. Finally, CoCa dynamically activates cache layers to balance lookup overhead and accuracy. Extensive experiments demonstrate that CoCa reduces inference latency by 23.0% to 45.2% on the VGG, ResNet and AST models with a slight loss of accuracy.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
UCF101 · 100-class subsetCoCa (VGG16_BN)Lat. (average inference latency)23.05 ms-6.89 vs baselinesubset=100-class subset · backbone=VGG16_BN
Source quote
L665: CoCa │ 23.05 │ {75.73} │ 20.36 │ {74.23}
UCF101 · 100-class subsetCoCa (ResNet152)Lat. (average inference latency)34.45 mssubset=100-class subset · backbone=ResNet152
Source quote
L680: CoCa │ 34.45 │ {82.16} │ 29.53 │ {79.82}
UCF101 · 100-class subsetCoCa (ResNet152)Acc. (overall accuracy)82.16%subset=100-class subset · backbone=ResNet152
Source quote
L680: CoCa │ 34.45 │ {82.16} │ 29.53 │ {79.82}
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
UCF101 · 100-class subsetEdge-Only (VGG16_BN) baselineLat. (average inference latency)29.94 mssubset=100-class subset · backbone=VGG16_BN
Source quote
L653: \multirow{5}{*}{VGG16\_BN} │ Edge-Only │ 29.94 │ 78.12 │ 29.94 │ 78.12
UCF101 · 100-class subsetEdge-Only (ResNet152) baselineLat. (average inference latency)62.85 mssubset=100-class subset · backbone=ResNet152
Source quote
L668: \multirow{5}{*}{ResNet152} │ Edge-Only │ 62.85 │ 83.98 │ 62.85 │ 83.98
UCF101 · 100-class subsetEdge-Only (ResNet152) baselineAcc. (overall accuracy)83.98%subset=100-class subset · backbone=ResNet152
Source quote
L668: \multirow{5}{*}{ResNet152} │ Edge-Only │ 62.85 │ 83.98 │ 62.85 │ 83.98
BibTeX
@misc{liang2024many,
  author = {Wenyi Liang and Jianchun Liu and Hongli Xu and Chunming Qiao and Liusheng Huang},
  title = {{Many Hands Make Light Work: Accelerating Edge Inference via Multi-Client Collaborative Caching}},
  year = {2024},
  eprint = {2412.10382},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.10382},
}

Loading related content...

Figure