explainx.ai350K+ learn from us
TrendingAI News TodayExplainx for Business
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcpestacktoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • Answer first: what broke and where
  • How TensorLean verifies kernels
  • Why FlashAttention and DeepGEMM matter
  • What developers should do this week
  • Formal methods meeting AI infra
  • Bug classes the authors name explicitly
  • Who should read the primary sources
  • Limits the paper acknowledges
  • Comparison to testing stacks you already run
  • What this is not
  • Research context and open weights
  • How to protect training and inference pipelines
  • FAQ-sized detail: FlashAttention version matrix
  • Related reading
← Back to blog

explainx / blog

TensorLean: 66 Hidden GPU Kernel Bugs in FlashAttention, DeepGEMM, and Liger

GPU Kernels, Security, FlashAttention, DeepSeek, Research

Part of AI Security

Columbia and CertiK TensorLean formally verified 2,078 production GPU kernel instances across FlashAttention 2–4, DeepSeek DeepGEMM, and LinkedIn Liger Kernel, finding 66 unique correctness bugs standard tests missed.

Dec 4, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
TensorLean: 66 Hidden GPU Kernel Bugs in FlashAttention, DeepGEMM, and Liger

Columbia University and CertiK researchers reported 66 unique, previously unknown correctness bugs in widely used AI GPU kernels after formally verifying 2,078 production instances from FlashAttention, DeepSeek DeepGEMM, and LinkedIn Liger Kernel. CertiK's announcement calls the work the first formal verification of production AI kernels at scale, and the TensorLean project site publishes supplementary material. Standard unit tests and benchmarks did not catch the defects; 57 of the bugs can corrupt outputs or crash real runs, per CertiK.

If you train or serve with fused attention or DeepGEMM paths, this is not a headline about hacking prompts. It is about silent wrong math in the layer every frontier stack trusts.

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

350K+ Students Already Joined

Answer first: what broke and where

table · 4 cols
LibraryKernel instances in studyUnique bugs reported (paper)CertiK crash or corrupt class
FlashAttention 2–4246 instances across 35 kernel types43 bugs spread across FA2, FA3, FA4 familiesMajority of attention-path defects
DeepSeek DeepGEMM70 instances across 20 kernels8 bugsIncludes GEMM and attention fusion paths
LinkedIn Liger Kernel1,762 instances across 88 kernels15 bugsMostly loss and normalization stacks

The authors proved 1,180 instances correct and flagged 888 supported instances that violated at least one property. Bugs span incorrect algorithms, numerical errors, uninitialized memory, out-of-bounds access, data races, non-termination, and PTX undefined behavior, per arXiv:2612.05654.

How TensorLean verifies kernels

TensorLean formal verification workflow for production GPU kernels in FlashAttention and DeepGEMMTensorLean formal verification workflow for production GPU kernels in FlashAttention and DeepGEMM Image: CertiK

TensorLean’s pipeline, summarized on tensorlean.ai and in the paper:

  1. Compile to PTX and build a symbolic happens-before graph over formalized PTX semantics.
  2. Prove data-race freedom and termination, shrinking concurrent schedules to finite sequential cases.
  3. Push or pull memory updates and prove functional correctness against tensor specs with SMT solvers over reals.
  4. Extend guarantees to floating-point PTX via inductive round-off bound inference.

Semantics and soundness proofs are mechanized in Lean 4, which matters for auditors already comfortable with proof-carrying crypto work.

Median proof time is 40 seconds per instance in the evaluation, with the hardest cases taking up to 78 minutes. Proof-to-code ratios land between 0.1:1 and 0.5:1, the authors report, meaning verification effort is no longer laughably larger than kernel size for many production tiles.

Why FlashAttention and DeepGEMM matter

FlashAttention-family kernels are the default way teams make long-context training affordable. NVIDIA’s own FastGen-PDD distillation work assumes stable attention backends when comparing AnyFlow and DMD2 baselines. A fused kernel that returns slightly wrong softmax blocks does not always trip loss NaNs; it can drift weights across thousands of steps.

DeepSeek DeepGEMM ships beside MIT-weight models as the performance core for matrix paths on Hopper-class hardware. LinkedIn’s Liger Kernel accelerates loss and normalization stacks in large fine-tuning jobs. These are not demo repos; they sit on the hot path for checkpoints you later expose through APIs and agents.

