Chip Foundry Services Request Assessment

GPU Tensor Core Programming

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.

Matrix workload
GEMM, convolution, attention
Pick precision
FP16 / BF16 / TF32 / INT8
Choose a programming interfacehigher level = easier; lower level = more control
cuBLAS / cuDNN
auto-dispatch, easiest path
CUTLASS
custom GEMM templates
WMMA API
warp fragment C++ API
MMA PTX
mma.sync, exact control
Warp-cooperative MMA on the tensor core
Load fragments
32 threads supply A, B, C tiles
Accumulate
D = A x B + C in FP32
↻ next tile until the matrix is covered
Store result
write D fragment back
Feed the array to hit peak
tile multiples of 16, matched layout, fused epilogue
One Tensor-Core Operation: D = A × B + C a whole matrix tile is multiplied and accumulated per issue, by all 32 threads of a warp together AFP16/BF16 tile × BFP16/BF16 tile + CFP32 accumulator = DFP32 result WHY IT IS FAST Low-precision inputs, high-precision accumulate — 8 to 16× the throughput of CUDA cores. Volta 125 · Ampere 312 · Hopper 989 TFLOPS (FP16) · tiles are multiples of 16 A single SM holds 4 to 16 tensor cores, each issuing one tile MMA at a time peak is reached only when tiles are shaped and laid out to keep every core fed

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.