Back to Search
Start Over
Squeezing a Matrix into Half Precision, with an Application to Solving Linear Systems
- Source :
- Higham, N, Pranesh, S & Zounon, M 2019, ' Squeezing a Matrix into Half Precision, with an Application to Solving Linear Systems ', S I A M Journal on Scientific Computing . https://doi.org/10.1137/18M1229511
- Publication Year :
- 2019
- Publisher :
- Society for Industrial & Applied Mathematics (SIAM), 2019.
-
Abstract
- Motivated by the demand in machine learning, modern computer hardware is increas- ingly supporting reduced precision floating-point arithmetic, which provides advantages in speed, energy, and memory usage over single and double precision. Given the availability of such hardware, mixed precision algorithms that work in single or double precision but carry out part of a compu- tation in half precision are now of great interest for general scientific computing tasks. Because of the limited range of half precision arithmetic, in which positive numbers lie between 6 × 10−8 and 7 × 104, a straightforward rounding of single or double precision data into half precision can lead to overflow, underflow, or subnormal numbers being generated, all of which are undesirable. We develop an algorithm for converting a matrix from single or double precision to half precision. It first applies two-sided diagonal scaling in order to equilibrate the matrix (that is, to ensure that every row and column has ∞-norm 1), then multiplies by a scalar to bring the largest element within a factor θ ≤ 1 of the overflow level, and finally rounds to half precision. The second step ensures that full use is made of the limited range of half precision arithmetic, and θ must be chosen to allow sufficient headroom for subsequent computations. We apply the new algorithm to GMRES-based iterative re- finement (GMRES-IR), which solves a linear system Ax = b with single or double precision data by LU factorizing A in half precision and carrying out iterative refinement with the correction equations solved by GMRES preconditioned with the low precision LU factors. Previous implementations of this algorithm have used a crude conversion to half precision that our experiments show can cause slow convergence of GMRES-IR for badly scaled matrices or failure to converge at all. The new conversion algorithm computes ∞-norms of rows and columns of the matrix and its cost is negligible in the context of LU factorization. We show that it leads to faster convergence of GMRES-IR for badly scaled matrices and thereby allows a much wider class of problems to be solved.
- Subjects :
- Arithmetic underflow
half precision arithmetic
overflow
Double-precision floating-point format
010103 numerical & computational mathematics
GMRES
Row and column spaces
01 natural sciences
law.invention
Matrix (mathematics)
preconditioning
Iterative refinement
law
iterative refinement
linear system
0101 mathematics
Mathematics
mixed precision
Applied Mathematics
Rounding
underflow
LU decomposition
Computational Mathematics
subnormal numbers
Denormal number
fp16
Algorithm
diagonal scaling
Subjects
Details
- ISSN :
- 10957197 and 10648275
- Volume :
- 41
- Database :
- OpenAIRE
- Journal :
- SIAM Journal on Scientific Computing
- Accession number :
- edsair.doi.dedup.....fc9b4e3b05495d79004338eea7eafc4a
- Full Text :
- https://doi.org/10.1137/18m1229511