Abstract
Modern deep neural networks must demonstrate state-of-the-art accuracy while exhibiting low latency and energy consumption. As such, neural architecture search (NAS) algorithms take these two constraints into account when generating a new architecture. However, efficiency metrics such as latency are typically hardware dependent requiring the NAS algorithm to either measure or predict the architecture latency. Measuring the latency of every evaluated architecture adds a significant amount of time to the NAS process. Here we propose Microprocessor A Priori for Latency Estimation (MAPLE) that leverages hardware characteristics to predict deep neural network latency on previously unseen hardware devices. MAPLE takes advantage of a novel quantitative strategy to characterize the underlying microprocessor by measuring relevant hardware performance metrics, yielding a fine-grained and expressive hardware descriptor. The CPU-specific performance metrics are also able to characterize GPUs, resulting in a versatile descriptor that does not rely on the availability of hardware counters on GPUs or other deep learning accelerators. We provide experimental insight into this novel strategy. Through this hardware descriptor, MAPLE can generalize to new hardware via a few shot adaptation strategy, requiring as few as 3 samples from the target hardware to yield 6% improvement over state-of-the-art methods requiring as much as 10 samples. Experimental results showed that, increasing the few shot adaptation samples to 10 improves the accuracy significantly over the state-of-the-art methods by 12%. We also demonstrate MAPLE identification of Pareto-optimal DNN architectures exhibit superlative accuracy and efficiency. The proposed technique provides a versatile and practical latency prediction methodology for DNN run-time inference on multiple hardware devices while not imposing any significant overhead for sample collection.
Introduction
Designing deep neural networks (DNNs) is no longer just about accuracy; for real-world applications like autonomous driving or mobile face ID, latency is just as critical. However, latency is hardware-dependent—a model that is fast on an Intel CPU might be sluggish on an NVIDIA GPU. To find the best models, researchers use Neural Architecture Search (NAS), which evaluates thousands of potential designs. Measuring the actual speed of every single design on every possible device is a computational nightmare. While latency predictors exist to estimate these speeds, they usually require a large number of samples from a new device to learn its behavior. MAPLE addresses the bottleneck of few-shot adaptation: accurately predicting latency on a device never seen before, using minimal new data.
Methods
The MAPLE framework introduces a hardware-aware regression model based on three key innovations:
- Quantitative Hardware Descriptor: Instead of treating hardware as a "black box," MAPLE characterizes a device by measuring 10 specific hardware performance counters (e.g., L1 cache misses, instruction counts, data loads).
- CPU-as-Proxy Strategy: CPU performance counters can characterize GPUs. Because the CPU and GPU are tightly coupled during inference, the CPU's internal metrics reflect the GPU's behavior, bypassing the lack of accessible hardware counters on many accelerators.
- Operator-Level Characterization: MAPLE measures these counters while executing the 15 basic "primitive" operations (e.g., 3x3 convolution) that make up the search space, creating a fine-grained "fingerprint."
The final model is a dual-stream neural network that merges neural network architecture encoding with the hardware descriptor to predict latency.
Results and Discussion
MAPLE was evaluated using the NAS-Bench-201 benchmark across a hardware pool of 8 diverse devices, including various Intel CPUs and NVIDIA GPUs.
Key Insights: * Hardware Fingerprinting: Euclidean distance maps of the hardware descriptors proved they are unique. Even similar GPUs (e.g., Titan X and Titan XP) paired with the same CPU produced distinct fingerprints. * Few-Shot Efficiency: MAPLE requires only 3 samples from a new device to achieve a 6% accuracy improvement over the previous state-of-the-art (HELP), which required 10 samples. With 10 samples, MAPLE improves accuracy by 12%. * Pareto Optimality: The model successfully identifies Pareto-optimal architectures—models offering the highest accuracy for the lowest latency.
Conclusion
MAPLE provides a versatile and practical latency prediction methodology for DNN inference on multiple hardware devices without significant overhead. While it currently relies on tools like Linux perf, future work could explore its application to isolated AI accelerators and more diverse search spaces.
Summary updated