Giter VIP home page Giter VIP logo

tensor-cores-numerical-behavior's Introduction

Numerical Behavior of the NVIDIA Tensor Cores

The aim of this test suite is to probe the numerical behavior of the tensor cores that equip some recent NVIDIA graphic cards. The tests in the suite are divided into 4 sections, and show the following features.

A. Support for subnormal numbers

  • Tensor cores accept binary16 subnormals in input in binary16 mode
  • Tensor cores accept binary16 subnormals in input in binary32 mode
  • Tensor cores accept binary32 subnormals in input and return them
  • Tensor cores can return binary16 subnormals in binary16 mode
  • Tensor cores can return binary16 subnormals in binary32 mode

B. Accuracy of the dot products

  • Tensor cores compute the products of two binary16 numbers exactly
  • Tensor cores compute the products of two binary16 numbers exactly (binary16 mode)
  • Tensor cores accumulate sums in binary32 arithemetic
  • Tensor cores accumulate partial sums on the largest element in absolute value

C. Rounding modes in tensor core computations

  • Tensor cores use round-down for postive values
  • Tensor cores use round-up for negative values
  • Tensor cores round the accumulator using round-to-nearest (binary16 mode)

D. Features of the accumulator

  1. Tensor cores do not implement guard digits (extra bits on the right)
  2. Tensor cores do not normalize by shifting right (in sums of elements with same sign)
  3. Tensor cores do not normllize by shifting left (in sums of elements with opposite sign)
  4. Tensor cores implement two carry-out digits (extra bits on the left)
  5. The product of tensor cores is not monotonic

Compiling and running the suite

The experiments can be compiled by issuing make all, which generates several executable files:

  • test-V100, for testing Volta GPUs (requires version 9 or newer of the CUDA platform);
  • test-T4, for testing Turing GPUs (requires version 10 or newer of the CUDA platform);
  • test-A100-binary16, test-A100-bf16, test-A100-tf32, test-A100-binary64, for testing the four precision configurations available on Ampere GPUs (requires version 11 or newer of the CUDA platform).

Reference

Details about the code in this repository can be found in:

Massimiliano Fasi, Nicholas J. Higham, Mantas Mikaitis, and Srikara Pranesh. Numerical Behavior of the NVIDIA Tensor Cores. PeerJ Computer Science 7:e330, 2021.

License

This software is distributed under the terms of the GNU GPL v.2 software license (see LICENSE.md).

tensor-cores-numerical-behavior's People

Contributors

mfasi avatar mmikaitis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.