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

预训练语言模型的有效后训练Quantization

Towards Efficient Post-training Quantization of Pre-trained Language Models

The Chinese University of Hong Kong(香港中文大学);Huawei Noah’s Ark Lab(华为诺亚方舟实验室)

Haoli Bai, Lu Hou, Lifeng Shang, Xin Jiang, Irwin King, Michael R. Lyu

摘要:

随着大型预训练语言模型~(PLM)的快速增长,网络量化越来越受到关注。然而,大多数现有的PLM量化方法都遵循量化感知训练(QAT),这需要端到端的训练,可以完全访问整个数据集。因此,它们遭受缓慢的训练,大内存开销和数据安全问题。在本文中,我们研究了后训练量化的PLM的~(PTQ),并提出了逐模量化误差最小化~(MREM),一个有效的解决方案,以减轻这些问题。通过将PLM划分为多个模块,我们最大限度地减少了每个模块的量化所引起的重建误差。此外,我们设计了一种新的模型并行训练策略,使得每个模块可以在单独的计算设备上本地训练,而无需等待前面的模块,这带来了接近理论上的训练速度(例如,$4$ GPU上的$4\times$)。在GLUE和SQuAD基准测试上的实验表明,我们提出的PTQ解决方案不仅性能接近QAT,而且在训练时间、内存开销和数据消耗方面都有显着减少。

英文摘要:

Network quantization has gained increasing attention with the rapid growth of large pre-trained language models~(PLMs). However, most existing quantization methods for PLMs follow quantization-aware training~(QAT) that requires end-to-end training with full access to the entire dataset. Therefore, they suffer from slow training, large memory overhead, and data security issues. In this paper, we study post-training quantization~(PTQ) of PLMs, and propose module-wise quantization error minimization~(MREM), an efficient solution to mitigate these issues. By partitioning the PLM into multiple modules, we minimize the reconstruction error incurred by quantization for each module. In addition, we design a new model parallel training strategy such that each module can be trained locally on separate computing devices without waiting for preceding modules, which brings nearly the theoretical training speed-up (e.g., $4\times$ on $4$ GPUs). Experiments on GLUE and SQuAD benchmarks show that our proposed PTQ solution not only performs close to QAT, but also enjoys significant reductions in training time, memory overhead, and data consumption.

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

↑