Although Fortran is almost 70 years old, the language continues to evolve in order to keep pace with developments in computer science. In particular, a flexible type system was introduced that allows developers to specify the sizes of floating-point numbers and integers. In the latest revisions of the Fortran standard, portable type variants for IEEE 754 binary64 (double precision, real64) and binary32 (single precision, real32) were added. However, the rapid development of AI toolkits and accelerator hardware has created a strong focus on floating-point types of lower precision and lower memory usage than binary32.
While the IEEE 754-2019 standard defines the binary16 type for representing half-precision numbers, the Fortran standard does not provide the real16 variant in the type system. In contrast, most C compilers support such a data type. In numerical linear algebra, there is strong interest in exploiting the high performance of accelerator devices for core algorithms like matrix decompositions or iterative solvers. Especially when the performance ratio between double, single, and half precision is on the order of 1:2:20, as on current NVidia H100 accelerators, it becomes highly beneficial to use lower-precision types. Yet, before performance can be targeted, correctness and accuracy must be verified when operating below single precision.
In this article, we present our Low Precision Fortran (LPF) library that enables the use of low-precision types -- binary16, bfloat16, fp8_e4m3, and fp8_e5m2 -- just like any other floating-point type in Fortran. Furthermore, we introduce extensions that support BLAS operations in low precision and show how easily existing routines can be rewritten to use these data types.
在这里,我提出了C和C++接口和实验实现的双重算法。我在上一篇题为"Twofold fast arithmetic"的文章中介绍了Twofold,用于跟踪浮点不准确性。测试表明,普通C实现了高性能计算的双重功能。C++接口使编码像普通的浮点数一样容易。我的目标是说服你尝试两次;我认为确保数学计算的准确性是值得的。代码和使用的例子可以在我的网站上找到,里面有参考资料。
Verificarlo: checking floating point accuracy through Monte Carlo Arithmetic
CMLA - Centre de Mathématiques et de Leurs Applications, ENS Cachan Université Paris-Saclay et CNRS UMR 8536(CMLA - 数学及其应用中心,巴黎萨克雷大学卡尚分校及法国国家科学研究中心);Université de Versailles Saint-Quentin-en-Yvelines Université Paris-Saclay(凡尔赛圣康坦昂伊夫林大学,巴黎萨克雷大学)
Analysis of Floating-Point Matrix Multiplication Computed via Integer Arithmetic
Innovative Computing Laboratory, University of Tennessee, Knoxville(田纳西大学诺克斯维尔分校创新计算实验室);Department of Mathematics, University of Manchester(曼彻斯特大学数学系);School of Computer Science, University of Leeds(利兹大学计算机科学学院)