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

单位缩放:开箱即用的低精度训练

Unit Scaling: Out-of-the-Box Low-Precision Training

Graphcore Research(Graphcore研究院)

Charlie Blake, Douglas Orr, Carlo Luschi

AI总结:

本文提出单位缩放范式,通过在初始化时使权重、激活和梯度保持单位方差,实现 FP16 和 FP8 等低精度格式下的开箱即用训练,无需多次试运行且计算开销低,并在 BERT-Large 等模型上验证了精度无损。

摘要:

我们提出单位缩放(unit scaling),这是一种设计深度学习模型的范式,可简化低精度数值格式的使用。使用 FP16 或最近提出的 FP8 格式进行训练可带来显著的效率提升,但可能缺乏足够的数值范围以实现开箱即用的训练。单位缩放通过引入一种有原则的模型数值处理方法来解决这一问题:在初始化时使所有权重、激活和梯度具有单位方差。与替代方法不同,该方法既不需要多次训练运行来寻找合适的缩放因子,也没有显著的计算开销。我们在一系列模型和优化器上证明了单位缩放的有效性。我们进一步表明,现有模型可以被改造为单位缩放模型,在 FP16 中训练 BERT-Large,然后在 FP8 中训练,精度没有下降。

英文摘要:

We present unit scaling, a paradigm for designing deep learning models that simplifies the use of low-precision number formats. Training in FP16 or the recently proposed FP8 formats offers substantial efficiency gains, but can lack sufficient range for out-of-the-box training. Unit scaling addresses this by introducing a principled approach to model numerics: seeking unit variance of all weights, activations and gradients at initialisation. Unlike alternative methods, this approach neither requires multiple training runs to find a suitable scale nor has significant computational overhead. We demonstrate the efficacy of unit scaling across a range of models and optimisers. We further show that existing models can be adapted to be unit-scaled, training BERT-Large in FP16 and then FP8 with no degradation in accuracy.

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

↑