What is Tensor core?
A GPU unit that computes the product and sum of small matrices in one instruction, mainly with low-precision numbers, greatly speeding up AI.
Field: GPU Programming
Read the beginner explainer: Why Are GPUs Used for AI? Matrix Math and Memory Explained
Japanese name: テンソルコア
What a tensor core computes
A tensor core is a dedicated matrix unit in NVIDIA GPUs that computes a multiply-accumulate of small matrices, D = A × B + C, in a single instruction. In the first generation, each tensor core performs a multiply-accumulate of 4 × 4 matrices per clock, that is, 64 multiply-add operations. Programs use them through instructions in which a warp (32 threads) cooperates on somewhat larger matrix fragments, such as 16 × 16. Most of the work in fully connected and convolutional layers of neural networks can be expressed as matrix products, so tensor cores greatly speed up AI workloads.
Combining low and high precision
Tensor cores are mainly used with low-precision inputs such as FP16, BF16, FP8 and INT8, because doing the multiplications in formats with fewer bits saves a great deal of arithmetic area, power, memory capacity and bandwidth. Accumulating thousands of products, however, piles up rounding error, so the basic pattern is mixed precision: FP16 inputs with FP32 accumulation. Supported formats have grown over the generations, and some products also handle TF32, which shares FP32's exponent field, or double-precision FP64. Which formats are available depends on the generation.
Why they are faster than ordinary units
Matrix multiplication reuses the same data many times: multiplying two n × n matrices takes n³ multiply-adds but only on the order of n² data values, so computing in small matrix blocks raises the amount of work per register read and per instruction issued. Ordinary units (CUDA cores) perform one multiply-add per thread at a time, whereas tensor cores build this reuse into the hardware and can do many times more operations for the same area and power. In exchange, they cannot be used for anything other than matrix multiply-accumulate, and data must be laid out in fixed shapes.
How they are used, and other matrix units
Tensor cores are usually not programmed directly but used through libraries such as cuBLAS and cuDNN or frameworks such as PyTorch. With data in FP16 or BF16 and matrix dimensions aligned to the recommended multiples, the library chooses methods that use the tensor cores. In CUDA they can also be used directly through the WMMA API, which handles matrix fragments per warp, or through PTX mma instructions. Other vendors' GPUs and AI accelerators have matrix units for the same purpose, and some, such as Google's TPU, compute matrix products with a systolic array.
Try it: questions about Tensor core
- AThey compute products and sums of small matrices in a single instruction, greatly accelerating AI mainly with low-precision numbers
- BThey are sensors that measure a physical quantity called a tensor
- CThey are circuits dedicated to drawing shadows in graphics
Show answer and explanation
Answer: A. They compute products and sums of small matrices in a single instruction, greatly accelerating AI mainly with low-precision numbers
A tensor core multiplies and accumulates small matrices, such as 4 × 4 or 16 × 16, in a single instruction. For the same area and power it performs many times more work than ordinary units doing one multiply and add at a time. It is mostly used with low precisions such as FP16, BF16, FP8 and INT8, greatly speeding up the matrix products that dominate neural network training and inference.
FAQ
What is the difference between tensor cores and CUDA cores?
CUDA cores are general-purpose units in which each thread performs one multiply-add (for example in FP32) or integer operation at a time. Tensor cores are dedicated units that perform a multiply-accumulate of small matrices with one warp-level instruction, so for matrix products they do far more operations per clock.
What is TF32?
A compute format NVIDIA introduced with its Ampere-generation tensor cores. It has the same 8-bit exponent as FP32 and the same 10-bit mantissa as FP16. FP32 data can be fed in directly, keeping FP32's range while trading mantissa precision for fast tensor-core computation.
Are tensor cores used for training or inference?
Both. Training mostly uses mixed precision with BF16 or FP16, and inference often uses even lower precisions such as FP8 or INT8; in both cases they speed up the matrix products that dominate the computation.
Books on GPU Programming Ad
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.
Back to the glossary