COAT:压缩优化器状态与激活以实现内存高效的FP8训练
COAT: Compressing Optimizer states and Activation for Memory-Efficient FP8 Training
AI总结:
针对FP8训练未充分优化内存的问题,提出COAT框架,通过动态范围扩展优化器状态与混合粒度激活量化,使内存占用较BF16减少1.54倍、训练加速1.43倍,支持少GPU全参数训练与批量翻倍,提升大型模型训练效率。
摘要:
FP8训练已成为提升训练效率的有前景方法。现有框架通过对线性层的FP8计算加速训练,但优化器状态与激活仍采用更高精度,未能充分优化内存使用。本文提出COAT(用于FP8训练的优化器状态与激活压缩框架),一种新型FP8训练框架,旨在大幅减少训练大型模型时的内存占用。COAT通过两项关键创新解决当前局限:(1)动态范围扩展,使优化器状态分布更贴近FP8表示范围,从而减少量化误差;(2)混合粒度激活量化,结合逐张量与逐组量化策略优化激活内存。实验表明,COAT与BF16相比,端到端训练内存占用有效减少1.54倍,同时在大型语言模型预训练、微调及视觉语言模型训练等多任务中实现近乎无损的性能;与BF16相比,COAT还实现1.43倍的端到端训练加速,性能与TransformerEngine相当或更优。COAT支持在更少GPU上高效训练大型模型的全参数,并在分布式训练中实现批量大小翻倍,为大规模模型训练的扩展提供实用方案。代码可在https://github.com/NVlabs/COAT获取。
英文摘要:
FP8 training has emerged as a promising method for improving training efficiency. Existing frameworks accelerate training by applying FP8 computation to linear layers while leaving optimizer states and activations in higher precision, which fails to fully optimize memory usage. This paper introduces COAT (Compressing Optimizer States and Activations for FP8 Training), a novel FP8 training framework designed to significantly reduce memory footprint when training large models. COAT addresses current limitations through two key innovations: (1) Dynamic Range Expansion, which aligns optimizer state distributions more closely with the FP8 representation range, thereby reducing quantization error, and (2) Mixed-Granularity Activation Quantization, which optimizes activation memory using a combination of per-tensor and per-group quantization strategies. Experiments demonstrate that COAT effectively reduces end-to-end training memory footprint by 1.54x compared to BF16 while achieving nearly lossless performance across various tasks, such as Large Language Model pretraining and fine-tuning and Vision Language Model training. COAT also achieves a 1.43x end-to-end training speedup compared to BF16, performing on par with or surpassing TransformerEngine's speedup. COAT enables efficient full-parameter training of large models on fewer GPUs, and facilitates doubling the batch size in distributed training settings, providing a practical solution for scaling large-scale model training. The code is available at https://github.com/NVlabs/COAT.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。