Abstract
The increased memory and processing capabilities of today's edge devices create opportunities for greater edge intelligence. In the domain of vision, the ability to adapt a Convolutional Neural Network's (CNN) structure and parameters to the input data distribution leads to systems with lower memory footprint, latency and power consumption. However, due to the limited compute resources and memory budget on edge devices, it is necessary for the system to be able to predict the latency and memory footprint of the training process in order to identify favourable training configurations of the network topology and device combination for efficient network adaptation. This work proposes perf4sight, an automated methodology for developing accurate models that predict CNN training memory footprint and latency given a target device and network. This enables rapid identification of network topologies that can be retrained on the edge device with low resource consumption. With PyTorch as the framework and NVIDIA Jetson TX2 as the target device, the developed models predict training memory footprint and latency with 95% and 91% accuracy respectively for a wide range of networks, opening the path towards efficient network adaptation on edge GPUs.
Introduction
As artificial intelligence transitions from centralized cloud servers to edge devices—such as autonomous vehicles, drones, and IoT sensors—there is an increasing requirement for models to adapt to dynamic environments post-deployment. For instance, an autonomous vehicle may need to fine-tune its vision system when transitioning between different weather conditions or terrains. However, performing on-device training on platforms like the NVIDIA Jetson TX2 presents significant challenges due to limited and shared memory resources.
Exceeding the memory budget during training can lead to system crashes, which is unacceptable in safety-critical applications. Traditional methods involve manual profiling of every potential network configuration, a process that is prohibitively time-consuming. This paper introduces perf4sight, an automated toolflow designed to predict the resource costs of CNN training a priori, facilitating safe and efficient on-device model adaptation.
Methodology
The perf4sight toolflow employs a hybrid approach that integrates analytical modeling with machine learning to capture the nuances of real-world hardware behavior. The methodology is built upon three primary components:
- Analytical Modeling: The system extracts "static" features from the network architecture, such as layer count and filter dimensions. It specifically accounts for the various algorithms used by GPUs for convolutions, including Matrix Multiplication (GEMM), Fast Fourier Transform (FFT), and Winograd.
- Network-wise Profiling: Unlike prior research that analyzed layers in isolation, perf4sight profiles complete networks. This captures the holistic behavior of frameworks like PyTorch, including speculative memory allocation and inter-layer interactions.
- Random Forest Predictors: GPU libraries like NVIDIA’s cuDNN utilize proprietary heuristics to select optimal algorithms. To model this "black-box" behavior, perf4sight uses Random Forest models to map analytical features to observed performance metrics.
Experimental Evaluation
The toolflow was evaluated using a diverse set of state-of-the-art CNN architectures, including ResNet18, MobileNetV2, SqueezeNet, and MnasNet. To test generalization, architectures not seen during training, such as ResNet50 and GoogLeNet, were also included. Furthermore, a case study using subsets of the ILSVRC’12 (ImageNet) dataset simulated various driving environments (City, Motorway, Country-side, and Off-road) to demonstrate real-world utility.
Results and Discussion
The experimental results demonstrate that perf4sight achieves high predictive accuracy, with 95% accuracy for memory footprint and 91% accuracy for latency on the target NVIDIA Jetson TX2 device.
Key insights from the evaluation include:
- Training Complexity: Training is significantly more complex than inference; the backward pass and gradient updates introduce unique operations and memory demands that perf4sight successfully models.
- Modeling the "Black Box": By providing features for all potential convolution algorithms, the Random Forest model effectively learns the selection heuristics of the cuDNN library.
- Efficiency in Search: In scenarios involving Once-For-All (OFA) networks with thousands of sub-network candidates, perf4sight provides a 200x speedup over manual profiling, reducing an 11-day task to approximately one hour.
- Comparison to State-of-the-Art: perf4sight significantly outperforms existing tools like DNNMem, reducing the error rate for ResNet50 from 17.4% to 2.45%.
Conclusion
perf4sight provides a robust framework for predicting the performance of CNN training on edge GPUs. While the tool shows high accuracy, some performance degradation occurs with highly unique architectures like GoogLeNet. Future research will focus on expanding the basis of networks to include more diverse building blocks, adapting the toolflow for alternative hardware backends and software frameworks, and integrating it directly into automated Network Architecture Search (NAS) loops for real-time edge adaptation.
Summary updated