TECHNOLOGY

cuBLASLt bias follows logical output rows, not a framework channel name

In this article
THE QUICK TAKE

Write the output matrix axes before configuring a bias pointer; storage layout alone does not identify the intended broadcast.

A fused projection adds bias along the wrong axis

Consider replacing a framework projection and bias addition with a cuBLASLt epilogue. The multiplication may match the reference while the fused output does not. If batch and feature dimensions happen to have equal sizes, an incorrectly interpreted bias axis can survive a shape check.

The cuBLASLt reference defines the ordinary bias epilogue using the logical rows of output matrix D. Begin with that matrix definition rather than a framework label such as channel.

Logical axes survive storage choices

For the documented bias epilogue, a packed bias vector matches D rows and broadcasts across columns. This is a statement about matrix coordinates. Row-major storage, transposition flags, and a reformulation of the multiplication must be traced separately.

If an adapter represents the transposed framework result, the correspondence between a D row and an application feature changes. Write that correspondence explicitly before allocating or selecting the bias vector. Reusing an existing pointer because its length fits is not enough.

Inspect descriptor construction

The official single-precision wrapper illustrates operation transforms and matrix layout descriptors. Use that structure to inventory dimensions and leading dimensions; the wrapper itself is not a bias-fusion example.

The mixed-type wrapper additionally keeps C and D descriptors distinct. That distinction matters when reasoning about a postprocessing operation on D rather than assuming every matrix shares an identical interpretation.

Support and meaning are separate checks

Consult the current support tables for the exact epilogue, storage order, data types, and batching mode. A mathematically meaningful broadcast does not guarantee support for every descriptor combination. Conversely, successful algorithm selection does not certify that the application chose the intended axis.

The tensor-axis guide helps translate application dimensions into matrix coordinates. Keep bias data type and lifetime explicit alongside its axis; neither follows from the pointer spelling.

Design a reference that exposes the error

Use unequal matrix dimensions and a bias pattern that varies by the intended feature. Compare the multiplication first, then the separately applied bias, and finally the fused operation. Constant bias hides axis mistakes, while square shapes can hide length mismatches.

Apply the benchmark method only after these comparisons. Reduced kernel count is a possible consequence of fusion, not evidence of correct broadcasting or a measured speedup on an unspecified GPU.

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