What Is a Tensor Core? Matrix Multiplication and Precision
Tensor Cores are NVIDIA GPU units for accelerating supported matrix multiply-accumulate operations. Learn how tiled matrix work maps to them, how input and accumulator precision differ, and how to verify accuracy and real-workload performance.
What Tensor Cores Do
A Tensor Core is a dedicated execution unit in NVIDIA GPUs that accelerates matrix multiplication and accumulation. It is useful for operations with many dot products, such as fully connected layers and convolutions in neural networks. Supported input types and accumulator precision depend on GPU architecture and API; having Tensor Cores does not guarantee that a whole program will be faster or retain the same accuracy as a reference.
In matrix multiplication, each output element is the sum of products from one row of the left matrix and one column of the right matrix. A Tensor Core operation can be understood as D = A × B + C: multiply input matrices A and B and add the result to an accumulator matrix C to produce D.
Hand-calculated example (A is 2×3; B is 3×2):
A = [[1, 2, 3], [4, 5, 6]]
B = [[7, 8], [9, 10], [11, 12]]
A × B = [[58, 64], [139, 154]]
1×7 + 2×9 + 3×11 = 58
GPUs Divide Large Matrices into Tiles
Real matrix-multiplication libraries divide the output into tiles. A thread block often computes one output tile, loads the required pieces of A and B, and accumulates them. It may continue with the next slice along the K dimension. Tensor Cores accelerate supported matrix multiply-accumulate operations in this process. Tile shapes and alignment rules depend on GPU generation, CUDA API, and library version; check the documentation for the software you actually run instead of applying old divisibility rules to every GPU.
Input and Accumulator Precision Can Differ
Precision describes how finely and over what range a number can be represented. Lower-precision inputs use fewer bytes and may enable higher throughput, but rounding can change values, large values may overflow, and small values may underflow to zero. The accumulator stores running sums. Using a higher-precision accumulator can reduce accumulation error, but it cannot restore information already lost when inputs were rounded.
These are examples in the CUDA Programming Guide WMMA API table, not a guarantee for every GPU or execution path; check the target architecture and API. For WMMA with TF32, the guide requires manually converting input matrices to tf32 precision. Frameworks or libraries may expose different controls; follow their API documentation.
| Inputs A and B | Accumulator | Example tile (M×N×K) in the guide’s WMMA API |
|---|---|---|
| FP16 × FP16 | FP32 | 16×16×16 |
| BF16 × BF16 | FP32 | 16×16×16 |
| TF32 × TF32 | FP32 | 16×16×8 |
How to Check Whether an Operation Uses Tensor Cores
System.Object[]
Tensor Cores accelerate supported matrix multiply-accumulate paths; they do not replace general GPU arithmetic. Check the data types and tile support, preserve the required numerical accuracy, and measure the complete operation on the workload you will use.
Sources
[NVIDIA CUDA Programming Guide: WMMA and Tensor Core element types](https://docs.nvidia.com/cuda/cuda-programming-guide/05-appendices/cpp-language-extensions.html)
[NVIDIA GPU Performance Background User's Guide](https://docs.nvidia.com/deeplearning/performance/dl-performance-gpu-background/index.html)
[NVIDIA Matrix Multiplication Background User's Guide](https://docs.nvidia.com/deeplearning/performance/dl-performance-matrix-multiplication/index.html)
[NVIDIA: Train With Mixed Precision](https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html)