As the parameters of Large Language Models (LLMs) have scaled to hundreds of billions, the demand for efficient training methods -- balancing faster computation and reduced memory usage without sacrificing accuracy -- has become more critical than ever. In recent years, various mixed precision strategies, which involve different precision levels for optimization components, have been proposed to increase training speed with minimal accuracy degradation. However, these strategies often require manual adjustments and lack theoretical justification. In this work, we leverage stochastic rounding (SR) to address numerical errors of training with low-precision representation. We provide theoretical analyses of implicit regularization and convergence under the Adam optimizer when SR is utilized. With the insights from these analyses, we extend previous BF16 + SR strategy to be used in distributed settings, enhancing the stability and performance for large scale training. Empirical results from pre-training models with up to 6.7B parameters, for the first time, demonstrate that our BF16 with SR strategy outperforms (BF16, FP32) mixed precision strategies, achieving better validation perplexity, up to $1.54\times$ higher throughput, and $30\%$ less memory usage.
On the influence of stochastic roundoff errors and their bias on the convergence of the gradient descent method with low-precision floating-point computation
Eindhoven University of Technology(埃因霍温理工大学);Università di Pisa(比萨大学)
FAST: DNN Training Under Variable Precision Block Floating Point with Stochastic Rounding
Harvard University(哈佛大学);Franklin and Marshall College(富兰克林与马歇尔学院)
块浮点(BFP)可以通过经由跨一组值的共享指数提供宽动态范围来有效地支持深度神经网络(DNN)训练的量化。在本文中,我们提出了一种用于DNN的快速第一,准确第二训练(FAST)系统,其中权重,激活和梯度以BFP表示。FAST支持使用可变精度BFP输入操作数的矩阵乘法,从而在整个训练过程中实现DNN精度的增量增加。通过提高训练迭代和DNN层的BFP精度,FAST可以大大缩短训练时间,同时减少整体硬件资源使用。我们的FAST乘法器-累加器(fMAC)支持多个BFP精度下的点积计算。我们在具有不同数据集的多个DNN上验证了我们的FAST系统,在基于\textbf{mixed-precision or block}浮点数系统的先前工作中,在单芯片平台上的训练中展示了2-6个$\times$加速,同时在验证准确性方面实现了类似的性能。
Quantization Error as a Metric for Dynamic Precision Scaling in Neural Net Training
Department of Electrical and Computer Engineering(电气与计算机工程系);University of Toronto(多伦多大学);Toronto, ON, Canada(加拿大安大略省多伦多市)
最近的工作已经探索了在神经网络训练期间降低参数、激活和梯度的数值精度,作为降低训练计算成本的一种方式(Na & Mukhopadhyay,2016)(Courbariaux et al.,2014年)。我们提出了一种新的动态精度缩放(DPS)计划。通过使用随机定点舍入、基于量化误差的缩放方案以及训练过程中的动态位宽,我们在MNIST数据集上实现了98.8%的测试准确度,与深度学习框架中使用的标准32位浮点值相比,权重的平均位宽仅为16位,激活的平均位宽为14位。
Barzilai-Borwein Step Size for Stochastic Gradient Descent
The Chinese University of Hong Kong(香港中文大学);Academy of Mathematics and Systems Science, Chinese Academy of Sciences(中国科学院数学与系统科学研究院);The University of Hong Kong(香港大学)