Cargando…
Numerical behavior of NVIDIA tensor cores
We explore the floating-point arithmetic implemented in the NVIDIA tensor cores, which are hardware accelerators for mixed-precision matrix multiplication available on the Volta, Turing, and Ampere microarchitectures. Using Volta V100, Turing T4, and Ampere A100 graphics cards, we determine what pre...
Autores principales: | , , , |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
PeerJ Inc.
2021
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7959640/ https://www.ncbi.nlm.nih.gov/pubmed/33816984 http://dx.doi.org/10.7717/peerj-cs.330 |
_version_ | 1783664993776959488 |
---|---|
author | Fasi, Massimiliano Higham, Nicholas J. Mikaitis, Mantas Pranesh, Srikara |
author_facet | Fasi, Massimiliano Higham, Nicholas J. Mikaitis, Mantas Pranesh, Srikara |
author_sort | Fasi, Massimiliano |
collection | PubMed |
description | We explore the floating-point arithmetic implemented in the NVIDIA tensor cores, which are hardware accelerators for mixed-precision matrix multiplication available on the Volta, Turing, and Ampere microarchitectures. Using Volta V100, Turing T4, and Ampere A100 graphics cards, we determine what precision is used for the intermediate results, whether subnormal numbers are supported, what rounding mode is used, in which order the operations underlying the matrix multiplication are performed, and whether partial sums are normalized. These aspects are not documented by NVIDIA, and we gain insight by running carefully designed numerical experiments on these hardware units. Knowing the answers to these questions is important if one wishes to: (1) accurately simulate NVIDIA tensor cores on conventional hardware; (2) understand the differences between results produced by code that utilizes tensor cores and code that uses only IEEE 754-compliant arithmetic operations; and (3) build custom hardware whose behavior matches that of NVIDIA tensor cores. As part of this work we provide a test suite that can be easily adapted to test newer versions of the NVIDIA tensor cores as well as similar accelerators from other vendors, as they become available. Moreover, we identify a non-monotonicity issue affecting floating point multi-operand adders if the intermediate results are not normalized after each step. |
format | Online Article Text |
id | pubmed-7959640 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2021 |
publisher | PeerJ Inc. |
record_format | MEDLINE/PubMed |
spelling | pubmed-79596402021-04-02 Numerical behavior of NVIDIA tensor cores Fasi, Massimiliano Higham, Nicholas J. Mikaitis, Mantas Pranesh, Srikara PeerJ Comput Sci Algorithms and Analysis of Algorithms We explore the floating-point arithmetic implemented in the NVIDIA tensor cores, which are hardware accelerators for mixed-precision matrix multiplication available on the Volta, Turing, and Ampere microarchitectures. Using Volta V100, Turing T4, and Ampere A100 graphics cards, we determine what precision is used for the intermediate results, whether subnormal numbers are supported, what rounding mode is used, in which order the operations underlying the matrix multiplication are performed, and whether partial sums are normalized. These aspects are not documented by NVIDIA, and we gain insight by running carefully designed numerical experiments on these hardware units. Knowing the answers to these questions is important if one wishes to: (1) accurately simulate NVIDIA tensor cores on conventional hardware; (2) understand the differences between results produced by code that utilizes tensor cores and code that uses only IEEE 754-compliant arithmetic operations; and (3) build custom hardware whose behavior matches that of NVIDIA tensor cores. As part of this work we provide a test suite that can be easily adapted to test newer versions of the NVIDIA tensor cores as well as similar accelerators from other vendors, as they become available. Moreover, we identify a non-monotonicity issue affecting floating point multi-operand adders if the intermediate results are not normalized after each step. PeerJ Inc. 2021-02-10 /pmc/articles/PMC7959640/ /pubmed/33816984 http://dx.doi.org/10.7717/peerj-cs.330 Text en © 2021 Fasi et al. https://creativecommons.org/licenses/by/4.0/ This is an open access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/) , which permits unrestricted use, distribution, reproduction and adaptation in any medium and for any purpose provided that it is properly attributed. For attribution, the original author(s), title, publication source (PeerJ Computer Science) and either DOI or URL of the article must be cited. |
spellingShingle | Algorithms and Analysis of Algorithms Fasi, Massimiliano Higham, Nicholas J. Mikaitis, Mantas Pranesh, Srikara Numerical behavior of NVIDIA tensor cores |
title | Numerical behavior of NVIDIA tensor cores |
title_full | Numerical behavior of NVIDIA tensor cores |
title_fullStr | Numerical behavior of NVIDIA tensor cores |
title_full_unstemmed | Numerical behavior of NVIDIA tensor cores |
title_short | Numerical behavior of NVIDIA tensor cores |
title_sort | numerical behavior of nvidia tensor cores |
topic | Algorithms and Analysis of Algorithms |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7959640/ https://www.ncbi.nlm.nih.gov/pubmed/33816984 http://dx.doi.org/10.7717/peerj-cs.330 |
work_keys_str_mv | AT fasimassimiliano numericalbehaviorofnvidiatensorcores AT highamnicholasj numericalbehaviorofnvidiatensorcores AT mikaitismantas numericalbehaviorofnvidiatensorcores AT praneshsrikara numericalbehaviorofnvidiatensorcores |