Case study. Kernel correctness on Kaggle GPUs
The Triton fused softmax tutorial crashed on narrow rows before the kernel ever ran. We traced it to the host wrapper, corrected only that, and measured the result against PyTorch on the same GPU.
Book a demo See the engineSoftmax cases, run 02 and run 04Measured
Same shapes, input patterns, dtypes and seed in both runs. Tolerances unchanged.
The workload
Vector add and fused softmax from the Triton tutorials, each against a PyTorch control, in float32 and float16. Every notebook had two Tesla T4 GPUs, compute capability 7.5, with the work on cuda:0.
Run sequenceMeasured
Run 02 errors were preserved, then rerun on the corrected wrapper in run 04.
What changed
The tutorial wrapper estimates occupancy by dividing by the shared memory each program needs. Softmax widths 1 and 7 compiled to zero shared memory bytes in both dtypes, so the wrapper raised ZeroDivisionError before dispatch. Width 129 used 32 bytes and ran.
Occupancy pathRecorded
Six static wrapper checks passed before the corrected GPU run.
Before and after
The fair rerun gave both sides the same inputs and preallocated outputs, alternated the order, and timed two ways. End to end includes Python dispatch and synchronization. GPU graph timing captures only the GPU work.
End to end p50, µsMeasured
Two Tesla T4 allocated, run on cuda:0. 30 synchronized host samples per side, includes Python dispatch and sync.
GPU graph p50, µsMeasured
20 GPU graph averages per side from triton.testing.do_bench_cudagraph. Excludes Python dispatch and allocation.
The checks
Inputs used a fixed seed. A CPU reference ran on the same quantized inputs in NumPy float64. Each case ran three times and had to match tolerance, stay finite and repeat bit for bit.
CorrectnessMeasured
Three repeats per case, exact repeat equality required.
FAQ
Correctness of Triton vector add and fused softmax against PyTorch on Tesla T4 GPUs, and p50 time per call for add at 1,048,577 elements and softmax at 256×1025, end to end and in GPU graph replay.
No. Only the host wrapper changed. GPU arithmetic, precision and the kernel algorithm are the same, and the tolerances stayed fixed.
End to end timing includes Python dispatch and synchronization. In GPU graph replay, which removes that host cost, Triton softmax is about 1.31× and 1.35× faster.
Each module and notebook carries a SHA-256 hash, and every run is tied to a pinned container image and a fixed seed.
Next step
The engine runs it on real hardware, finds where the time and the faults sit, and corrects them layer by layer. See how the engine works or book a demo.
Book a demo See the engine