arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2409.09099cs.LG
收藏

S-STE:用于高效2:4稀疏预训练的连续剪枝函数

S-STE: Continuous Pruning Function for Efficient 2:4 Sparse Pre-training

Tsinghua University(清华大学)

Yuezhou Hu, Jun Zhu, Jianfei Chen

AI总结:

本文提出S-STE方法,通过连续剪枝函数和固定缩放因子解决传统2:4稀疏训练中因不连续性导致的优化困难,并结合最小方差无偏估计与FP8量化,实现了超越以往2:4预训练方案且媲美全参数模型的高效稀疏预训练。

摘要:

训练深度神经网络(DNN)成本高昂。幸运的是,Nvidia Ampere和Hopper GPU通过实现2:4稀疏性,可以使矩阵乘法的速度达到稠密等效运算的两倍。然而,以往基于STE的2:4预训练方法(例如带硬阈值的STE、SR-STE)由于剪枝函数不连续而面临优化困难。在本研究中,我们全面分析了传统N:M稀疏训练的瓶颈,并识别出不连续性带来的三个缺陷:不正确的下降方向、无法预测下降量以及稀疏掩码振荡。鉴于此,我们提出了S-STE,一种简单而强大的2:4训练方法,包含两个部分:连续地将权重投影为2:4稀疏,以及使用每个张量固定的缩放因子对稀疏权重进行重新缩放。此外,我们对激活梯度采用最小方差无偏估计,并对整个过程采用FP8量化。结果表明,我们的方法超越了以往的2:4预训练方案,甚至可与全参数模型相媲美。我们的工具包可在https://github.com/huyz2023/2by4-pretrain获取。

英文摘要:

Training deep neural networks (DNNs) is costly. Fortunately, Nvidia Ampere and Hopper GPUs can accelerate matrix multiplications twice as fast as a dense equivalent by implementing 2:4 sparsity. However, previous STE-based 2:4 pre-training methods (e.g. STE with hard-thresholding, SR-STE) suffer from optimization difficulties because of discontinuous pruning function. In this study, we comprehensively analyse the bottleneck of traditional N:M sparse training and recognize three drawbacks with discontinuity: incorrect descending direction, inability to predict the amount of descent and sparse mask oscillation. In light of this, we propose S-STE, a simple yet powerful 2:4 training method that contains two parts: to continuously project weights to be 2:4 sparse, and to rescale sparse weights with a per-tensor fixed scaling factor. Besides, we adopt minimum-variance unbiased estimation for activation gradient and FP8 quantization for whole process. Results show that our method surpasses previous 2:4 pre-training recipes and is comparable even with full parameter models. Our toolkit is available at https://github.com/huyz2023/2by4-pretrain.

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

↑