Research#Model training#Model inference
CertiK and Columbia use Lean to verify DeepSeek and FlashAttention kernels
CertiK and Columbia verified DeepSeek DeepGEMM and FlashAttention kernels in Lean at PTX level: 83/149 compiled instances proved, 38 spec violations reported.

CertiK and Columbia University researchers published TensorLean on November 20, 2026, describing it as the first framework to formally verify production AI GPU kernels. Rather than trusting CUDA source, it works on the compiled PTX code: a developer writes a Lean specification, the tool proves the kernel against it, and a machine checks the proof. Of 149 open-source kernel instances, 83 were proved to meet their specs; the rest surfaced defects that the team consolidated into 38 correctness bugs.
Key points
- Verified at the PTX level: TensorLean proves properties of compiled GPU machine code across six libraries — DeepGEMM, FlashAttention-2/3/4, Triton, TileLang, Liger Kernel and TileOPs.
- 149 instances, 83 proved, 38 bugs: 66 instances failed (about 44.3%), but the bug count is distinct issues, and one bug can break several instances. Two are in DeepGEMM, 23 in FlashAttention, and 13 are not attributed to a named library.
- Fixes are uneven: the team says every bug was reported to developers. As of November 23, some PRs are merged (FlashAttention #3208 and #3152, plus TileLang and TileOPs fixes) while #3196, #3015, DeepGEMM #477 and #515 remain open.
Background
GPU kernels set the real speed of training and inference. To squeeze the hardware, engineers hand-write kernels that change memory layout, partition work across threads, overlap data movement with computation, and drop to lower floating-point precision. The closer an optimization sits to the hardware, the more easily it breaks on extreme inputs, and routine tests rarely reach those cases. DeepGEMM is DeepSeek’s FP8 matrix-multiply library; FlashAttention is the widely used attention implementation. Both are foundational pieces where one bug can affect a large family of models.
The field has had several recent warnings. According to the CertiK blog and the Chinese outlet Synced, in late August 2025 Claude users saw Thai characters and syntax errors after a TPU runtime optimization disrupted next-token computation. In October 2026, DeepMind reported two numerical bugs where rounding error could erase or invent training signal. Anthropic and Theorem also published formal-verification research that month. Synced ties the work to a training bug found on a 1,000-GPU cluster at Michigan and to seL4’s verification cost, and traces CertiK back to the CertiKOS verified-kernel project at Columbia and Yale.
DeepSeek is no stranger to kernels: it has already open-sourced Ascend operator components that gave the V4 series NVIDIA operators an Ascend implementation. DeepGEMM, one of the libraries verified here, is a piece of that operator stack.
The facts
Per the CertiK blog and tensorlean.ai, TensorLean targets compiled PTX, so errors introduced by the compiler are in scope. The four properties it proves are data-race freedom, termination, functional correctness within floating-point tolerance, and that these hold for every input satisfying the specification’s preconditions and every execution. Beyond those, its defect classes cover uninitialized memory, memory-access errors, deadlocks, undefined behavior and miscompilation — eight categories in total.
| Library | Compiled instances | Reported bugs | Fix status (as of 2026-11-23) |
|---|---|---|---|
| FlashAttention-2/3/4 | 102 (37 source kernels) | 23 | #3208, #3152 merged; #3196, #3015 open |
| DeepGEMM | 47 combined with Liger Kernel | 2 | #477, #515 open |
| Triton / TileLang / Liger / TileOPs | not broken out | 13 (not split by library) | TileLang #2700, TileOPs #1728 merged |
The counting needs care. 149 is compiled instances: one source kernel compiles into several instances for different GPU architectures and shape configurations. 83 were proved on the first attempt; 66 failed, and 149 minus 83 is exactly 66, about 44.3% — an instance rate, not a bug rate. 38 is the deduplicated count of distinct correctness issues, and one defect can fail several instances. The team also published scale figures: FlashAttention’s 37 source kernels are about 55,910 source lines against 6,242 spec lines; the broader set is 72 kernels, 151,285 source lines versus 10,278 spec lines, roughly 15:1. Median proof time is about 10 minutes on a 16-core workstation; the largest case, FlashAttention-3 forward on Hopper, took 50 minutes and 31,402 proof goals.
The scope has hard edges. TensorLean cannot specify random kernels such as dropout or top-p sampling. It does not model acquire/release atomic synchronization, so multi-GPU communication libraries such as NCCL and DeepEP are out of scope. It is sound but incomplete, so missing constraints, conservative bounds or solver timeouts can leave a correct kernel unproven. Its trusted base includes NVIDIA’s PTX ISA and ptxas, TensorLean’s own PTX semantics and tensor-core rounding model, the specifications, a roughly 1.8K-line PTX parser, Lean’s kernel, and Z3/cvc5.
What others say
Synced frames 66/149 as “44.3% of GPU kernels are wrong”, highlights one data race that escaped 17,760 H100 test runs, and says all defects were fixed. Tencent News reports the same 38 issues across six libraries, 2 in DeepGEMM and 23 in FlashAttention, but does not disclose fix status. Both Chinese outlets add context the CertiK blog leaves out, including the TPU and DeepMind numerical-bug episodes above.
The GitHub README differs slightly: its bug table lists 40 bugs against the blog’s and site’s 38, and the two extra may have been added or reclassified after publication. The README says all were reported to developers and links the issues and PRs. A Hacker News submission (id 50582141) drew 2 points and no comments — a muted community reaction.
As of publication, neither DeepSeek nor the FlashAttention maintainers has publicly responded or endorsed the work; the only evidence is GitHub issues, PRs and merge records. Calling this a vendor endorsement or a joint release would be wrong.
Our take
For teams running inference or training infrastructure, TensorLean offers a new angle: checking concurrency, integer overflow, uninitialized memory and deadlocks at the PTX level, especially at extreme sizes that routine tests miss. The README examples are mostly of that kind — a paged KV cache with zero columns, a page-table size times page size above 2^31, int overflow at batch × heads × 512K tokens, NaN when a row’s logits are all -inf. These may not fire at normal scale, but when they do the result is a silent wrong answer or an illegal memory access.
The honest catch: 38 is a count of specification violations, not production incidents. Most appear only at extreme inputs, so it would be wrong to infer that released models computed incorrectly or that DeepSeek or FlashAttention suffered an outage. Reproducibility is another gap: the paper and open-source code are only “coming soon”, so outsiders cannot rerun the 149 instances. The README’s 40 against the blog’s 38 also shows the numbers are still moving, and several fix PRs remain open.
In the lineage of formal verification, seL4 proved a microkernel, CompCert a compiler, CertiKOS an OS kernel; GPU kernels are hard because of concurrency, asynchronous copies, floating-point error and the compiler itself. TensorLean puts ptxas and PTX semantics in its trusted base, so it proves correctness “under the given semantics and spec”, not the whole stack end to end. That is a more useful takeaway than the “world’s first” headline.
What to watch
Two things: when the paper and open-source code actually ship, and whether DeepSeek and FlashAttention merge the remaining fix PRs. The first decides whether outsiders can reproduce the results; the second decides whether these bugs stay in issues or reach release builds.