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

量化生成模型的Softmax偏差校正

Softmax Bias Correction for Quantized Generative Models

Qualcomm AI Research(高通人工智能研究院)

Nilesh Prasad Pandey, Marios Fournarakis, Chirag Patel, Markus Nagel

AI总结:

针对量化生成模型中softmax对量化敏感导致精度下降的问题,提出离线偏差校正技术,在不增加推理计算开销下提升8位量化softmax精度,在稳定扩散v1.5和OPT语言模型上验证有效。

摘要:

训练后量化(PTQ)是大型生成模型(如稳定扩散或大型语言模型)的首选压缩技术。PTQ方法通常将softmax激活保持在较高精度,因为研究表明它对量化噪声非常敏感。然而,这会导致在资源受限的边缘设备上进行推理时产生显著的运行时和功耗开销。在这项工作中,我们研究了softmax对量化敏感性的来源,并表明量化操作会导致softmax输出中出现较大偏差,从而引起精度下降。为克服这一问题,我们提出了一种离线偏差校正技术,该技术在不增加部署期间额外计算的情况下提高softmax的可量化性,因为它可以轻松地被吸收到量化参数中。我们在稳定扩散v1.5和125M规模的OPT语言模型上展示了我们方法的有效性,在8位量化softmax上实现了显著的精度提升。

英文摘要:

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 quantizability 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.

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

↑