HALO:面向大语言模型的哈达玛辅助低精度优化
HALO: Hadamard-Assisted Lower-Precision Optimization for LLMs
AI总结:
HALO通过哈达玛旋转、高性能内核和FSDP低精度通信实现LLM全量化训练,在8位精度下保持微调精度并获得最高1.41倍加速。
摘要:
大语言模型(LLMs)的量化训练仍然是一个尚未解决的挑战,因为在低精度下执行所有矩阵乘法时保持精度已被证明十分困难。当微调预训练模型时尤其如此,因为这些模型可能具有较大的权重和激活离群值,使得低精度优化变得困难。为了解决这一问题,我们提出了HALO,这是一种面向Transformer的新型量化感知训练方法,通过结合以下三点实现准确且高效的低精度训练:1)在前向和反向传播中策略性地放置哈达玛旋转,以缓解离群值问题;2)高性能内核支持;3)用于低精度通信的FSDP集成。我们的方法确保前向和反向传播过程中所有大型矩阵乘法都在较低精度下执行。应用于LLAMA系列模型时,HALO在各种任务的微调过程中取得了接近全精度等价的结果,同时在RTX 4090 GPU上进行全量微调时实现了高达1.41倍的端到端加速。HALO高效支持标准微调和参数高效微调(PEFT)。我们的结果展示了首个实用的全量化LLM微调方法,在8位精度下保持准确性的同时带来性能收益。代码可在https://github.com/IST-DASLab/HALO获取。
英文摘要:
Quantized training of Large Language Models (LLMs) remains an open challenge, as maintaining accuracy while performing all matrix multiplications in low precision has proven difficult. This is particularly the case when fine-tuning pre-trained models, which can have large weight and activation outlier values that make lower-precision optimization difficult. To address this, we present HALO, a novel quantization-aware training approach for Transformers that enables accurate and efficient low-precision training by combining 1) strategic placement of Hadamard rotations in both forward and backward passes, which mitigate outliers, 2) high-performance kernel support, and 3) FSDP integration for low-precision communication. Our approach ensures that all large matrix multiplications during the forward and backward passes are executed in lower precision. Applied to LLAMA-family models, HALO achieves near-full-precision-equivalent results during fine-tuning on various tasks, while delivering up to 1.41x end-to-end speedup for full fine-tuning on RTX 4090 GPUs. HALO efficiently supports both standard and parameterefficient fine-tuning (PEFT). Our results demonstrate the first practical approach to fully quantized LLM fine-tuning that maintains accuracy in 8-bit precision, while delivering performance benefits. Code is available at https://github.com/IST-DASLab/HALO.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。