arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.23949cs.LGcs.AI

TSENOR:寻找可转置 N:M 稀疏掩码的高效算法

TSENOR: Highly-Efficient Algorithm for Finding Transposable N:M Sparse Masks

Operations Research Center(运筹学研究中心);Massachusetts Institute of Technology(麻省理工学院)

Xiang Meng, Mehdi Makni, Rahul Mazumder

AI总结:

针对N:M稀疏性无法在矩阵转置中保持导致训练效率受限的问题,提出可扩展至十亿参数的可转置N:M掩码高效求解器TSENOR,通过最优传输和Dykstra算法求解,实现百倍加速并保持高精度。

摘要:

网络剪枝降低了大型神经网络的计算需求,其中 N:M 稀疏性——每 M 个连续权重中仅保留 N 个——在压缩模型质量与硬件加速之间提供了极具吸引力的平衡。然而,N:M 稀疏性仅能加速前向传播计算,因为 N:M 模式在矩阵转置过程中无法保持,这限制了前向和反向传播均计算密集的训练阶段的效率。尽管已提出可转置 N:M 稀疏性来解决此限制,但现有的寻找可转置 N:M 稀疏掩码的方法要么无法扩展到大型模型,要么局限于 M=4,从而导致次优的压缩-精度权衡。我们引入了一种可转置 N:M 掩码的高效求解器,可扩展至十亿参数模型。我们将掩码生成形式化为最优传输问题,并通过熵正则化和 Dykstra 算法进行求解,随后执行舍入过程。我们基于张量的实现利用了 GPU 并行性,与现有方法相比实现了高达 100 倍的加速,且误差仅为 1-10%。我们的方法可与包括 Wanda、SparseGPT 和 ALPS 在内的逐层 N:M 剪枝框架集成,以生成具有任意 N:M 值的可转置 N:M 稀疏模型。实验表明,具有可转置 16:32 稀疏性的 LLaMA3.2-8B 保持接近其标准 N:M 对应模型的性能,并优于标准的 2:4 稀疏模型,展示了我们方法的实用价值。

英文摘要:

Network pruning reduces the computational requirements of large neural networks, with N:M sparsity -- retaining only N out of every M consecutive weights -- offering a compelling balance between compressed model quality and hardware acceleration. However, N:M sparsity only accelerates forward-pass computations, as N:M patterns are not preserved during matrix transposition, limiting efficiency during training where both passes are computationally intensive. While transposable N:M sparsity has been proposed to address this limitation, existing methods for finding transposable N:M sparse masks either fail to scale to large models or are restricted to M=4 which results in suboptimal compression-accuracy trade-off. We introduce an efficient solver for transposable N:M masks that scales to billion-parameter models. We formulate mask generation as optimal transport problems and solve through entropy regularization and Dykstra's algorithm, followed by a rounding procedure. Our tensor-based implementation exploits GPU parallelism, achieving up to 100x speedup with only 1-10% error compared to existing methods. Our approach can be integrated with layer-wise N:M pruning frameworks including Wanda, SparseGPT and ALPS to produce transposable N:M sparse models with arbitrary N:M values. Experiments show that LLaMA3.2-8B with transposable 16:32 sparsity maintains performance close to its standard N:M counterpart and outperforms standard 2:4 sparse model, showing the practical value of our approach.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