提出高效高精度的8比特以下整数训练方法,无需预处理即可在多种设备上运行。
Towards Accurate and Efficient Sub-8-Bit Integer Training
- 设计ShiftQuant实现精准梯度估计,突破分组量化误差上限
- 4比特ResNet仅损失0.92%准确率,6比特Transformer损失0.61%
- 支持通用设备部署,显著提升CPU/GPU/FPGA性能并降低资源消耗
神经网络训练是内存与计算密集型任务。量化通过低比特格式训练可显著减轻负载。为降低量化误差,现有方法开发了新数据格式和量化器的预处理操作,但难以兼顾高精度与高效率。本文从梯度下降优化本质出发,探索子8比特整数训练。所提框架包含两部分:用于实现精准梯度估计的ShiftQuant,以及用于平滑损失曲面的L1归一化。ShiftQuant逼近分组量化理论上限,且无需低效的内存重排。L1归一化实现全量化归一化层,收敛精度优异。该方法免除预处理,支持通用设备。在多种网络与任务中实现接近零的精度损失(4比特ResNets仅0.92%损失,6比特Transformers仅0.61%损失)。原型实现中,ShiftQuant在CPU/GPU上分别比FP16快1.85倍/提升15.3%,FPGA资源消耗减少33.9%。全量化L1归一化层在CPU上吞吐量较传统L2归一化提升超35.54%。理论分析验证了方法先进性。
原文摘要 · Abstract (English)
Neural network training is a memory- and compute-intensive task. Quantization, which enables low-bitwidth formats in training, can significantly mitigate the workload. To reduce quantization error, recent methods have developed new data formats and additional pre-processing operations on quantizers. However, it remains quite challenging to achieve high accuracy and efficiency simultaneously. In this paper, we explore sub-8-bit integer training from its essence of gradient descent optimization. Our integer training framework includes two components: ShiftQuant to realize accurate gradient estimation, and L1 normalization to smoothen the loss landscape. ShiftQuant attains performance that approaches the theoretical upper bound of group quantization. Furthermore, it liberates group quantization from inefficient memory rearrangement. The L1 normalization facilitates the implementation of fully quantized normalization layers with impressive convergence accuracy. Our method frees sub-8-bit integer training from pre-processing and supports general devices. This framework achieves negligible accuracy loss across various neural networks and tasks ($0.92\%$ on 4-bit ResNets, $0.61\%$ on 6-bit Transformers). The prototypical implementation of ShiftQuant achieves more than $1.85\times/15.3\%$ performance improvement on CPU/GPU compared to its FP16 counterparts, and $33.9\%$ resource consumption reduction on FPGA than the FP16 counterparts. The proposed fully-quantized L1 normalization layers achieve more than $35.54\%$ improvement in throughout on CPU compared to traditional L2 normalization layers. Moreover, theoretical analysis verifies the advancement of our method.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。