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

Jetfire:基于INT8数据流与逐块量化的高效准确Transformer预训练

Jetfire: Efficient and Accurate Transformer Pretraining with INT8 Data Flow and Per-Block Quantization

Tsinghua University(清华大学);Institute for Interdisciplinary Information Sciences, Tsinghua University(清华大学交叉信息研究院)

Haocheng Xi, Yuxiang Chen, Kang Zhao, Kai Jun Teh, Jianfei Chen, Jun Zhu

AI总结:

提出Jetfire,一种针对Transformer的INT8全量化训练方法,通过INT8数据流和逐块量化实现与FP16相当的准确性,并带来1.42倍加速和1.49倍内存节省。

摘要:

预训练Transformer通常耗时较长。全量化训练(FQT)是一种加速预训练的有前景的方法。然而,大多数FQT方法采用量化-计算-反量化流程,由于高内存访问开销和低精度计算,在Transformer中往往导致次优的加速效果和显著的性能下降。在本工作中,我们提出了Jetfire,一种专门针对Transformer的高效且准确的INT8训练方法。我们的方法采用INT8数据流以优化内存访问,并采用逐块量化方法以保持预训练Transformer的准确性。大量实验表明,我们的INT8 FQT方法达到了与FP16训练基线相当的准确性,并优于现有的针对Transformer的INT8训练工作。此外,对于标准Transformer块,与FP16基线相比,我们的方法提供了1.42倍的端到端训练加速和1.49倍的内存减少。我们的代码已在https://github.com/thu-ml/Jetfire-INT8Training开源。

英文摘要:

Pretraining transformers are generally time-consuming. Fully quantized training (FQT) is a promising approach to speed up pretraining. However, most FQT methods adopt a quantize-compute-dequantize procedure, which often leads to suboptimal speedup and significant performance degradation when used in transformers due to the high memory access overheads and low-precision computations. In this work, we propose Jetfire, an efficient and accurate INT8 training method specific to transformers. Our method features an INT8 data flow to optimize memory access and a per-block quantization method to maintain the accuracy of pretrained transformers. Extensive experiments demonstrate that our INT8 FQT method achieves comparable accuracy to the FP16 training baseline and outperforms the existing INT8 training works for transformers. Moreover, for a standard transformer block, our method offers an end-to-end training speedup of 1.42x and a 1.49x memory reduction compared to the FP16 baseline. Our code is open sourced at https://github.com/thu-ml/Jetfire-INT8Training.

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

↑