TensorLean verifies GPU kernels at the PTX level
Researchers from Columbia University and CertiK have presented TensorLean, a Lean-based framework for formally checking production GPU kernels at the PTX level. The system compares compiled kernels with tensor-level mathematical specifications and examines four properties: absence of data races, termination, output correctness within a stated tolerance, and preservation of unrelated memory.
The team evaluated 149 kernel instances, covering all kernels in FlashAttention-2, FlashAttention-3 and FlashAttention-4, as well as DeepGEMM and projects including Liger Kernel, TileOPs, TileLang and Triton. TensorLean proved 83 instances correct and identified 38 correctness bugs across six projects. FlashAttention accounted for 23 of the reported issues. The findings included 19 memory-access errors, 13 numerical bugs, seven data races and five uninitialized-memory reads; individual bugs may belong to multiple categories.
The framework uses a 1.8K-line PTX parser and specifications totaling 10,278 lines, compared with 151,285 lines of kernel code. It can analyze PTX for A100, H100 and B200 GPUs on a 16-core workstation. The reported median check time was about 10 minutes, with a maximum of 50 minutes. One FlashAttention-4 data race was detected despite not appearing in 17,760 tests.
Written by Sakhanda Wire AI from reporting by MarkTechPost. Facts, quotes and full context are in the original article below.