用微尺度与自动缩放实现高效高精度的FP8大模型训练
MOSS: Efficient and Accurate FP8 LLM Training with Microscaling and Automatic Scaling
- 采用双层微尺度量化敏感激活,平衡精度与解量化开销
- 通过预测调整权重缩放因子,避免耗时的最大值归约操作
- 70亿参数模型训练效率提升34%,媲美半精度基线表现
使用FP8格式训练大语言模型可显著提升效率,但其较低的数值精度带来训练稳定性和准确性挑战。现有框架采用混合粒度量化,对激活使用分组量化,对权重使用张量/块量化。尽管有效,分组量化需沿矩阵乘法内维进行缩放,引入额外解量化开销。此外,这些框架常依赖即时缩放动态调整缩放因子,但在线量化涉及多次内存读写,抵消了FP8的性能优势。为此,我们提出MOSS,一种新型FP8训练框架,兼顾效率与数值稳定性。MOSS引入两项关键创新:(1) 针对敏感激活的两层微尺度策略,结合高精度全局缩放与紧凑的2的幂次局部缩放,平衡精度与解量化成本;(2) 线性层权重的自动缩放,通过训练中预测和调整缩放因子,消除昂贵的最大值归约操作。基于此,MOSS实现了70亿参数模型的高效FP8训练,在性能上媲美BF16基线的同时,训练吞吐量最高提升34%。
原文摘要 · Abstract (English)
Training large language models with FP8 formats offers significant efficiency gains. However, the reduced numerical precision of FP8 poses challenges for stable and accurate training. Current frameworks preserve training performance using mixed-granularity quantization, i.e., applying per-group quantization for activations and per-tensor/block quantization for weights. While effective, per-group quantization requires scaling along the inner dimension of matrix multiplication, introducing additional dequantization overhead. Moreover, these frameworks often rely on just-in-time scaling to dynamically adjust scaling factors based on the current data distribution. However, this online quantization is inefficient for FP8 training, as it involves multiple memory reads and writes that negate the performance benefits of FP8. To overcome these limitations, we propose MOSS, a novel FP8 training framework that ensures both efficiency and numerical stability. MOSS introduces two key innovations: (1) a two-level microscaling strategy for quantizing sensitive activations, which balances precision and dequantization cost by combining a high-precision global scale with compact, power-of-two local scales; and (2) automatic scaling for weights in linear layers, which eliminates the need for costly max-reduction operations by predicting and adjusting scaling factors during training. Leveraging these techniques, MOSS enables efficient FP8 training of a 7B parameter model, achieving performance comparable to the BF16 baseline while achieving up to 34% higher training throughput.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。