Skip to main content
QUICK REVIEW

[Paper Review] Learning Best Combination for Efficient N:M Sparsity

Yuxin Zhang, Mingbao Lin|arXiv (Cornell University)|Jun 14, 2022
Machine Learning and ELMComputer Science23 citations
TL;DR

The paper reframes N:M sparsity as a combinatorial selection problem and proposes Learning Best Combination (LBC), which learns a score for each candidate weight subset and gradually prunes low-scoring combinations during standard training to achieve efficient N:M sparsity with strong accuracy.

ABSTRACT

By forcing at most N out of M consecutive weights to be non-zero, the recent N:M network sparsity has received increasing attention for its two attractive advantages: 1) Promising performance at a high sparsity. 2) Significant speedups on NVIDIA A100 GPUs. Recent studies require an expensive pre-training phase or a heavy dense-gradient computation. In this paper, we show that the N:M learning can be naturally characterized as a combinatorial problem which searches for the best combination candidate within a finite collection. Motivated by this characteristic, we solve N:M sparsity in an efficient divide-and-conquer manner. First, we divide the weight vector into $C_{ ext{M}}^{ ext{N}}$ combination subsets of a fixed size N. Then, we conquer the combinatorial problem by assigning each combination a learnable score that is jointly optimized with its associate weights. We prove that the introduced scoring mechanism can well model the relative importance between combination subsets. And by gradually removing low-scored subsets, N:M fine-grained sparsity can be efficiently optimized during the normal training phase. Comprehensive experiments demonstrate that our learning best combination (LBC) performs consistently better than off-the-shelf N:M sparsity methods across various networks. Our project is released at \url{https://github.com/zyxxmu/LBC}.

Motivation & Objective

  • Motivate efficient N:M sparsity that preserves hardware acceleration potential on GPUs.
  • Model N:M sparsity as a finite combinatorial problem and divide-and-conquer its solution.
  • Introduce a learnable scoring mechanism to identify the best N-out-of-M weight combinations.
  • Enable end-to-end training without dense-gradient computation for the pruning process.
  • Show that LBC outperforms existing N:M sparsity methods across CNNs and ViT models.

Proposed method

  • Divide each weight group W^l_g,: (size M) into all C(M,N) N-sized combinations.
  • Assign a learnable score S^l_g,i to each combination Θ^l_g,i and jointly optimize with network weights.
  • Use a gradual pruning schedule to remove low-scored combinations over training epochs, leaving the best combination by the end.
  • Apply a binary mask B^l to W^l with forward computation Z^l = Z^{l-1} ⊗ (B^l ⊙ W^l) to realize the N:M sparsity.
  • Update S^l_g,i via straight-through estimator (STE) gradients to reflect each combination’s importance.
  • Provide analytical justification showing that the learned scores approximate the loss change from removing weights and guide pruning.
  • Demonstrate end-to-end training efficiency by avoiding dense-gradient calculations while achieving strong sparsity performance.

Experimental results

Research questions

  • RQ1Can N:M sparsity be effectively learned from scratch without heavy pre-training or dense-gradient computation?
  • RQ2Can a learnable combination score accurately reflect the relative importance of weight subsets for N:M sparsity?
  • RQ3Does a divide-and-conquer approach with gradual pruning yield better accuracy and efficiency than existing N:M methods?
  • RQ4How does LBC perform across CNNs and Vision Transformers on standard benchmarks (ImageNet, COCO) compared to state-of-the-art sparsity methods?
  • RQ5What is the impact of training schedule (t_i, t_f) on the trade-off between training cost and accuracy?

Key findings

  • LBC achieves competitive or superior Top-1 accuracy across 2:4, 2:8 and 1:16 sparsity patterns on ResNet-50 and DeiT, with lower training cost than some baselines.
  • For ResNet-50 on ImageNet, LBC reaches 77.2% Top-1 with 2:4 sparsity and 120 training epochs, outperforming ASP and SR-STE.
  • LBC attains 71.8% Top-1 with 1:16 sparsity on ResNet-50, surpassing STR at similar sparsity in both accuracy and perceived efficiency.
  • On object detection and instance segmentation (COCO), LBC consistently improves mAP/box and mask results over SR-STE for 2:4 and 2:8 patterns.
  • In DeiT-small, LBC achieves 80.1% Top-1 with 2:4 sparsity, outperforming SR-STE by 0.5 percentage points while using fewer training FLOPs.
  • Compared with unstructured sparsity methods at high sparsity, LBC provides better practical compression and acceleration on NVIDIA Ampere hardware while maintaining or improving accuracy.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.