1xN Pattern for Pruning Convolutional Neural Networks

Mingbao Lin, Yuxin Zhang, Yuchao Li, Bohong Chen, Fei Chao +4 more
5/31/2021
cs.CVcs.AI
quantization-pruning

Official code: lmbxmu/1xN (42 stars, Python, last commit 2022-09-14).

Abstract

Though network pruning receives popularity in reducing the complexity of convolutional neural networks (CNNs), it remains an open issue to concurrently maintain model accuracy as well as achieve significant speedups on general CPUs. In this paper, we propose a novel 1xN pruning pattern to break this limitation.

Show full abstract

In particular, consecutive N output kernels with the same input channel index are grouped into one block, which serves as a basic pruning granularity of our pruning pattern. Our 1xN pattern prunes these blocks considered unimportant. We also provide a workflow of filter rearrangement that first rearranges the weight matrix in the output channel dimension to derive more influential blocks for accuracy improvements and then applies similar rearrangement to the next-layer weights in the input channel dimension to ensure correct convolutional operations. Moreover, the output computation after our 1xN pruning can be realized via a parallelized block-wise vectorized operation, leading to significant speedups on general CPUs. The efficacy of our pruning pattern is proved with experiments on ILSVRC-2012. For example, given the pruning rate of 50% and N=4, our pattern obtains about 3.0% improvements over filter pruning in the top-1 accuracy of MobileNet-V2. Meanwhile, it obtains 56.04ms inference savings on Cortex-A7 CPU over weight pruning. Our project is made available at https://github.com/lmbxmu/1xN.

View on arXivView PDF

Code Implementations(1)

lmbxmu/1xNOfficial100%

Pytorch implementation of TPAMI 2022 -- 1xN Pattern for Pruning Convolutional Neural Networks

424PythonFeb 18, 20214 years ago

Similar Papers

Cite this paper

@article{lin2021pattern,
  title  = {1xN Pattern for Pruning Convolutional Neural Networks},
  author = {Mingbao Lin and Yuxin Zhang and Yuchao Li and Bohong Chen and Fei Chao and Mengdi Wang and Shen Li and Yonghong Tian and Rongrong Ji},
  year   = {2021},
  eprint = {2105.14713},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.14713}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.14713.svg)](https://codeofpaper.com/paper/2105.14713)

Discussion