Abstract
Sparsity helps reduce the computational complexity of deep neural networks by skipping zeros. Taking advantage of sparsity is listed as a high priority in next generation DNN accelerators such as TPU. The structure of sparsity, i.e., the granularity of pruning, affects the efficiency of hardware accelerator design as well as the prediction accuracy. Coarse-grained pruning creates regular sparsity patterns, making it more amenable for hardware acceleration but more challenging to maintain the same accuracy. In this paper we quantitatively measure the trade-off between sparsity regularity and prediction accuracy, providing insights in how to maintain accuracy while having more a more structured sparsity pattern. Our experimental results show that coarse-grained pruning can achieve a sparsity ratio similar to unstructured pruning without loss of accuracy. Moreover, due to the index saving effect, coarse-grained pruning is able to obtain a better compression ratio than fine-grained sparsity at the same accuracy threshold. Based on the recent sparse convolutional neural network accelerator (SCNN), our experiments further demonstrate that coarse-grained sparsity saves about 2x the memory references compared to fine-grained sparsity. Since memory reference is more than two orders of magnitude more expensive than arithmetic operations, the regularity of sparse structure leads to more efficient hardware design.
Introduction
Deep Neural Networks (DNNs) are notoriously resource-hungry, demanding massive storage and billions of operations. To deploy them on mobile or embedded devices, researchers use pruning—deleting unnecessary weights to create "sparse" models. However, there is a fundamental tension in pruning: fine-grained pruning (deleting individual weights) preserves accuracy well but creates irregular patterns that hardware accelerators struggle to process efficiently. Conversely, coarse-grained pruning (deleting entire filters) is hardware-friendly but often degrades accuracy. This research explores the "granularity" of sparsity to find a middle ground between total randomness and rigid structures.
Methodology
The researchers systematically explore four levels of pruning granularity, ranging from irregular to regular patterns:
- Fine-grained (0-D): Individual scalar weights are pruned.
- Vector-level (1-D): Sub-kernel vectors (rows or columns within a kernel) are pruned.
- Kernel-level (2-D): Entire 2D kernels are pruned.
- Filter-level (3-D): Entire 3D filters are pruned.
Pruning is performed using a magnitude-based iterative approach. For a given grain (e.g., a vector), the L1 norm is calculated; if it falls below a threshold, the entire grain is deleted. The model is then retrained to recover accuracy. The study evaluates these methods on the ImageNet dataset across various architectures, including AlexNet, VGG-16, GoogLeNet, ResNet-50, and DenseNet-121.
Results and Discussion
A key finding is the indexing advantage of structured sparsity. In sparse models, both weight values and their indices must be stored. Fine-grained pruning requires an index for every weight, whereas coarse-grained pruning allows multiple weights to share a single index. This "index saving effect" means that structured sparsity can achieve better total compression even if it has a slightly higher density of non-zero weights.
As shown in the experimental results, Vector-level (1-D) and Kernel-level (2-D) pruning represent a highly effective "sweet spot." They achieve nearly the same accuracy-to-sparsity ratio as fine-grained pruning until extreme sparsity levels are reached. Furthermore, simulations on the SCNN architecture demonstrated that regular sparsity increases data locality, saving 30%–35% of total output memory references compared to fine-grained sparsity at the same density. The researchers also confirmed that these pruning methods are compatible with 8-bit weight quantization.
Conclusion
This study demonstrates that intermediate levels of structured pruning—specifically 1D vectors and 2D kernels—can match the compression of fine-grained pruning while significantly boosting hardware efficiency. While 1x1 convolutions in modern architectures like ResNet present a challenge for kernel-level pruning, the qualitative benefits of regularity for memory access are clear. Future work may involve adaptive granularity selection per layer to further optimize the trade-off between accuracy and hardware performance.
Summary updated