GPU Tensor Core Programming is the practice of driving specialized matrix-multiply-accumulate hardware in modern GPUs to accelerate linear algebra — performing a full matrix tile operation per issue at throughput exceeding a petaFLOP on high-end parts, far beyond what standard CUDA cores deliver.
A tensor core is a hardware unit that does one matrix-multiply-accumulate per issue. Each core computes $D = A \times B + C$ in a single operation, where $A$ and $B$ are low-precision inputs (FP16, BF16, TF32, or INT8) and the accumulator $C$ and result $D$ are kept in higher precision (usually FP32) to protect numerical accuracy. A streaming multiprocessor holds 4-16 tensor cores depending on the GPU generation, and throughput has climbed sharply across them: Volta reached 125 TFLOPS in FP16, Ampere 312 TFLOPS in FP16/BF16, and Hopper 989 TFLOPS in FP16 \u2014 an 8-16x jump over standard CUDA cores for the operations they accelerate. The operation executes at warp granularity: all 32 threads of a warp cooperatively supply matrix fragments and receive the result, so the programming model is inherently collective rather than per-thread.
Four programming interfaces expose the hardware at different levels. The WMMA (Warp Matrix Multiply-Accumulate) C++ API offers fragment types for the $A$, $B$, and $C$ matrices, with `load_matrix_sync`, `mma_sync`, and `store_matrix_sync` managing fragment data across common tile shapes such as 16x16x16. Below that, the `mma.sync.aligned` PTX instruction gives library authors exact control over matrix dimensions and data types. At the high level, cuBLAS and cuDNN dispatch to tensor cores automatically whenever input dimensions and types are compatible, so a cuBLAS GEMM with FP16 inputs is the easiest adoption path. For custom kernels, NVIDIA's CUTLASS template library supplies the building blocks \u2014 tile iterators, warp-level MMA, and epilogue fusion \u2014 that researchers assemble into bespoke GEMM variants.
Getting the published TFLOPS requires feeding the cores correctly. Matrix dimensions should be multiples of the tile size (16 for WMMA); padding odd dimensions to the next multiple keeps the cores fully utilized instead of wasting partial tiles. Memory layout matters too: the fragment loading pattern must match the row-major or column-major storage, or an implicit transpose eats into throughput. Epilogue fusion folds follow-on element-wise work (bias add, activation, scaling) into the same kernel, avoiding a round-trip to memory for intermediate results and improving memory efficiency by 2-3x. Finally, tile size trades against occupancy: larger tiles compute more efficiently but reduce the number of resident warps, so the best size balances tensor-core utilization against the latency hiding that occupancy provides.
Read tensor-core programming through a *feed-the-array* lens rather than a *peak-TFLOPS* lens: the cores can only sustain their rated throughput when tiles are the right shape, laid out to load without transpose, and kept busy by fused epilogues, so the real engineering is arranging data so the matrix engine never stalls.