Skip to main content
QUICK REVIEW

[论文解读] Learning Best Combination for Efficient N:M Sparsity

Yuxin Zhang, Mingbao Lin|arXiv (Cornell University)|Jun 14, 2022
Machine Learning and ELMComputer Science被引用 23
一句话总结

该论文将 N:M 稀疏性重新表述为一个组合选择问题,并提出 Learning Best Combination (LBC),它为每个候选权重子集学习一个分数,并在常规训练过程中逐步剪除低分组合,以实现高效的 N:M 稀疏性并保持较高准确性。

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}.

研究动机与目标

  • 激发高效的 N:M 稀疏性,使其在 GPUs 上保留硬件加速潜力。
  • 将 N:M 稀疏性建模为一个有限的组合问题,并对其解进行分而治之。
  • 引入一个可学习的评分机制,用以识别最佳的 N-out-of-M 权重组合。
  • 实现端到端训练,在剪枝过程中无需密集梯度计算。
  • 证明 LBC 在 CNN 与 ViT 模型上优于现有的 N:M 稀疏方法。

提出的方法

  • 将每个权重组 W^l_g,:(大小为 M)划分为全部 C(M,N) 个 N 大小的组合。
  • 为每个组合 Θ^l_g,i 分配一个可学习的分数 S^l_g,i,并与网络权重共同优化。
  • 在训练过程中使用逐步剪枝计划,去除低分组合,最终保留最佳组合。
  • 对 W^l 应用二元掩码 B^l,使前向计算 Z^l = Z^{l-1} ⊗ (B^l ⊙ W^l) , 以实现 N:M 稀疏性。
  • 通过 Straight-Through Estimator (STE) 梯度更新 S^l_g,i,以反映每个组合的重要性。
  • 给出分析性论证,表明学习到的分数近似从移除权重引起的损失变化,并指导剪枝。
  • 通过在避免密集梯度计算的同时实现强稀疏性来证明端到端训练的效率。

实验结果

研究问题

  • RQ1在无需大量预训练或密集梯度计算的情况下,N:M 稀疏性是否能够从头有效学习?
  • RQ2可学习的组合分数是否能够准确反映权重子集在 N:M 稀疏性中的相对重要性?
  • RQ3采用分而治之的逐步剪枝方法是否能带来比现有 N:M 方法更好的准确性和效率?
  • RQ4在标准基准(ImageNet、COCO)上,LBC 在 CNN 与 Vision Transformer 上的表现相比于最先进的稀疏方法如何?
  • RQ5训练时间点 t_i、t_f 对训练成本与准确性之间权衡的影响是什么?

主要发现

  • LBC 在 ResNet-50 和 DeiT 上,在 2:4、2:8 和 1:16 稀疏模式下实现具竞争力甚至更优的 Top-1 准确率,且训练成本低于部分基线。
  • 在 ImageNet 的 ResNet-50 上,LBC 在 2:4 稀疏和 120 个训练轮下达到 77.2% Top-1,优于 ASP 和 SR-STE。
  • LBC 在 ResNet-50 的 1:16 稀疏下达到 71.8% Top-1,在相似稀疏度下在准确性和感知效率上均超越 STR。
  • 在对象检测和实例分割(COCO)上,LBC 对于 2:4 和 2:8 模式,持续优于 SR-STE 的 mAP/box 与 mask 结果。
  • 在 DeiT-small,LBC 在 2:4 稀疏下达到 80.1% Top-1,比 SR-STE 高出 0.5 个百分点,同时训练 FLOPs 更少。
  • 与高稀疏度下的非结构化稀疏方法相比,LBC 在 NVIDIA Ampere 硬件上提供更好的实际压缩与加速,同时保持或提升准确性。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。