Skip to main content
QUICK REVIEW

[論文レビュー] Efficient Post-training Quantization with FP8 Formats

Haihao Shen, Naveen Mellempudi|arXiv (Cornell University)|Sep 26, 2023
Advanced Neural Network Applications被引用数 4
ひとこと要約

本稿では、大規模言語モデルやビジョンタスクにおいてINT8よりも精度とワークロードカバレッジを向上させるために、FP8フォーマット(E5M2、E4M3、E3M4)を用いた統合的でスケーラブルなポストトレーニング量子化フレームワークを提案する。E4M3は自然言語処理分野(96.32%のカバレッジ)で優れた性能を示し、E3M4はビジョン分野(78.95%のカバレッジ)で優れた性能を示す。ミックスドFP8フォーマットとダイナミック量子化により、さらに精度が向上する。

ABSTRACT

Recent advances in deep learning methods such as LLMs and Diffusion models have created a need for improved quantization methods that can meet the computational demands of these modern architectures while maintaining accuracy. Towards this goal, we study the advantages of FP8 data formats for post-training quantization across 75 unique network architectures covering a wide range of tasks, including machine translation, language modeling, text generation, image classification, generation, and segmentation. We examine three different FP8 representations (E5M2, E4M3, and E3M4) to study the effects of varying degrees of trade-off between dynamic range and precision on model accuracy. Based on our extensive study, we developed a quantization workflow that generalizes across different network architectures. Our empirical results show that FP8 formats outperform INT8 in multiple aspects, including workload coverage (92.64% vs. 65.87%), model accuracy and suitability for a broader range of operations. Furthermore, our findings suggest that E4M3 is better suited for NLP models, whereas E3M4 performs marginally better than E4M3 on computer vision tasks. The code is publicly available on Intel Neural Compressor: https://github.com/intel/neural-compressor.

研究の動機と目的

  • 大規模言語モデルや拡散ネットワークのような現代のモデルにおいて、オーバーフローと動的範囲の処理に課題を抱えるINT8量子化の限界を解消すること。
  • 多様なモデルアーキテクチャにわたるポストトレーニング量子化において、3種類のFP8フォーマット(E5M2、E4M3、E3M4)の有効性を評価すること。
  • 自然言語処理、コンピュータビジョン、マルチモーダルタスクに広く適用可能な一般化され、スケーラブルな量子化ワークフローを開発すること。
  • 精度とカバレッジを最大化する最適なFP8フォーマットおよび量子化戦略(例:ミックスドフォーマット、ダイナミック量子化)を同定すること。

提案手法

  • FP8フォーマットを対象とした統合的ポストトレーニング量子化ワークフローを提案し、チャネルごとのスケーリングを伴う対称的および非対称的量子化をサポートする。
  • E5M2(広い動的範囲)、E4M3(精度と動的範囲のバランス)、E3M4(高精度、範囲制限あり)の3種類のFP8フォーマットを用い、トレードオフを検証する。
  • 自然言語処理モデルでは、活性化にE4M3、重みにE3M4を割り当てることでミックスドFP8フォーマットを適用し、量子化誤差を低減する。
  • キャリブレーション中にデータ拡張を実施し、バッチ正規化の統計とモデル精度を向上させる。特に小規模なキャリブレーションセットの場合に顕著である。
  • 静的およびダイナミック量子化スキームを評価し、ダイナミック量子化が自然言語処理モデルの精度向上に寄与することを確認する。
  • 精度を最適化するためのハイパーパramータとフォーマットの自動選択に基づく自動モデルチューニングを導入する。
Figure 1: ( left ) Histogram of the tensor $X\sim\mathcal{N}(\mu=0.0,\,\sigma^{2}=0.5)$ , that contains a small number ( 1%) of outliers uniformly distributed between -6.0 to 6.0. ( center ) Distribution of quantized values represented by E5M2, E4M3, E3M4 and INT8 data formats. ( right ) Overall qua
Figure 1: ( left ) Histogram of the tensor $X\sim\mathcal{N}(\mu=0.0,\,\sigma^{2}=0.5)$ , that contains a small number ( 1%) of outliers uniformly distributed between -6.0 to 6.0. ( center ) Distribution of quantized values represented by E5M2, E4M3, E3M4 and INT8 data formats. ( right ) Overall qua

実験結果

リサーチクエスチョン

  • RQ1多様なディープラーニングモデルにおいて、FP8フォーマット(E5M2、E4M3、E3M4)はINT8に比べて、モデル精度とワークロードカバレッジでどのように差をつけるか?
  • RQ2ポストトレーニング量子化において、自然言語処理モデルとコンピュータビジョンモデルの最適なFP8フォーマットはそれぞれ何か?
  • RQ3ミックスドFP8フォーマット(例:活性化にE4M3、重みにE3M4)は、単一フォーマット手法を上回る量子化精度を実現できるか?
  • RQ4ポストトレーニング量子化において、FP8フォーマットを用いたダイナミック量子化と静的量子化は、どのように比較されるか?
  • RQ5FP8量子化下でバッチ正規化層の精度を最もよく保持するキャリブレーション戦略(例:データ拡張)は何か?

主な発見

  • FP8量子化は75のモデルで92.64%のワークロードカバレッジを達成し、INT8の65.87%を大幅に上回る。
  • E4M3は自然言語処理モデルで96.32%のカバレッジを達成し、E3M4(92.11%)を上回り、NLPワークロードに優位性を示す。
  • E3M4はコンピュータビジョンモデルで78.95%のカバレッジを達成し、E4M3(73.68%)をわずかに上回り、この分野で優れた性能を示す。
  • ミックスドFP8フォーマット(活性化にE4M3、重みにE3M4)は、BERT-base(MRPC: 0.9069 vs. 0.9050)およびFunnel(MRPC: 0.9233 vs. 0.9207)で精度を向上させる。
  • ダイナミック量子化は、E4M3を用いたBERT-Large(RTE)で最大+0.98%の精度向上を示し、NLPモデルへの利点を裏付ける。
  • データ拡張を伴う3,000サンプルのトレーニング拡張キャリブレーションセットは、インferencオンリーや小規模セットに比べ、特にバッチ正規化層の精度保持に優れている。
Figure 2: Standard Quantization Scheme : default configuration for broad set of operations across different workloads, Extended Quantization Scheme : configuration for additional operator coverage (Ex: LayerNorm, BatchNorm & element-wise), mixed FP8 formats, dynamic quantization, BatchNorm Calibrati
Figure 2: Standard Quantization Scheme : default configuration for broad set of operations across different workloads, Extended Quantization Scheme : configuration for additional operator coverage (Ex: LayerNorm, BatchNorm & element-wise), mixed FP8 formats, dynamic quantization, BatchNorm Calibrati

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。