HomeNews

TensorLean Verifies GPU Kernels, Finds 38 Bugs in Production

Divit Bhat
Divit Bhat
•
Nov 22, 2026 10:21 AM
•
0
 min read
Select Emergent as your Preferred news source
TensorLean Verifies GPU Kernels, Finds 38 Bugs in Production

💡 TL;DR

  • Columbia University and CertiK released TensorLean, a formal verification tool that checks GPU kernel correctness at the PTX instruction level using Lean.
  • The framework tested 149 production kernel instances, successfully proved 83 fully correct, and discovered 38 previously unknown bugs in widely-used implementations.
  • TensorLean addresses critical safety gaps in AI infrastructure by providing mathematical proofs that GPU kernels perform exactly as specified without memory errors.

Researchers from Columbia University and blockchain security firm CertiK have officially released TensorLean, a formal verification framework designed to mathematically prove the correctness of production GPU kernels. Officially launched on November 21, 2026, the tool operates at the PTX (Parallel Thread Execution) instruction level and uses the Lean theorem prover to check that GPU code performs exactly as specified. In initial testing across 149 kernel instances from widely-deployed AI libraries, TensorLean proved 83 kernels fully correct while uncovering 38 previously unknown bugs in implementations including FlashAttention and DeepGEMM.

Why GPU Kernel Verification Matters Now

As AI models scale to trillions of parameters and run on massive GPU clusters, even subtle errors in low-level kernel code can cascade into training failures, incorrect inference results, or security vulnerabilities. Traditional testing methods sample inputs and outputs, but cannot guarantee correctness across all possible execution paths. TensorLean fills this gap by providing formal mathematical proofs that a kernel behaves correctly under every possible input, thread scheduling order, and memory access pattern. This level of assurance is critical for safety-critical AI applications in healthcare, autonomous systems, and financial infrastructure.

The framework targets PTX, the low-level assembly-like intermediate representation that NVIDIA GPUs execute. By verifying at this level rather than higher-level CUDA code, TensorLean catches bugs introduced by compiler optimizations and ensures that the actual instructions running on silicon match the intended behavior. The researchers chose the Lean proof assistant because of its expressiveness for hardware semantics and its growing adoption in formal mathematics communities.

Bugs Found in Production Code

TensorLean's initial audit revealed significant issues in widely-used kernel implementations:

  • FlashAttention, the memory-efficient attention mechanism used in most modern transformers, contained race conditions and incorrect boundary checks that could cause silent data corruption under specific input shapes
  • DeepGEMM matrix multiplication kernels had memory access violations in edge cases involving non-standard tensor alignments
  • Several optimized reduction kernels exhibited non-deterministic behavior due to improper synchronization primitives

The 38 bugs discovered represent cases where existing test suites passed but formal verification exposed hidden correctness violations. According to the research team, 12 of these bugs have already been confirmed and patched by the respective library maintainers. The remaining issues are under review, with some requiring architectural changes to the kernel implementations.

Technical Architecture and Proof Strategy

TensorLean models GPU execution semantics as a state machine operating over thread blocks, shared memory, and global memory spaces. The framework encodes PTX instruction semantics, memory consistency models, and synchronization primitives as Lean definitions. Developers specify kernel correctness properties as pre- and post-conditions, then TensorLean generates proof obligations that must be satisfied for the kernel to meet its specification.

The verification process is semi-automated. TensorLean's symbolic execution engine explores execution paths and attempts to discharge proof obligations using built-in tactics. When automatic proof search fails, human experts can provide lemmas and proof hints. For the 83 kernels proven correct, the median proof development time was 4.2 hours per kernel, with complex attention kernels requiring up to 18 hours of expert effort. The 28 kernels that remain unverified (neither proven correct nor shown buggy) hit resource limits in the proof search or required specification refinements.

Release Date and Availability

TensorLean was officially released on November 21, 2026, as an open-source project. The research team has published the framework's codebase, proof libraries, and verification results for the 149 tested kernels on GitHub. Early access partners include major cloud GPU providers and AI labs seeking to integrate formal verification into their kernel development pipelines. The researchers plan quarterly releases with expanded PTX coverage, improved automation, and support for newer GPU architectures including NVIDIA's Blackwell series.

What This Means

TensorLean represents a significant step toward provably correct AI infrastructure. As the AI industry moves from prototype research to production deployment at scale, the ability to formally verify critical GPU code will become essential for safety certification and regulatory compliance. The discovery of 38 bugs in battle-tested production kernels demonstrates that conventional testing alone is insufficient. While the current semi-automated approach requires expert involvement, ongoing improvements in proof automation may eventually enable continuous verification as part of standard kernel development workflows. Organizations building safety-critical AI systems now have a practical tool to mathematically guarantee that their GPU kernels execute correctly, reducing the risk of silent data corruption and catastrophic failures in deployed models.

About the writer

Divit Bhat is a product and growth writer at Emergent, specializing in AI-powered app building, no code platforms, and modern software workflows. He creates practical guides and tutorials to help founders, enterprises and teams build, automate, and scale products with AI.

Start Building
on Emergent today
Try Emergent