CPU, GPU AND RAM

Tensor Core fragments: distributing a matrix operation across threads

In this article
THE QUICK TAKE

Tensor Core fragments distribute a tile across cooperating threads; use the documented layout and participation contract instead of inferring coordinates from storage slots.

A matrix instruction is often a cooperative operation whose operands and results are distributed across participating threads. The logical tile shown in an algorithm is not necessarily stored as a simple row-major array inside each thread. Fragment ownership is part of the programming interface and should be respected when composing tensor operations.

The matrix tile is a collective object

The mathematical operands belong to one tile operation, but their representation can be split across threads. A thread’s fragment is therefore only a part of the collective representation. A programming API can make some details deliberately opaque. Treating every fragment element as an independently indexed matrix coordinate can break portability across supported implementations. The interface’s loading, operation and storage routines define how the collective object should be used.

Primary reference: CUDA Programming Guide: Writing SIMT Kernels.

Loading establishes the layout contract

An input matrix has a physical layout, leading dimension and element format. The fragment load translates that representation into the form required by the matrix operation. A wrong stride can produce valid memory accesses containing the wrong mathematical values. For an illustrative test, use a matrix whose rows have distinguishable patterns so a transposition or stride mistake becomes visible in the result rather than disappearing inside uniform input.

Primary reference: CUDA C++ Best Practices Guide.

Participation is part of the operation

Cooperative matrix APIs impose requirements on which threads execute the operation and how they reach it. A source branch that excludes some required participants can invalidate those requirements. This differs from ordinary independent scalar work, where skipping one thread may only omit its own element. Follow the particular API’s execution contract and supported shapes. A successful result on a convenient path does not replace those documented participation conditions.

Primary reference: Nsight Compute Profiling Guide.

Accumulation and conversion remain explicit

Input format, accumulator format and output conversion can have different numerical roles. Fragment distribution does not remove rounding or overflow questions. Compare results against a reference with stated tolerances and challenging magnitudes, not only a visually plausible matrix. If a format or accumulation path changes, record that as part of the implementation identity. A layout explanation and a numerical explanation answer connected but separate correctness questions.

Compose through supported boundaries

When a later operation needs a different layout, use a documented conversion or storage boundary rather than assuming a private fragment mapping. Such a boundary may add movement, so its cost belongs in the complete comparison. Record the API, shape, formats and actual target. This makes the implementation understandable without claiming that every Tensor Core generation shares identical layouts, capabilities or supported element types.

Related reading: A GPU inference benchmark you can trust; Reproducible inference stacks: preserving a GPU pilot’s result.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles