arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2604.08826cs.LGcs.AIcs.CL
收藏

HiFloat4格式用于在Ascend NPUs上预训练语言模型

HiFloat4 Format for Language Model Pre-training on Ascend NPUs

Huawei(华为)
Mehran Taghian, Yunke Peng, Xing Huang, Yao Wang, Yaoyuan Wang, Wei Guo, Yuanyong Luo, Tianchi Hu, Junsong Wang, Xin Wang, Hu Liu, Yu Cheng, Ziwei Yu, Hongliang… 展开作者

Mehran Taghian, Yunke Peng, Xing Huang, Yao Wang, Yaoyuan Wang, Wei Guo, Yuanyong Luo, Tianchi Hu, Junsong Wang, Xin Wang, Hu Liu, Yu Cheng, Ziwei Yu, Hongliang Li, Mehdi Rahimifar, Lei Yan, Xuefei Wang, Zhuang Ma, Lei Liu, Hui Yu, Anandharaju Durai Raju, Hoang Le, Hei Yi Mak, Tanzila Rahman, Shadan Golestan

AI总结:

本文研究了HiFloat4 4位浮点格式在Ascend NPUs上的应用,比较了其与MXFP4在大规模训练中的性能,展示了FP4在计算效率和内存利用率上的优势,同时探讨了FP4训练中的稳定性技术。

摘要:

大型基础模型已成为现代机器学习的核心,其性能随模型大小和数据量呈可预测增长。然而,训练和部署此类模型会带来显著的计算和内存成本,推动了低精度训练技术的发展。最近的研究表明,4位浮点(FP4)格式,如MXFP4和NVFP4,可以成功应用于大型语言模型(LLMs)中的线性GEMM操作,相比更高精度的基线,计算吞吐量和内存效率可提高高达4倍。在本工作中,我们研究了最近提出的HiFloat4 FP4格式用于华为Ascend NPUs,并系统地比较了其与MXFP4在大规模训练设置中的表现。所有实验均在Ascend NPU集群上进行,线性和专家GEMM操作完全在FP4精度下完成。我们评估了密集架构(如Pangu和LLaMA风格模型)和混合专家(MoE)模型,其中标准线性层和专家特定的GEMM均在FP4下运行。此外,我们探讨了针对FP4训练定制的稳定技术,显著减少了数值退化,使相对误差保持在全精度基线的1%以内,同时保留了4位计算的效率优势。我们的结果提供了对NPUs上FP4训练的全面实证研究,并突显了FP4格式在大规模密集和MoE模型中的实际权衡。

英文摘要:

Training large foundation models at low numerical precision is one of the most promising directions for reducing the compute and memory cost of modern AI. Recent 4-bit floating-point formats such as MXFP4 and NVFP4 can be applied to linear GEMM operations in LLMs, but their limited dynamic range introduces numerical instability that prior work addresses by stacking stabilization mechanisms, typically executed at higher precision and partially eroding the efficiency gains that motivate FP4. In this work, we argue that numerical format design is itself a first-class lever for stable FP4 training, and present the first systematic study of FP4 LLM pretraining on energy-efficient Huawei Ascend NPUs. We compare the recently proposed HiFloat4 (HiF4) format against both MXFP4 and NVFP4, holding one recipe fixed across all three formats across dense (OpenPangu-1B, Llama3-8B) and Mixture-of-Experts (Qwen3-MoE-30B) architectures and executing all linear and expert GEMMs in FP4. At matched storage --- NVFP4 and HiF4 both spend 4.5 bits per value --- the three formats differ far more in what they require before they will train at all than in final accuracy. HiF4 reaches a relative loss of 1.55\% with no stabilization, below fully stabilized MXFP4 (1.79\%) and below NVFP4 carrying the per-tensor scaling it cannot train without (2.00\%); NVFP4 diverges under every combination of stochastic rounding and Hadamard transform we tried. Our results suggest that stable, accurate FP4 training does not require an ever-growing stack of stabilization techniques; it requires the right numerical format.

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

↑