Abstract
The ability to accurately predict deep neural network (DNN) inference performance metrics, such as latency, power, and memory footprint, for an arbitrary DNN on a target hardware platform is essential to the design of DNN based models. This ability is critical for the (manual or automatic) design, optimization, and deployment of practical DNNs for a specific hardware deployment platform. Unfortunately, these metrics are slow to evaluate using simulators (where available) and typically require measurement on the target hardware. This work describes PerfSAGE, a novel graph neural network (GNN) that predicts inference latency, energy, and memory footprint on an arbitrary DNN TFlite graph. In contrast, previously published performance predictors can only predict latency and are restricted to pre-defined construction rules or search spaces. This paper also describes the EdgeDLPerf dataset of 134,912 DNNs randomly sampled from four task search spaces and annotated with inference performance metrics from three edge hardware platforms. Using this dataset, we train PerfSAGE and provide experimental results that demonstrate state-of-the-art prediction accuracy with a Mean Absolute Percentage Error of <5% across all targets and model search spaces.
Introduction
Deploying Deep Neural Networks (DNNs) on "edge" devices—like smartphones, IoT sensors, or embedded controllers—is a brutal balancing act. Developers must maximize accuracy while staying within strict limits for battery life (energy), speed (latency), and RAM (memory footprint). Traditionally, measuring these metrics requires either physical access to the hardware or slow, complex simulators. This is a major bottleneck for Neural Architecture Search (NAS), where thousands of model variants need to be evaluated quickly.
Existing performance predictors often fall short because they are "locked" to specific types of models (like standard CNNs) or only predict latency, ignoring the critical energy and memory constraints of edge computing. Furthermore, many older predictors assume total latency is just the sum of individual layer latencies. This fails on hardware accelerators (NPUs/TPUs) that use complex graph-level optimizations.
The PerfSAGE Approach
PerfSAGE leverages the power of Graph Neural Networks (GNNs) to handle the "arbitrary" nature of modern AI models. Instead of using hand-tuned rules, PerfSAGE treats a TFLite model graph as an input. It uses message-passing layers to learn how different operations (nodes) and tensors (edges) interact to influence performance.
A critical technical innovation is Categorical Feature Encoding (CFE). The impact of a parameter (like "output dimension") varies wildly between a Convolution layer and a simple Addition layer. CFE uses a trainable lookup table to provide operation-specific weights, allowing the model to distinguish between different types of layers even if they share similar hyperparameters. This is particularly important for newer architectures like Vision Transformers (ViTs), which lack a single dominant operator type.
To handle the massive numerical range of performance data, the authors combined Mean Absolute Percentage Error (MAPE) with Mean Squared Error (MSE) in a hybrid loss function. This ensures the predictor remains accurate for both tiny, ultra-fast models and larger, more complex ones.
The EdgeDLPerf Dataset
To train and validate PerfSAGE, the researchers introduced EdgeDLPerf, a massive new benchmark dataset:
- Scale: 134,912 unique DNNs.
- Diversity: Models were sampled from four distinct search spaces: CNNs for CIFAR10 and ImageNet, Keyword Spotting (CNN-KWS), and Vision Transformers (ViT-CIFAR100).
- Hardware Targets: Performance was benchmarked on three distinct platforms: CPU (NVIDIA Jetson TX2), NPU (ARM Ethos-U), and TPU (Google EdgeTPU).
Experimental Results
PerfSAGE achieved a Mean Absolute Percentage Error (MAPE) of <5% across all hardware targets and model search spaces. It demonstrated state-of-the-art accuracy, significantly outperforming previous predictors like Eagle (BRP-NAS), which saw errors skyrocket to over 40% when tested on the diverse EdgeDLPerf dataset.
Unlike many competitors that only predict latency, PerfSAGE successfully predicted energy and memory usage with similar high accuracy. It also accurately predicted performance on NPUs and TPUs, areas where previous non-GNN predictors (like nn-Meter) have historically struggled.
Conclusion
PerfSAGE represents a significant step forward in generalized performance prediction for edge AI. By treating DNNs as arbitrary graphs and employing sophisticated encoding techniques, it provides a flexible tool for both manual and automated model design. Future work will explore expanding predictions to larger batch sizes and incorporating uncertainty estimation to further assist developers in deploying efficient edge models.
Summary updated