SLaNC: Static LayerNorm Calibration

要約

数千億のパラメータを超えて大規模言語モデル (LLM) のサイズが増大し続けることで、専用ハードウェア アクセラレータのメーカーに多大なプレッシャーが生じ、後者の革新的な設計は AI 業界で最も急速に拡大する分野の 1 つとなっています。
計算およびストレージの制限を考慮して、利用可能なアクセラレータ上で LLM を効率的かつ正確に処理できるようにするためのさまざまなアプローチが検討されてきました。
その中でも、コンピューティング、通信、ストレージの要件を軽減する手段として、さまざまな量子化技術がコミュニティの主な焦点となっています。
精度の低い形式に量子化すると、利用可能な値表現の範囲が限られているため、当然のことながら多くの課題が生じます。
一般的な Transformer モデルをハードウェアで処理する場合、主な問題の 1 つは LayerNorm の計算になります。分散の累積には、ハードウェアで実現できるよりもはるかに広いダイナミック レンジが必要になるからです。
この記事では、この問題に取り組み、推論中に Transformer モデルに簡単に適用できる、計算効率の高いスケーリング手法を提案します。
私たちの方法は、直前の線形層の静的な重みに基づいて LayerNorm 入力をスケーリングする簡単な方法を提案します。
スケーリング係数は線形層の重みのみに基づいてオフラインで計算されるため、推論中に遅延や計算オーバーヘッドが追加されることはありません。
最も重要なのは、私たちの技術により、計算中にオーバーフローやアンダーフローなどの数値的な問題が発生しないことが保証されます。
このアプローチは、さまざまなハードウェア アーキテクチャにわたって、スムーズで正確かつリソース効率の高い推論を提供します。
この記事では、数値シミュレーションをサポートするだけでなく、理論的な根拠も提供します。

要約(オリジナル)

The ever increasing sizes of Large Language Models (LLMs) beyond hundreds of billions of parameters have generated enormous pressure on the manufacturers of dedicated hardware accelerators and made the innovative design of the latter one of the most rapidly expanding fields of the AI industry. Various approaches have been explored to enable efficient and accurate processing of LLMs on the available accelerators given their computational and storage limitations. Among these, various quantization techniques have become the main focus of the community as a means of reducing the compute, communication and storage requirements. Quantization to lower precision formats naturally poses a number of challenges caused by the limited range of the available value representations. When it comes to processing the popular Transformer models on hardware, one of the main issues becomes calculation of the LayerNorm simply because accumulation of the variance requires a much wider dynamic range than the hardware enables. In this article, we address this matter and propose a computationally-efficient scaling technique that can be easily applied to Transformer models during inference. Our method suggests a straightforward way of scaling the LayerNorm inputs based on the static weights of the immediately preceding linear layers. The scaling factors are computed offline, based solely on the linear layer weights, hence no latency or computational overhead is added during inference. Most importantly, our technique ensures that no numerical issues such as overflow or underflow could happen during the compute. This approach offers smooth, accurate and resource-effective inference across a wide range of hardware architectures. The article provides theoretical justification as well as supporting numerical simulations.

arxiv情報

著者 Mahsa Salmani,Nikita Trukhanov,Ilya Soloveychik
発行日 2024-10-14 14:32:55+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.LG パーマリンク