MAPLE-X: Latency Prediction with Explicit Microprocessor Prior Knowledge

Saad Abbasi, Alexander Wong, Mohammad Javad ShafieearXiv 2022

Abstract

Deep neural network (DNN) latency characterization is a time-consuming process and adds significant cost to Neural Architecture Search (NAS) processes when searching for efficient convolutional neural networks for embedded vision applications. DNN Latency is a hardware dependent metric and requires direct measurement or inference on target hardware. A recently introduced latency estimation technique known as MAPLE predicts DNN execution time on previously unseen hardware devices by using hardware performance counters. Leveraging these hardware counters in the form of an implicit prior, MAPLE achieves state-of-the-art performance in latency prediction. Here, we propose MAPLE-X which extends MAPLE by incorporating explicit prior knowledge of hardware devices and DNN architecture latency to better account for model stability and robustness. First, by identifying DNN architectures that exhibit a similar latency to each other, we can generate multiple virtual examples to significantly improve the accuracy over MAPLE. Secondly, the hardware specifications are used to determine the similarity between training and test hardware to emphasize training samples captured from comparable devices (domains) and encourages improved domain alignment. Experimental results using a convolution neural network NAS benchmark across different types of devices, including an Intel processor that is now used for embedded vision applications, demonstrate a 5% improvement over MAPLE and 9% over HELP. Furthermore, we include ablation studies to independently assess the benefits of virtual examples and hardware-based sample importance.

Introduction

Designing efficient AI for edge devices, such as smartphones or embedded sensors, necessitates Neural Architecture Search (NAS). NAS is an automated process that evaluates thousands of model designs to optimize the trade-off between accuracy and speed. However, the primary bottleneck in this process is latency characterization. Accurate latency measurement typically requires deploying models on target hardware, a process that can take months for large search spaces. While latency predictors aim to mitigate this, modern processors with parallel execution and out-of-order processing make accurate estimation difficult. MAPLE-X addresses these challenges by leveraging explicit prior knowledge to achieve high accuracy with minimal target-device data.

Methodology

MAPLE-X builds upon the MAPLE framework by introducing two explicit mechanisms for utilizing prior knowledge:

  1. Hardware-based Importance Sampling: Recognizing that training data from similar hardware is more valuable, MAPLE-X uses physical specifications (core count, clock speed, and thermal design power) to calculate similarity scores. This allows the model to prioritize "lessons" learned from comparable devices, improving domain alignment.
  2. DNN Latency Neighborhood Prior (Virtual Examples): While simple layer-wise predictors often fail at absolute latency estimation on complex hardware, they are highly effective at predicting relative latency. MAPLE-X identifies "neighborhoods" of similar architectures and uses a single real measurement to generate multiple "virtual examples," effectively augmenting the training set for the target device.
Overview of the MAPLE-X framework, illustrating hardware-based importance sampling and the generation of virtual examples via DNN neighborhoods.

Key Insights: The Relative Advantage

A core insight of MAPLE-X is the "Relative Advantage." Mathematical models that struggle to predict exact execution times (absolute latency) can still accurately determine if one model is faster than another (relative latency). By exploiting this high correlation, MAPLE-X creates synthetic data that stabilizes training, especially when only a few real-world samples are available.

Correlation between layer-wise latency predictions and true measured latency across different hardware platforms, justifying the use of relative latency for virtual example generation.

Experimental Results

The framework was evaluated using NASBench-X, featuring 15,625 unique CNN designs across six diverse hardware platforms (Intel i5-7600k, i9-9920X, Xeon-6230, and NVIDIA GTX 1070, RTX 2080Ti, and RTX 6000).

  • Accuracy: Using a 10% error-bound metric, MAPLE-X achieved a mean accuracy of 90%, significantly outperforming the original MAPLE (85%) and HELP (81%).
  • Efficiency: These state-of-the-art results were achieved using only three adaptation points (real measurements) from the target device.
  • Ablation Study: Results confirmed that virtual examples contributed a 2% accuracy boost, while hardware-based importance sampling added 3%, validating the necessity of both components.

Conclusion

MAPLE-X demonstrates that incorporating explicit hardware and architectural priors significantly enhances the robustness and accuracy of latency prediction. By utilizing virtual examples and hardware-aware sampling, the model achieves high stability even with extremely limited target data. Future work may extend this framework to other critical embedded metrics, such as energy consumption and memory footprint.

Summary updated

BibTeX
@misc{abbasi2022maple,
  author = {Saad Abbasi and Alexander Wong and Mohammad Javad Shafiee},
  title = {{MAPLE-X: Latency Prediction with Explicit Microprocessor Prior Knowledge}},
  year = {2022},
  eprint = {2205.12660},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.12660},
}
Figure