Softmax Bias Correction for Quantized Generative Models
Nilesh Prasad Pandey, Marios Fournarakis, Chirag Patel et al. · IEEE/CVF International Conference on Computer Vision Workshops (ICCVW) · 2023
Post-training quantization (PTQ) is the go-to compression technique for large generative models, such as stable diffusion or large language models. PTQ methods commonly keep the softmax activation in higher precision as it has been shown to be very sensitive to quantization noise. However, this can lead to a significant runtime and power overhead during inference on resource-constraint edge devices. In this work, we investigate the source of the softmax sensitivity to quantization and show that the quantization operation leads to a large bias in the softmax output, causing accuracy degradation. To overcome this issue, we propose an offline bias correction technique that improves the quatizability of softmax without additional compute during deployment, as it can be readily absorbed into the quantization parameters. We demonstrate the effectiveness of our method on stable diffusion v1.5 and 125M-size OPT language model, achieving significant accuracy improvement for 8-bit quantized softmax.
Cited by 12 works. doi:10.1109/iccvw60793.2023.00157 Open-access PDF
Authors
References
- High-Resolution Image Synthesis with Latent Diffusion Models
- Transformers: State-of-the-Art Natural Language Processing
- Denoising Diffusion Probabilistic Models
- Diffusion Models Beat GANs on Image Synthesis
- A Survey of Quantization Methods for Efficient Neural Network Inference
- Quantizing deep convolutional networks for efficient inference: A whitepaper
- LAION-5B: An open large-scale dataset for training next generation image-text models
- Analysing Off-The-Shelf Options for Question Answering with Portuguese FAQs
- Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
- Q8BERT: Quantized 8Bit BERT