Get the daily emailDaily email
  1. Home
  2. Research
  3. This story

TensorLean formally verifies production GPU kernels and finds 66 unknown bugs in FlashAttention and DeepGEMM

TensorLean verifies a GPU kernel's compiled PTX against tensor-level specifications across all inputs, launch configurations and concurrent schedules, using SMT solvers with semantics and soundness proofs mechanized in Lean 4. On 2,078 instances of all 143…

Published Read the original

Ranked #5 of 30 on Friday, December 4

TensorLean formally verifies production GPU kernels and finds 66 unknown bugs in FlashAttention and DeepGEMM

Why it matters

Kernels that much of today's training and inference runs on carried silent correctness bugs, so teams depending on these libraries should watch for the fixes.

What happened

1 min read

TensorLean verifies a GPU kernel's compiled PTX against tensor-level specifications across all inputs, launch configurations and concurrent schedules, using SMT solvers with semantics and soundness proofs mechanized in Lean 4. On 2,078 instances of all 143 kernels in FlashAttention-2, -3 and -4, DeepSeek's DeepGEMM and LinkedIn's Liger Kernel, it proved 1,180 correct and uncovered 66 previously unknown correctness bugs, all reported to the developers.

inscraper analysis

Our analysis

Getting formal verification onto real, widely used kernels rather than toy examples is a genuine step, and working on compiled PTX means compiler-introduced errors are covered too. The abstract doesn't say how much these 66 bugs affect model outputs in practice or whether they only appear in rare configurations, which is what determines their real-world weight. Some proofs rely on user-provided assertion hints, so this isn't yet push-button for every team. Worth reading for kernel authors and training-infrastructure teams; everyone else should simply watch for patched releases of these libraries.

More in Research