Realizing Unaligned Block-wise Pruning for DNN Acceleration on Mobile Devices

Hayun Lee, Dongkun ShinarXiv 2024 · DOI

Introduction

Deep Neural Networks (DNNs) have become essential for mobile applications, yet their computational demands often exceed the capabilities of mobile hardware. Pruning—the process of removing non-essential weights—is a primary strategy to address this. However, researchers face a persistent trade-off between model accuracy and hardware efficiency.

Traditional Channel-wise pruning (CP) is hardware-friendly but coarse, often significantly degrading accuracy. Conversely, Element-wise pruning (EP) maintains high accuracy by removing individual weights but results in irregular sparse matrices that are inefficient for mobile CPUs. Block-wise Pruning (BP) serves as a middle ground, pruning small blocks of weights (e.g., $1 \times N$).

The Pruning Trade-off

Most existing block-wise methods rely on Aligned Block-wise Pruning (ABP), where blocks must start at fixed grid intervals. While this simplifies hardware implementation, it restricts the pruner's ability to retain the most important weights. This paper introduces Unaligned Block-wise Pruning (UBP), which removes these grid constraints, allowing blocks to be placed anywhere to maximize weight preservation.

Comparison of pruning granularities showing the flexibility of Unaligned Block-wise Pruning (UBP).

As shown in Figure 1, UBP preserves a higher total weight magnitude ($\sum |w| = 122$) compared to ABP (114) and CP (108), approaching the flexibility of fine-grained EP (129) while maintaining a block structure.

Technical Innovations

Despite its potential, UBP has been historically impractical due to two main hurdles: the computational cost of finding optimal unaligned blocks during training and the inference overhead caused by overlapping output tiles. The authors propose two innovations to overcome these challenges.

1. BED: Block Expansion and Division

Finding the absolute best set of unaligned blocks is a combinatorial problem typically solved via slow Dynamic Programming. To make UBP viable for iterative training, the authors developed Block Expansion and Division (BED). This "pseudo-optimal" algorithm uses a fast greedy search but includes a mechanism to "rescue" important weights that would otherwise be excluded due to block overlap. BED is significantly faster than traditional optimal algorithms while achieving nearly identical weight importance scores.

2. WROS: Weight Rotating and Output Stationary Dataflow

In unaligned pruning, the lack of a fixed grid means that output tiles often overlap, which naively would require frequent and slow register-copying on a mobile CPU. To solve this, the authors propose Weight Rotating and Output Stationary (WROS) dataflow.

The WROS dataflow eliminates register-copying overhead by rotating weights offline.

By "rotating" the weights offline based on their unaligned starting positions, the inference engine can keep output values stationary in CPU registers during computation. This software-hardware co-design ensures that UBP kernels achieve the same execution speed as aligned kernels, effectively removing the "speed tax" associated with unaligned flexibility.

Key Results and Evaluation

The framework was evaluated using ImageNet on MobileNetV1 and ResNet50 architectures. The results demonstrate that UBP provides a superior accuracy-to-latency profile:

  • Accuracy: At 90% sparsity, UBP achieved a 1.3% higher accuracy than ABP for MobileNetV1 and 0.36% higher for ResNet50.
  • Efficiency: On a Samsung Galaxy S20 (Snapdragon 865), UBP models achieved a 2.0x to 2.5x speedup over dense models at 70% sparsity.
  • Latency Parity: Thanks to WROS, the latency of UBP models was nearly identical to that of ABP models, proving that the added flexibility does not hinder real-time performance.

Conclusion

This work demonstrates that unaligned block-wise pruning is not only theoretically superior for accuracy but also practically efficient for mobile deployment. By combining the BED algorithm for fast training and the WROS dataflow for optimized inference, the authors have bridged the gap between fine-grained accuracy and structured hardware speed, providing a robust framework for deploying high-performance DNNs on resource-constrained devices.

Summary updated

BibTeX
@misc{lee2024realizing,
  author = {Hayun Lee and Dongkun Shin},
  title = {{Realizing Unaligned Block-wise Pruning for DNN Acceleration on Mobile Devices}},
  year = {2024},
  eprint = {2407.19644},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.19644},
}
Figure