TensorLean study bug counts across FlashAttention DeepGEMM and Liger kernel librariesTensorLean study bug counts across FlashAttention DeepGEMM and Liger kernel libraries Image: CertiK

What developers should do this week

Pin versions and read changelogs. FlashAttention, DeepGEMM, and Liger maintainers received all 66 reports, per the paper. Before you bump a minor release for speed, scan release notes for TensorLean or correctness mentions.

Rerun golden tests on real shapes. Property-based tests in Python wrappers rarely explore the launch grid combinations TensorLean models. Re-log training loss, downstream eval, and checksums on a short run after any kernel upgrade.

Separate agent guardrails from kernel truth. Runtime monitors like those in PrismGuard research stop tool misuse. They cannot detect that your attention kernel returned a wrong tile on a rare sequence length. Stack both layers: policy guards for agents, version discipline for CUDA.

Watch supply-chain questionnaires. Enterprise buyers already ask about NY DFS-style agent authorization. Formal kernel audits are a credible follow-up question for training vendors and cloud GPU providers.

Formal methods meeting AI infra

CertiK built its brand on smart-contract auditing. TensorLean is the same instinct applied where billions of flops hide in hand-written CUDA. The paper’s headline number — 66 bugs — is smaller than daily CVE firehoses, but the blast radius is large because every customer shares the same fused kernels.

Compared with NVIDIA attribution work on failed distributed training, TensorLean catches local correctness before jobs scale out. NCCL and Slurm outages are loud; wrong attention outputs can be quiet until an eval regresses weeks later.

Bug classes the authors name explicitly

The arXiv paper groups failures into categories that matter differently for SREs versus ML researchers:

  • Algorithm implementation errors where tile math diverges from the tensor spec even when shapes look valid on common benchmarks.
  • Numerical bugs that violate real-number functional goals once floating-point PTX is considered.
  • Uninitialized memory reads that can leak stale values into attention outputs.
  • Out-of-bounds accesses triggered only on certain sequence lengths or head dimensions.
  • Data races between warps that unit tests on deterministic seeds never interleave.
  • Non-termination paths where kernel loops fail to meet proof obligations.
  • PTX undefined behavior that compilers or drivers may treat inconsistently.

CertiK’s public write-up emphasizes that 57 bugs sit in the corrupt or crash bucket, meaning they are not cosmetic lint findings. That distinction matters when auditors ask whether AI security work should focus only on prompt injection while numerics stay unreviewed.

Who should read the primary sources

ML platform engineers maintaining forked FlashAttention should diff upstream commits against TensorLean disclosures before merging into a long-running pretrain. Inference SREs serving long-context chat should treat kernel upgrades like database migrations: snapshot golden prompts, compare logits or hidden-state norms if you have hooks, and roll back fast.

Security teams already tracking fake quant models on Ollama should add supply-chain integrity for CUDA artifacts to the same runbooks. Malicious kernels are not what TensorLean found, but silent benign bugs teach the same lesson: trust but verify the hot path.

Researchers citing FlashAttention speedups in papers should footnote kernel versions the way they footnote dataset hashes. Reproducibility failures sometimes come from non-deterministic races, not from random seeds alone.

Limits the paper acknowledges

TensorLean does not yet verify every kernel instance in the repos — the evaluation table marks some instances outside verification scope. Proofs assume formalized PTX semantics; driver and hardware microarchitecture gaps remain. Verification is offline; it does not replace canary clusters or hardware ECC.

Teams on local FP8 tensor parallel stacks still need end-to-end tests because numerics stack across kernels, frameworks, and quant formats.

Comparison to testing stacks you already run

Most teams rely on pytest golden values, micro-benchmarks, and occasional cuda-memcheck sweeps. Those tools excel at smoke coverage but sample a thin slice of launch configurations. Property-based tests in Python rarely reach into PTX register layouts or warp scheduling.

TensorLean is closer to formal verification in cryptography: upfront cost, high assurance on modeled properties. It does not replace integration tests; it complements them where one wrong tile poisons a trillion-token training run.

If your organization already funds Datadog-style agent testing research, think of TensorLean as the hardware-adjacent cousin: properties are about memory and real arithmetic, not tool JSON schemas.

