arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.01172cs.LG
收藏

STEP:带预处理的N:M结构稀疏掩码的从头学习

STEP: Learning N:M Structured Sparsity Masks from Scratch with Precondition

Cornell University(康奈尔大学);Google Research(谷歌研究院)

Yucheng Lu, Shivani Agrawal, Suvinay Subramanian, Oleg Rybakov, Christopher De Sa, Amir Yazdanbakhsh

摘要:

最近的硬件创新(例如Nvidia A100)促使从头开始学习N:M结构化稀疏掩码,以实现快速模型推理。然而,这种机制中最先进的学习方法(例如SR-STE)是针对动量SGD等非自适应优化器提出的,而针对基于注意力的LLM等Adam训练的模型,则会导致非平凡的准确性下降。在本文中,我们首先证明了这种差距的起源,从估计不佳的二阶矩(即方差)在亚当国家的掩码权重。我们推测,学习N:M面具亚当应该考虑方差估计的临界状态。鉴于此,我们提出了STEP,一种Adam感知的配方,它通过两个阶段学习N:M掩码:首先,STEP计算可靠的方差估计(前提条件阶段),随后,方差保持固定并用作学习N:M掩码的前提条件(掩码学习阶段)。STEP通过动态采样训练轨迹上的方差变化并测试样本浓度来自动识别两相的切换点。从经验上讲,我们评估STEP和其他基线,如ASP和SR-STE的多个任务,包括CIFAR分类,机器翻译和LLM微调(BERT-Base,GPT-2)。我们表明,STEP减轻了基线配方的准确性下降,是强大的侵略性结构稀疏比。

英文摘要:

Recent innovations on hardware (e.g. Nvidia A100) have motivated learning N:M structured sparsity masks from scratch for fast model inference. However, state-of-the-art learning recipes in this regime (e.g. SR-STE) are proposed for non-adaptive optimizers like momentum SGD, while incurring non-trivial accuracy drop for Adam-trained models like attention-based LLMs. In this paper, we first demonstrate such gap origins from poorly estimated second moment (i.e. variance) in Adam states given by the masked weights. We conjecture that learning N:M masks with Adam should take the critical regime of variance estimation into account. In light of this, we propose STEP, an Adam-aware recipe that learns N:M masks with two phases: first, STEP calculates a reliable variance estimate (precondition phase) and subsequently, the variance remains fixed and is used as a precondition to learn N:M masks (mask-learning phase). STEP automatically identifies the switching point of two phases by dynamically sampling variance changes over the training trajectory and testing the sample concentration. Empirically, we evaluate STEP and other baselines such as ASP and SR-STE on multiple tasks including CIFAR classification, machine translation and LLM fine-tuning (BERT-Base, GPT-2). We show STEP mitigates the accuracy drop of baseline recipes and is robust to aggressive structured sparsity ratios.

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

↑