NVIDIA Tensor Cores and AMD Matrix Cores (together called Matrix Accelerators) are of growing interest in high-performance computing and machine learning owing to their high performance. Unfortunately, their numerical behaviors are not publicly documented, including the number of extra precision bits maintained, the accumulation order of addition, and predictable subnormal number handling during computations. This makes it impossible to reliably port codes across these differing accelerators. This paper contributes a collection of {\em Feature Targeted Tests for Numerical Properties} that that help determine these features across five floating-point formats, four rounding modes and additional that highlight the rounding behaviors and preservation of extra precision bits. To show the practical relevance of FTTN, we design a simple matrix-multiplication test designed with insights gathered from our feature-tests. We executed this very simple test on five platforms, producing different answers: V100, A100, and MI250X produced 0, MI100 produced 255.875, and Hopper H100 produced 191.875. Our matrix multiplication tests employ patterns found in iterative refinement-based algorithms, highlighting the need to check for significant result variability when porting code across GPUs.
翻译:NVIDIA张量核心(Tensor Cores)与AMD矩阵核心(Matrix Cores)统称为矩阵加速器,因其高性能而在高性能计算与机器学习领域备受关注。然而,其数值行为(包括维护的额外精度位数、加法运算的累加顺序,以及计算中可预测的非规格化数处理方式)并未公开文档化,导致无法在这些异构加速器间可靠地移植代码。本文提出了一套面向数值特性的特征定向测试方法(FTTN),可针对五种浮点格式、四种舍入模式,以及突显舍入行为与额外精度位保留特性的附加模式,确定上述特征。为证明FTTN的实际价值,我们基于特征测试获得的见解设计了简单的矩阵乘法测试。在五个平台执行该测试后得到不同结果:V100、A100和MI250X产生0值,MI100产生255.875,Hopper H100产生191.875。我们的矩阵乘法测试采用了迭代精化类算法中常见的模式,凸显了跨GPU移植代码时需检验结果显著变异性的必要性。