arXiv:2604.08826cs.LGcs.AI2026-04被引 2

HiFloat4在昇腾芯片上实现大模型4位浮点训练,提升效率并保持精度

HiFloat4 Format for Language Model Pre-training on Ascend NPUs

论文配图:HiFloat4 Format for Language Model Pre-training on Ascend NPUs
图 1 · 摘自论文原文
  • 采用HiFloat4格式在昇腾NPU上全程4位浮点计算
  • 相比全精度训练,计算吞吐提升4倍,误差控制在1%以内
  • 适用于大模型和专家混合架构,适合算力受限场景

大型基础模型已成为现代机器学习的核心,其性能随模型规模和数据量呈可预测增长。然而,训练和部署这些模型带来巨大的计算与内存开销,推动了低精度训练技术的发展。近期研究证明,4位浮点(FP4)格式如MXFP4和NVFP4可用于大语言模型中的线性GEMM运算,相比高精度基线实现最高4倍的计算吞吐和内存效率提升。本文研究华为昇腾NPU上提出的HiFloat4 FP4格式,并在大规模训练环境中系统对比其与MXFP4的表现。所有实验均在昇腾NPU集群上进行,线性层和专家层的GEMM运算均完全以FP4精度执行。评估涵盖密集架构(如Pangu、LLaMA风格模型)和混合专家(MoE)模型,其中标准线性层和专家特定的GEMM均在FP4下运行。此外,我们探索了针对FP4训练的稳定化技术,显著减少数值退化,在保持4位计算效率的同时,将相对误差控制在全精度基线的1%以内。结果提供了对NPUs上FP4训练的全面实证分析,揭示了不同FP4格式在大规模密集与MoE模型中的实际权衡。

原文摘要 · Abstract (English)

Large foundation models have become central to modern machine learning, with performance scaling predictably with model size and data. However, training and deploying such models incur substantial computational and memory costs, motivating the development of low-precision training techniques. Recent work has demonstrated that 4-bit floating-point (FP4) formats--such as MXFP4 and NVFP4--can be successfully applied to linear GEMM operations in large language models (LLMs), achieving up to 4x improvements in compute throughput and memory efficiency compared to higher-precision baselines. In this work, we investigate the recently proposed HiFloat4 FP4 format for Huawei Ascend NPUs and systematically compare it with MXFP4 in large-scale training settings. All experiments are conducted on Ascend NPU clusters, with linear and expert GEMM operations performed entirely in FP4 precision. We evaluate both dense architectures (e.g., Pangu and LLaMA-style models) and mixture-of-experts (MoE) models, where both standard linear layers and expert-specific GEMMs operate in FP4. Furthermore, we explore stabilization techniques tailored to FP4 training that significantly reduce numerical degradation, maintaining relative error within 1% of full-precision baselines while preserving the efficiency benefits of 4-bit computation. Our results provide a comprehensive empirical study of FP4 training on NPUs and highlight the practical trade-offs between FP4 formats in large-scale dense and MoE models.

FP4昇腾大模型训练低精度

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。