Training and inference of large language models using 8-bit floating point

要約

FP8 形式は、大規模な深層学習モデルのトレーニングと推論の計算効率を高めるために人気が高まっています。
主な課題は、高精度フォーマットと比較してダイナミック レンジが減少することによる劣化を防ぐために、スケーリングを慎重に選択する必要があることです。
INT フォーマットのこのようなスケーリングの選択に関する文献は豊富にありますが、FP8 ではこの重要な側面がまだ対処されていません。
このペーパーでは、重み、勾配、およびアクティベーションのテンソルごとのスケールを動的に更新することに基づいて、FP8 線形層のスケーリングを選択する方法論を示します。
この方法論を適用して、FP8 を使用して GPT および Llama 2 タイプの大規模言語モデルをトレーニングおよび検証します。モデル サイズは 111M から 70B までです。
FP8 ダイナミクスの理解を容易にするために、結果には、トレーニングと推論の両方における重み、アクティベーション、および勾配のテンソルスケールごとの分布のプロットが添付されています。

要約(オリジナル)

FP8 formats are gaining popularity to boost the computational efficiency for training and inference of large deep learning models. Their main challenge is that a careful choice of scaling is needed to prevent degradation due to the reduced dynamic range compared to higher-precision formats. Although there exists ample literature about selecting such scalings for INT formats, this critical aspect has yet to be addressed for FP8. This paper presents a methodology to select the scalings for FP8 linear layers, based on dynamically updating per-tensor scales for the weights, gradients and activations. We apply this methodology to train and validate large language models of the type of GPT and Llama 2 using FP8, for model sizes ranging from 111M to 70B. To facilitate the understanding of the FP8 dynamics, our results are accompanied by plots of the per-tensor scale distribution for weights, activations and gradients during both training and inference.

arxiv情報

著者 Sergio P. Perez,Yan Zhang,James Briggs,Charlie Blake,Josh Levy-Kramer,Paul Balanca,Carlo Luschi,Stephen Barlow,Andrew William Fitzgibbon
発行日 2023-09-29 13:24:33+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AR, cs.CL, cs.ET, cs.LG, cs.PF, I.2.7 パーマリンク