arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2309.14592cs.LGcs.AIcs.CL
收藏

使用FP8格式的高效训练后量化

Efficient Post-training Quantization with FP8 Formats

Intel Corporation(英特尔公司);AMD(超威半导体公司)

Haihao Shen, Naveen Mellempudi, Xin He, Qun Gao, Chang Wang, Mengni Wang

AI总结:

本文研究FP8格式在训练后量化中的优势,覆盖75种网络架构,证明FP8在覆盖率、精度和操作适用性上优于INT8,并给出E4M3适合NLP、E3M4略优计算机视觉的结论。

摘要:

深度学习方法的近期进展,如LLM和扩散模型,催生了对改进量化方法的需求,这些方法需在保持精度的同时满足现代架构的计算需求。为实现这一目标,我们研究了FP8数据格式在训练后量化中的优势,覆盖75种独特的网络架构,涉及机器翻译、语言建模、文本生成、图像分类、生成和分割等广泛任务。我们考察了三种不同的FP8表示(E5M2、E4M3和E3M4),以研究动态范围与精度之间不同程度的权衡对模型准确性的影响。基于广泛的研究,我们开发了一种可跨不同网络架构泛化的量化工作流程。我们的实证结果表明,FP8格式在多个方面优于INT8,包括工作负载覆盖率(92.64%对65.87%)、模型准确性以及对更广泛操作的适用性。此外,我们的发现表明,E4M3更适合NLP模型,而E3M4在计算机视觉任务上的表现略优于E4M3。代码已在Intel Neural Compressor上公开:https://github.com/intel/neural-compressor。

英文摘要:

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.

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

↑