What this is not

This is not a claim that FlashAttention is permanently unsafe. It is evidence that heroic manual CUDA outran classical test coverage, and that formal tools can close part of the gap. It is also not an agent prompt injection story; do not conflate it with felony-bench agent incidents unless a future case ties a kernel bug to deliberate sabotage.

Research context and open weights

DeepSeek’s December systemic risk policy argues for tiered open releases partly because channel A weights run without API guardrails. TensorLean reinforces a narrower point: even widely trusted open code paths can harbor correctness debt invisible to downstream users until someone proves properties over PTX.

Chinese labs are not alone. US hyperscalers depend on the same open kernel ecosystems to ship features quickly. The responsible move is transparent fixes, not rumor-mill panic.

How to protect training and inference pipelines

  1. Subscribe to upstream security and release feeds for FlashAttention, DeepGEMM, and any fused loss library you vendor.
  2. Freeze kernel versions across a training campaign; upgrade only on a maintenance window with reruns.
  3. Log hardware and driver tuples beside checkpoints so you can bisect silent regressions.
  4. Ask GPU cloud providers which commit hashes they bake into images; pin to audited builds when available.
  5. Keep human review on numerics-sensitive changes even when AI coding agents ship more lines than features.

For teams building agent harnesses on top of models trained with these kernels, kernel hygiene is foundational. Misaligned logits from bad attention are indistinguishable from model misbehavior in logs.

FAQ-sized detail: FlashAttention version matrix

When you file internal tickets, reference library branches, not only pip version strings:

table · 3 cols
FlashAttention trancheApproximate LoC in paper tableInstances with bugs (paper)
FA2 (6 kernel types)3.7K LoC cited20 instances flagged
FA3 (6 kernel types)10.1K LoC cited36 instances flagged
FA4 (23 kernel types)43.8K LoC cited11 instances flagged

DeepGEMM’s attention and GEMM splits show smaller instance counts but higher severity density on some quantization kernels where three of three instances failed verification in the evaluation snippet. Liger’s loss kernels contribute the largest instance volume, which matches how often fine-tuning jobs spend cycles in cross-entropy fused paths.

If you want to use this at work, not just read about it, this is the fastest path.

Related reading

  • FastGen-PDD: NVIDIA video distillation and FlashAttention assumptions
  • DeepSeek DeepGEMM and Ascend inference context
  • DeepSeek frontier systemic risk policy
  • PrismGuard agent runtime signals
  • llama.cpp FP8 and multi-node tensor parallelism
  • NVIDIA distributed training failure attribution
  • AI agents output without shipped software
  • NY DFS agentic AI authorization RFI
Spotted something out of date? Let us know.
Daily briefFrom Yash · 350K+ students taught

Catch up on AI

One AI story explained in plain English, plus one thing to try. Every day, free. Unsubscribe anytime.

  • ✓ Free
  • ✓ One email a day, no spam
  • ✓ Unsubscribe anytime
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Share

GPU Kernels
Workshops

Learn by building

Live, hands-on workshops on Claude, agents, and AI tooling — taught by practitioners, not slides.

Explore workshops →

Related posts

Nov 24, 2026

Protocolis Solid-State Web Execution: Compiled Web Ops for AI Agents

Protocolis published Solid-State Web Execution on November 22, 2026, arguing a compiler can turn unfamiliar web pages into typed operations agents invoke with verified results—no model call on first contact. The author reports 76% completion on long tasks versus 46% for alternatives in 3,443 counted runs.

Nov 12, 2026

Alice Huang Firms and DeepSeek: What The Information Claims About Blackwell Chips

Techmeme and social feeds amplified a November 12 report that companies tied to Alice Huang invested in DeepSeek with promises of banned Nvidia Blackwell chips. We map the claim to primary export rules and earlier Megaspeed reporting without treating paywalled detail as fact.

Oct 19, 2026

DHS Orders DeepSeek Removed From Federal Civilian Systems: What the Ban Covers

On October 19, 2026 the Department of Homeland Security ordered federal civilian agencies to strip DeepSeek products from their IT systems and stop buying them, including third-party services built on DeepSeek models. Here is what the notice says, what it does not say, and what it means for vendors and developers.