All-in-One: A Highly Representative DNN Pruning Framework for Edge Devices with Dynamic Power Management

Yifan Gong, Zheng Zhan, Pu Zhao, Yushu Wu, Chao Wu, Caiwen Ding, Weiwen Jiang, Minghai Qin, Yanzhi Wang

Introduction

Deep Neural Networks (DNNs) are increasingly deployed on edge devices for real-time applications such as object detection and augmented reality. However, these devices face a significant challenge: unstable energy support. Mobile hardware utilizes Dynamic Voltage and Frequency Scaling (DVFS) to manage battery life and thermal output. When a device's battery is low or its temperature is high, the system throttles the GPU/CPU frequency. For real-time DNNs, this frequency drop leads to inconsistent inference speeds, potentially causing missed deadlines or a degraded user experience.

The "All-in-One" framework addresses this by enabling a single DNN to maintain consistent latency across varying hardware frequencies through dynamic pruning, without the prohibitive memory overhead of storing multiple models.

The Challenge: Latency in the Face of DVFS

In real-time edge computing, predictable performance is often as critical as peak performance. A model optimized for a high-performance mode (e.g., 587MHz) may lag significantly when the device switches to a power-saving mode (e.g., 305MHz). Traditional approaches to this problem involve training multiple models for different power states, but this is impractical for memory-constrained edge devices. The All-in-One framework seeks to achieve stable inference latency by adjusting model sparsity on-the-fly to compensate for hardware frequency changes.

The All-in-One Framework

The core innovation of All-in-One is its ability to represent multiple pruning ratios within a single set of weights. This is achieved through several key technical components:

1. Parametric Pruning with Soft Masks

Unlike traditional magnitude-based pruning, All-in-One learns "importance scores" for groups of weights using a soft mask. This allows the model to learn which weights are task-critical rather than assuming large weights are inherently more important.

2. Switchable Thresholds

To avoid the storage overhead of multiple binary masks, the framework stores a single soft mask and a set of predefined threshold values ($thres_n$). By applying a higher threshold, the model instantly becomes more sparse, utilizing a subset of the weights used in denser modes. This "subset property" ensures that switching between performance modes does not require reloading weights into memory.

3. Switchable Batch Normalization (SBN)

Different levels of sparsity change the mean and variance of feature maps, which can degrade accuracy if not addressed. All-in-One employs independent Batch Normalization parameters for each sparsity level. This maintains high accuracy across all modes with negligible storage overhead (less than 1% of the total model size).

4. Hardware-Friendly Structured Pruning

The framework supports both pattern-based and block-based pruning. These structured schemes are designed to be compatible with mobile GPUs, ensuring that theoretical reductions in Multiply-Accumulate (MAC) operations translate into real-world speedups.

Experimental Evaluation

The authors evaluated the framework on standard image classification benchmarks and real-world hardware:

  • Benchmarks: CIFAR-10 (ResNet-18, 20, 32) and ImageNet (ResNet-18, MobileNet-v2).
  • Hardware: Latency tests were conducted on the Adreno 650 GPU of a OnePlus 8T smartphone (Snapdragon 865).

Key Results

  • Accuracy Preservation: All-in-One consistently outperformed other reconfigurable DNN methods like US-Net and Joslim. On ResNet-32 (CIFAR-10), it maintained >94% accuracy across all modes, whereas baseline methods often dropped below 92%.
  • Latency Stability: The framework achieved remarkable stability. On ImageNet with ResNet-18, the variance in latency across different hardware frequencies was reduced by up to 381× compared to a static model. While a standard model's latency fluctuated with frequency, All-in-One kept latency nearly flat (e.g., 21.9ms vs 21.6ms).
  • Memory Efficiency: The All-in-One model saved 54.17% of the memory required by a single dense ResNet-18, while providing the flexibility of multiple performance "gears" with only 0.83% extra parameters compared to a single sparse model.

Discussion and Limitations

While All-in-One provides a robust solution for dynamic power management, its real-world efficacy is tied to software support. The achieved speedups rely on specialized compiler optimizations (such as those in PatDNN) to handle structured pruning effectively. Furthermore, while the method is demonstrated on image classification, its performance on more complex architectures like Transformers or Generative Adversarial Networks (GANs) remains an area for future exploration.

Finally, while thresholds are currently predefined based on target MAC counts, future iterations of the framework could benefit from automated mapping between specific hardware frequency steps and optimal pruning thresholds to further streamline deployment.

Conclusion

The All-in-One framework represents a significant step forward for edge AI, decoupling model performance from hardware instability. By integrating switchable thresholds and batch normalization into a single model, it provides a memory-efficient way to ensure consistent, real-time performance regardless of a device's power state.

Summary updated

BibTeX
@inproceedings{gong2022all,
  author = {Yifan Gong and Zheng Zhan and Pu Zhao and Yushu Wu and Chao Wu and Caiwen Ding and Weiwen Jiang and Minghai Qin and Yanzhi Wang},
  title = {{All-in-One: A Highly Representative DNN Pruning Framework for Edge Devices with Dynamic Power Management}},
  booktitle = {ICCAD},
  year = {2022},
  url = {https://openreview.net/forum?id=fmH9gqdDh1},
}
Figure