Architecture Aware Latency Constrained Sparse Neural Networks

Tianli Zhao, Qinghao Hu, Xiangyu He, Weixiang Xu, Jiaxing Wang, Cong Leng, Jian ChengarXiv 2021

Abstract

Network pruning is a widely used technique for compressing deep neural networks, yet it often fails to translate into real-world speedups on mobile hardware due to irregular memory access patterns and inaccurate latency proxies like FLOPs. This paper introduces ALCS (Architecture Aware Latency Constrained Sparse Neural Networks), a hardware-algorithm co-design framework. ALCS utilizes SIMD-structured pruning to align sparsity with mobile CPU processing units and employs a sample-efficient piece-wise linear latency estimator. By formulating pruning as a constrained optimization problem solved via ADMM, ALCS achieves significant inference acceleration—up to 2.68x on ResNet18—with zero accuracy loss on ImageNet.

Introduction

The deployment of deep neural networks on mobile and edge devices is constrained by limited computational resources and strict latency requirements. While weight pruning can significantly reduce the number of parameters, the resulting "random" sparsity often leads to inefficient hardware utilization. Conversely, coarse-grained "channel" pruning is hardware-friendly but frequently results in substantial accuracy degradation.

ALCS addresses these challenges by bridging the gap between theoretical pruning and actual hardware performance. The framework moves beyond FLOPs as a performance metric, focusing instead on actual runtime latency on target platforms like ARM-based mobile CPUs.

Methodology

The ALCS framework consists of a multi-stage pipeline designed to optimize models for specific hardware architectures.

The ALCS framework overview, illustrating the integration of offline latency measurement, SIMD-structured pruning, and deployment.

SIMD-Structured Pruning

Modern mobile CPUs leverage Single Instruction Multiple Data (SIMD) units to process multiple data points simultaneously. ALCS introduces SIMD-structured pruning, which groups parameters according to the bit-length of these hardware registers. For example, on a 128-bit register using 32-bit floats, four adjacent channels are grouped. These groups are pruned or retained as a unit, ensuring that the sparse computation aligns perfectly with the hardware's execution lanes, thereby avoiding the overhead of irregular memory access.

Piece-wise Linear Latency Estimation

Traditional latency models often require extensive datasets or deep hardware expertise. ALCS simplifies this by observing that a layer's runtime is locally linear relative to its parameter density. By measuring latency at just 11 density points (0%, 10%, ..., 100%), the framework can accurately interpolate the runtime for any sparsity level. This "black box" approach allows for rapid deployment across different hardware platforms without needing to model complex cache hierarchies.

Optimization via ADMM

The pruning task is framed as a constrained optimization problem: minimizing the loss function subject to a specific latency budget. This is solved using the Alternating Direction Method of Multipliers (ADMM), a robust technique for handling the non-convex and non-smooth nature of neural network pruning constraints.

Experimental Results

The framework was evaluated on the ImageNet dataset using MobileNetV1, ResNet18, and ResNet50 models on an ARM Cortex-A72 CPU.

Comparison of Top-1 accuracy vs. latency for ALCS and other state-of-the-art methods on MobileNetV1. ALCS demonstrates a superior Pareto frontier.

As shown in the results, ALCS consistently outperforms existing methods such as AMC and Fast Sparse ConvNets. Key highlights include:

  • MobileNetV1: Achieved a 2.04x speedup with no loss in accuracy.
  • ResNet18: Delivered a 2.68x acceleration while maintaining baseline accuracy.
  • ResNet50: Reduced latency by 1.67x and slightly improved accuracy by 0.11%.

Compared to "Fast Sparse ConvNets," ALCS reached a target latency of 62ms by pruning only ~70% of parameters, whereas the competitor required ~90% pruning to meet the same constraint, resulting in significantly higher accuracy for the ALCS-optimized model.

Conclusion

ALCS demonstrates that hardware-aware pruning patterns, specifically SIMD-structured sparsity, are essential for achieving real-world performance gains on mobile devices. By treating hardware as a black box through efficient latency estimation and utilizing robust optimization techniques, ALCS provides a practical path for deploying high-performance sparse models. Future work will explore extending these architecture-aware patterns to GPUs (SIMT architectures) and specialized AI accelerators.

Summary updated

BibTeX
@misc{zhao2021architecture,
  author = {Tianli Zhao and Qinghao Hu and Xiangyu He and Weixiang Xu and Jiaxing Wang and Cong Leng and Jian Cheng},
  title = {{Architecture Aware Latency Constrained Sparse Neural Networks}},
  year = {2021},
  eprint = {2109.00170},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.00170},
}
Figure