TensorLean verifies production GPU kernels and reports 66 bugs
Original title: TensorLean: Formal Verification of Production GPU Kernels
Of 2,078 instances across FlashAttention, DeepGEMM, and Liger Kernel, 1,180 were proved correct.
TensorLean checks a kernel's compiled PTX against shared tensor-level specifications using a symbolic happens-before graph, SMT solvers, and Lean 4. It covers all 143 kernels in FlashAttention-2, -3, and -4, DeepSeek DeepGEMM, and LinkedIn Liger Kernel. The authors say it proves 1,180 of 2,078 instances and finds 66 previously unknown correctness bugs in 888 others, all reported to developers.
Unconfirmed: Bug counts and proof results are the authors' reported evaluation, not an independent audit.
- Proofs first establish data-race freedom and termination, then functional correctness.
- Inductive round-off bounds extend guarantees to floating-point PTX.
- Tile-loop invariants and user assertion hints are used to scale proofs.
- The paper does not say whether developers have fixed the bugs.
From the original article
1 min read at huggingface.coGPU kernels are the computational core of modern AI, yet a single correctness bug can silently corrupt frontier models and ML frameworks, putting training and inference at risk. Formal verification promises correctness across all inputs, launch configurations, and schedules, but it has never reached production GPU kernels. We present TensorLean, the first framework to formally verify production GPU kernels.
By Wei Qiang, Ganxiang Yang, Yi Rong · huggingface.co
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.