Quartet:原生FP4训练可用于大型语言模型
Quartet: Native FP4 Training Can Be Optimal for Large Language Models
AI总结:
Quartet通过原生FP4训练实现大型语言模型的高效训练,提供与FP16和FP8同等的性能。
摘要:
在低精度下直接训练大型语言模型(LLMs)提供了一种解决计算成本的方法,通过提高吞吐量和能效。为此,NVIDIA最近的Blackwell架构通过FP4变体实现了非常低精度的操作。然而,目前在FP4精度下训练LLMs的算法面临显著的精度下降问题,通常依赖于混合精度回退。在本文中,我们研究了硬件支持的FP4训练,并介绍了一种新的方法,用于准确、端到端的FP4训练,其中所有主要计算(即线性层)均在低精度下进行。通过在Llama型模型上的广泛评估,我们揭示了一个新的低精度缩放定律,量化了不同位宽和训练设置之间的性能权衡。基于这项研究,我们设计了一种在精度与计算之间最优的技术,称为Quartet。我们使用优化的CUDA内核针对Blackwell进行了Quartet的实现,证明了完全基于FP4的训练是FP16半精度和FP8训练的有竞争力的替代方案。我们的代码可在https://github.com/IST-DASLab/Quartet上获得。
英文摘要:
Training large language models (LLMs) models directly in low-precision offers a way to address computational costs by improving both throughput and energy efficiency. For those purposes, NVIDIA's recent Blackwell architecture facilitates very low-precision operations using FP4 variants. Yet, current algorithms for training LLMs in FP4 precision face significant accuracy degradation and often rely on mixed-precision fallbacks. In this paper, we investigate hardware-supported FP4 training and introduce a new approach for accurate, end-to-end FP4 training with all the major computations (i.e., linear layers) in low precision. Through extensive evaluations on Llama-type models, we reveal a new low-precision scaling law that quantifies performance trade-offs across bit-widths and training setups. Guided by this investigation, we design an "optimal" technique in terms of accuracy-vs-computation, called Quartet. We implement Quartet using optimized CUDA kernels tailored for Blackwell, demonstrating that fully FP4-based training is a competitive alternative to FP16 half-precision and to FP8 training. Our code is available at https://github.com/IST-DASLab/Quartet.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。