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

混合稀疏训练:实现 Transformer 预训练 4$\ imes$ FLOP 减少

Mixed Sparsity Training: Achieving 4$\times$ FLOP Reduction for Transformer Pretraining

Tsinghua University(清华大学);Central South University(中南大学)

Pihe Hu, Shaolong Li, Longbo Huang

AI总结:

本文提出混合稀疏训练(MST)方法,通过结合动态稀疏训练、稀疏变化和混合稀疏注意力,在保持性能的同时将Transformer预训练的FLOP减少4倍。

摘要:

大型语言模型(LLMs)在复杂任务上取得了显著进展,但其广泛采用受到大量计算需求的阻碍。拥有数千亿参数的基于 Transformer 的 LLMs 需要在高端 GPU 集群上进行数月的预训练。然而,本文揭示了一个引人注目的发现:Transformer 在预训练计算中表现出相当大的冗余,这促使我们提出了混合稀疏训练(MST),这是一种高效的预训练方法,可以减少约 $75\%$ 的浮点运算(FLOPs),同时保持性能。MST 在预训练过程中将动态稀疏训练(DST)与稀疏变化(SV)和混合稀疏注意力(HSA)相结合,涉及三个不同阶段:预热、超稀疏化和恢复。预热阶段将密集模型转换为稀疏模型,恢复阶段重新建立连接。在这些阶段中,模型使用动态演化的稀疏拓扑和 HSA 机制进行训练,以在保持性能的同时最小化训练 FLOPs。我们在 GPT-2 上的实验展示了 $4\ imes$ 的 FLOP 减少,且不损害性能。

英文摘要:

Large language models (LLMs) have made significant strides in complex tasks, yet their widespread adoption is impeded by substantial computational demands. With hundreds of billion parameters, transformer-based LLMs necessitate months of pretraining across a high-end GPU cluster. However, this paper reveals a compelling finding: transformers exhibit considerable redundancy in pretraining computations, which motivates our proposed solution, Mixed Sparsity Training (MST), an efficient pretraining method that can reduce about $75\%$ of Floating Point Operations (FLOPs) while maintaining performance. MST integrates dynamic sparse training (DST) with Sparsity Variation (SV) and Hybrid Sparse Attention (HSA) during pretraining, involving three distinct phases: warm-up, ultra-sparsification, and restoration. The warm-up phase transforms the dense model into a sparse one, and the restoration phase reinstates connections. Throughout these phases, the model is trained with a dynamically evolving sparse topology and an HSA mechanism to maintain performance and minimize training FLOPs concurrently. Our experiment on GPT-2 showcases a FLOP reduction of $4\times$ without compromising performance.

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

↑