FP8 형식을 활용한 효율적인 사후 양자화
Efficient Post-training Quantization with FP8 Formats
September 26, 2023
저자: Haihao Shen, Naveen Mellempudi, Xin He, Qun Gao, Chang Wang, Mengni Wang
cs.AI
초록
LLM(대형 언어 모델) 및 Diffusion 모델과 같은 딥러닝 방법론의 최근 발전은 이러한 현대적 아키텍처의 계산적 요구를 충족하면서도 정확도를 유지할 수 있는 개선된 양자화 방법의 필요성을 대두시켰습니다. 이를 위해 우리는 기계 번역, 언어 모델링, 텍스트 생성, 이미지 분류, 생성 및 분할 등 다양한 작업을 아우르는 75개의 고유 네트워크 아키텍처에 걸쳐 사후 학습 양자화를 위한 FP8 데이터 형식의 장점을 연구했습니다. 우리는 동적 범위와 정밀도 간의 다양한 절충 정도가 모델 정확도에 미치는 영향을 연구하기 위해 세 가지 다른 FP8 표현(E5M2, E4M3 및 E3M4)을 검토했습니다. 광범위한 연구를 바탕으로, 우리는 다양한 네트워크 아키텍처에 걸쳐 일반화 가능한 양자화 워크플로를 개발했습니다. 우리의 실험 결과는 FP8 형식이 INT8보다 워크로드 커버리지(92.64% 대 65.87%), 모델 정확도 및 더 광범위한 연산에 대한 적합성 등 여러 측면에서 우수함을 보여줍니다. 또한, 우리의 연구 결과는 E4M3이 NLP 모델에 더 적합한 반면, E3M4는 컴퓨터 비전 작업에서 E4M3보다 약간 더 나은 성능을 보인다는 것을 시사합니다. 코드는 Intel Neural Compressor에서 공개적으로 제공됩니다: https://github.com/intel/neural-compressor.
English
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.