GPU矩阵乘法-累加单元的位精确建模:解开数值差异和精度的谜团
Bit-Accurate Modeling of GPU Matrix Multiply-Accumulate Units: Demystifying Numerical Discrepancy and Accuracy
AI总结:
本文提出CLFP框架,构建了十种GPU架构的MMA操作位精确算术模型,揭示了四个精度瓶颈和一个数值不对称设计,为未来MMA单元设计提供指导。
摘要:
现代AI加速器依赖矩阵乘法-累加单元(MMAUs)如NVIDIA张量核心和AMD矩阵核心来加速深度神经网络工作负载。MMAUs仅暴露指令级或API级的矩阵乘法-累加(MMA)操作接口,而内部浮点运算行为未被记录。因此,不同厂商和架构世代的MMAUs在相同输入下常产生数值差异,有时甚至表现出降低的数值精度,可能引发训练不稳定。在没有白盒模型的情况下,诊断和理解这些效应的根源具有挑战性。本文提出闭合回路特征探测(CLFP),一种通用且系统的框架,用于构建MMA操作的完整算术行为模型。基于此框架,我们分析了十种GPU架构上所有MMA指令,从NVIDIA Volta到RTX Blackwell,从AMD CDNA1到CDNA3,并推导出这些MMAUs的第一个位精确算术模型。我们的模型解释了之前观察到的跨平台数值差异和精度问题,使白盒数值误差分析成为可能,揭示了四个影响数值精度的精度瓶颈设计和一个显著影响数值精度的数值不对称设计,并提供了软件工作绕以及未来MMAUs的设计指导。本工作在https://github.com/microsoft/MMA-Sim 上开源。
英文摘要:
Modern AI accelerators rely on matrix multiply-accumulate units (MMAUs), such as NVIDIA Tensor Cores and AMD Matrix Cores, to accelerate deep neural network workloads. MMAUs expose only instruction-level or API-level interfaces of matrix multiply-accumulate (MMA) operations, while leaving internal floating-point arithmetic behavior undocumented. Consequently, MMAUs across vendors and architectural generations often produce numerical discrepancies for identical inputs, and sometimes exhibit reduced numerical accuracy that can cause training instability. Diagnosing and understanding the root causes of these effects is challenging without white-box models of their arithmetic behavior. This paper proposes closed-loop feature probing (CLFP), a generic and systematic framework for constructing bit-accurate arithmetic behavior models of MMA operations. Based on this framework, we analyze all MMA instructions on ten GPU architectures spanning NVIDIA Volta through RTX Blackwell and AMD CDNA1 through CDNA3, and derive the first bit-accurate arithmetic models for these MMAUs. Our models explain previously observed cross-platform numerical discrepancies and accuracy issues, enable white-box numerical error analysis, reveal four types of precision bottlenecks and one type of numerical asymmetry, and inform software workarounds as well as design suggestions for future MMAUs. This work is open-source at https://github.com/microsoft/MMA-Sim
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。