Thermal-Aware on-Device Inference Using Single-Layer Parallelization with Heterogeneous Processors

Jinghui Zhang, Yuchen Wang, Tianyu Huang, Fang Dong, Wei Zhao, Dian ShenTsinghua 2022

Abstract

Numerous neural network (NN) applications are now being deployed to mobile devices. These applications usually have large amounts of calculation and data while requiring low inference latency, which poses challenges to the computing ability of mobile devices. Moreover, devices' life and performance depend on temperature. Hence, in many scenarios, such as industrial production and automotive systems, where the environmental temperatures are usually high, it is important to control devices' temperatures to maintain steady operations. In this paper, we propose a thermal-aware channel-wise heterogeneous NN inference algorithm. It contains two parts, the thermal-aware dynamic frequency (TADF) algorithm and the heterogeneous-processor single-layer workload distribution (HSWD) algorithm. Depending on a mobile device's architecture characteristics and environmental temperature, TADF can adjust the appropriate running speed of the central processing unit and graphics processing unit, and then the workload of each layer in the NN model is distributed by HSWD in line with each processor's running speed and the characteristics of the layers as well as heterogeneous processors. The experimental results, where representative NNs and mobile devices were used, show that the proposed method can considerably improve the speed of the on-device inference by 21%-43% over the traditional inference method.

Introduction

Running deep learning models on mobile and edge devices is a balancing act between speed and heat. Most mobile System-on-Chips (SoCs) house both a CPU and a GPU. While the GPU is generally the workhorse for matrix math, using it at full capacity generates significant heat. In high-temperature environments—such as a factory floor or inside a car—devices quickly hit thermal limits, leading to "throttling" where clock speeds are slashed to protect hardware, causing inference latency to spike.

Existing solutions often treat the CPU and GPU as separate silos or split tasks at a coarse level (e.g., Layer 1 on CPU, Layer 2 on GPU). This paper introduces a dual-strategy approach to use both processors simultaneously for a single layer without triggering a thermal meltdown.

Methodology: TADF and HSWD

The proposed framework consists of two main components designed to optimize the "sweet spot" of heterogeneity:

  1. Thermal-Aware Dynamic Frequency (TADF) Algorithm: The researchers developed a power model that accounts for both leakage power (which increases with temperature) and dynamic power (which increases cubically with clock frequency). TADF uses this model to predict the steady-state temperature and finds the highest possible clock frequencies for both the CPU and GPU that keep the device below a safe temperature threshold ($T_{max}$).

  2. Heterogeneous-processor Single-layer Workload Distribution (HSWD) Algorithm: Instead of assigning whole layers to one processor, HSWD performs channel-wise parallelization. By splitting work at the layer level, the system can adapt to the specific characteristics of each layer (e.g., compute-bound vs. memory-bound), ensuring neither processor sits idle.

Single-layer workload distribution (HSWD) for convolutional, fully connected, and pooling layers.
  • For Convolutional and Fully Connected layers: Filters are divided between the CPU and GPU. Both processors work on the same input data but produce different parts of the output channels.
  • For Pooling layers: The input data itself is split across channels, and each processor handles a subset.

Hardware Platform and Integrated Architecture

The researchers evaluated their approach using AlexNet and VGG16 on an Nvidia Jetson Nano. This platform features an integrated architecture where the CPU and GPU share the same physical memory (DRAM).

Integrated architecture of the Nvidia Jetson Nano, featuring shared DRAM between CPU and GPU.

This shared memory is crucial because it minimizes the time-consuming data transfer overhead that usually plagues heterogeneous computing. By offloading a specific portion of a layer's channels to the CPU, the GPU can run slightly cooler or finish its portion sooner, leading to a lower overall bottleneck latency.

Key Results

The proposed method was compared against CPU-only, GPU-only, and fixed-ratio partitioning methods.

  • Latency Reduction: In AlexNet, HSWD reduced average latency by 21%–36%. In the more complex VGG16, the reduction reached 32%–43%.
  • Thermal Stability: At an ambient temperature of 40°C (104°F), the device maintained a steady temperature below 85°C without the erratic frequency drops seen in traditional high-performance modes.
  • Efficiency: The method was particularly effective for heavy layers (like Conv4 and Conv7 in VGG16), achieving nearly a 50% latency decrease in those specific instances by perfectly balancing the load.

Conclusion and Future Work

This research demonstrates that fine-grained, thermal-aware workload distribution can significantly enhance on-device inference performance. While the results on AlexNet and VGG16 are promising, future work could explore modern architectures like Transformers or Depthwise Separable Convolutions. Additionally, adapting the system for dynamic environments where ambient temperatures change rapidly remains an open area for exploration.

Summary updated

BibTeX
@inproceedings{zhang2022thermal,
  author = {Jinghui Zhang and Yuchen Wang and Tianyu Huang and Fang Dong and Wei Zhao and Dian Shen},
  title = {{Thermal-Aware on-Device Inference Using Single-Layer Parallelization with Heterogeneous Processors}},
  booktitle = {Tsinghua},
  year = {2022},
  doi = {10.26599/tst.2021.9010075},
}
Figure