TL;DR
This paper introduces EvoLP, a novel framework for accurately predicting the inference latency of deep learning models on resource-constrained edge devices. EvoLP uses a self-evolving mechanism to continuously improve its prediction accuracy during model compression, enabling better trade-offs between model accuracy and strict latency requirements.
What Problem Does This Paper Address?
Deploying deep learning models on edge devices is becoming increasingly common, driven by applications like augmented reality and autonomous driving that require real-time performance. However, edge devices have limited computational resources, necessitating model compression. A critical constraint for these applications is inference latency, which must be strictly met. The challenge lies in accurately predicting this latency. Measuring latency directly on real edge devices is time-consuming and expensive, especially when exploring a vast search space of compressed models. Existing methods like look-up tables (LUTs) and hardware simulators have limitations, and learning-based approaches often require extensive sampling and can struggle with the dynamic nature of model compression where layer configurations change continuously.
Methods
EvoLP tackles this problem with a three-pronged approach:
- Model Sampling: Instead of sampling from the entire potential search space, EvoLP focuses on the specific model being compressed. It categorizes layers into "constant" (trivial latency variation) and "variable" (significant variation) layers. On-device latency is measured for constant layers, while variable layers are sampled based on their configuration ranges. This significantly reduces the sampling effort.
- Latency Predictor Generation: A Multi-Layer Perceptron (MLP) neural network is trained on a "layer pool" of sampled single-layer models. This MLP, termed Layer-Wise Latency Predictor (LWLP), learns to predict the latency of individual layers based on their configurations.
- Self-Evolving Latency Predictor: This is the core innovation. During the model compression process, an "evolution matrix" (EM) is introduced. This matrix, along with the predicted latencies of individual layers, is used to estimate the overall model latency. The EM is then updated using stochastic gradient descent based on the difference between predicted and actual latencies measured on the edge device. This "evolutionary" process allows the predictor to become more precise, especially as the model approaches the target latency constraint.
Datasets
The paper does not explicitly list specific datasets used for training the MLP predictor or for evaluating the model compression. However, it mentions that the experimental evaluation uses four DNNs (VGG, ResNet, Inception, MobileNet) and that the model compression evaluation is performed using the "ImageNet-100 dataset" [10].
Key Insights and Ideas
- Model-Specific Sampling is Key: Focusing latency prediction efforts on the model being compressed, rather than a generic, massive search space, dramatically improves efficiency.
- Evolutionary Refinement for Latency: The self-evolving mechanism is crucial. Latency prediction accuracy near the strict latency constraint is paramount for effective model compression, and EvoLP's ability to adapt in real-time during compression is a significant advantage.
- MLP as a Lightweight Predictor: The use of a simple MLP for layer-wise prediction is computationally efficient and effective for capturing latency patterns.
- Bridging the Gap Between Prediction and Reality: By incorporating an evolution scheme that learns from actual on-device measurements, EvoLP can better account for complex runtime features that are often missed by static predictors.
Key Results
EvoLP demonstrates superior performance compared to state-of-the-art latency predictors:
- Higher Accuracy: EvoLP achieves significantly higher ±5% accuracy (a measure of prediction precision) across various edge devices and model variants compared to methods like FLOPs, FLOPsE, ZBNLP, nn-Meter, and TALM.
- Improved Compression: When integrated into a model compression framework, EvoLP effectively guides the compression process to achieve higher model accuracy while strictly adhering to latency constraints. Table II shows examples of achieving significantly reduced latency (e.g., from 115ms to 40ms for VGGS on Edge GPU1) with minimal accuracy degradation (e.g., from 84.54% to 82.62%).
- Efficiency: The model-specific sampling and efficient MLP predictor contribute to a faster predictor building process.
Limitations and Future Work
- Limitations: The paper acknowledges that while EvoLP significantly improves precision, especially near the latency constraint, it still relies on real latency measurements in the final epochs of model compression to ensure meeting strict constraints. This suggests that perfect prediction without any real measurements might still be an open challenge.
- Future Work: The authors suggest that EvoLP's framework is not limited to latency prediction and can be extended to predict other performance metrics like power consumption and accuracy. They also propose further exploration of these aspects in future research.
Summary updated