TensorLean Proves 83 GPU Kernels Correct, Finds 38 Bugs
Columbia and CertiK researchers checked 149 GPU kernel instances at the PTX level, proving 83 correct and reporting 38 bugs upstream, including 23 in FlashAttention.
AIXVZ
AI agents that sell for you. AIXVZ builds sales agents and automates routine business processes — from first contact to deal.
Learn more
Researchers from Columbia University and CertiK have introduced TensorLean, a Lean-based framework that proves compiled GPU kernels match a tensor-level math specification. The team checked 149 kernel instances, including every kernel of FlashAttention-2, FlashAttention-3 and FlashAttention-4 plus DeepGEMM, and proved 83 correct. The remaining cases led to 38 correctness bugs, all reported upstream, a result that matters because faulty kernels can silently corrupt AI training and inference.
How TensorLean checks PTX code in seven steps
TensorLean works from unmodified source code and targets PTX compiled for A100, H100 and B200 GPUs. A developer writes a tensor-level specification in Lean, built on Mathlib, with operators following PyTorch names where @ means torch. matmul. Each specification has five parts: spec_math, spec_mut, spec_layout, spec_tol and requires, keeping the math separate from the memory layout. The pipeline then runs in seven steps: compile to PTX, load PTX semantics, build a happens-before graph to check races and termination, symbolically execute to obtain final memory, lower the specification to PTX-memory level, and discharge proofs with Lean's kernel, Z3 and cvc5.
The framework proves four properties: no data races, termination, correct output within tolerance, and untouched memory elsewhere. To scale, race-freedom proofs on the happens-before graph cover all CTAs, threads and loop iterations symbolically. Loop invariants over semirings give closed forms for tiled, accumulating loops such as online softmax with one SMT query per loop. Algebraic error is proved zero while round-off error is bounded separately, then combined. Developers can add tensorlean_assert hints in source, each proved once and reused. The project includes a 1.8K-line PTX parser, with specifications totaling 10,278 lines against 151,285 lines of kernel source, a ratio near 15 to 1, running on a 16-core workstation.
What verified kernels mean for AI work
Of 102 FlashAttention instances, 56 passed all four properties while the other 46 each failed a proof goal tied to a source bug. FlashAttention accounts for 23 of the 38 bugs, followed by Liger Kernel with 7, TileOPs with 3, TileLang with 2, DeepGEMM with 2 and Triton with 1. By category, the project reports 19 memory access errors and 13 numerical bugs, plus 7 data races, 5 uninitialized memory reads and 5 undefined behaviors, with 3 algorithm errors, 2 miscompilations and 1 deadlock. One bug can sit in several categories. The strongest example caught a FlashAttention-4 data race that never appeared in 17,760 test runs, showing how testing alone can miss concurrency faults in widely used AI libraries.
TensorLean differs from tools such as Volta by using symbolic parameters instead of unrolling loops for one concrete setup at a time, according to the researchers. The results cover only the 149 checked instances across six projects, not all GPU software, and specifications must still be written by hand. The 38 bugs are the researchers' findings reported upstream, not independently confirmed fixes, and verification applies to the PTX and hardware generations tested.
// Read next
AI labs near cryptography breakthrough as expert panel prepares statement
A 21-expert cryptography panel lists a forthcoming statement as researchers point to an AI breakthrough in theoretical …
Musk: Google Wants to Rent More Computing Capacity From SpaceX
Elon Musk says Google is interested in renting additional computing power from SpaceX, a signal of how tight AI infrast…
RTX 5090 Cable Melt Triggers Air Quality Alarm in PC Owner Room
A Reddit user says a melting 12+4-pin cable on a Gigabyte RTX 5090 filled the room with particles and damaged the GPU p…
YouTuber builds working USB graphics card for 20 cents
Bitluni turned a 13-cent CH570 microcontroller into a monochrome USB graphics card using PWM video tricks and SRAM cach…