TECHNOLOGY

When does TornadoVM’s fused cuBLASLt epilogue help inference?

In this article
THE QUICK TAKE

Adopt the epilogue when it preserves the reference output within tolerance and saves time or memory across the actual graph.

TornadoVM 8.2.0, released November 24, adds cuBLASLt matrix products with bias, GELU and ReLU epilogues for FP32 and TF32 paths. An epilogue applies operations as the product is finished. For a compatible layer, a fused path can avoid launching separate kernels and materializing intermediate tensors. The effect depends on layout, chosen kernel and neighboring operations.

Describe the layer before timing it

Record both matrix dimensions, dtype, layout and the broadcast direction of the bias. Reproduce the exact order of bias and activation. An implementation with the same activation name but different approximation can yield measurably different outputs. Use inputs around zero for ReLU and in the transition region for GELU when checking correctness.

Construct a fair reference

Run the same product and activation as separate operations on the same device with the same precision setting. Compare elementwise error and several examples that make it through subsequent layers or reach a classifier. Deliberately vary one input dimension at a time, so a failed shape can be diagnosed without attributing it to an unrelated change.

Watch the allocations between layers

Measure peak temporary memory and verify which layer consumes the fused result. A useful improvement can disappear if an adjacent operation requires conversion or changes layout. Time a warmed layer and then the surrounding graph on identical inputs. Include small interactive batches and larger batches where the product itself may dominate.

Track math mode explicitly

Treat FP32 and TF32 as separate rows in the results. Save the effective mode and compare each against a precision baseline appropriate to the task. For an application that thresholds a score, count changed decisions around the threshold as well as aggregate tensor error. Repeat when changing the CUDA driver or library versions that determine the selected kernel.

Approve the measured shapes

Keep a compact table of shapes, precision modes, observed accuracy, memory and end-to-end time. Enable the fused path for variants backed by the measurements and keep a known reference for regression tests. The release adds a useful execution option. Your measured graph determines where the optimization pays off.

Keep a record of which shapes are frequent and which are rare. A faster result for an uncommon shape can look impressive in isolation while contributing little to the cost of the service.

Sources

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