arXivPreprintOpen accesscs.AI
Formalizing PTX in Lean to Prove GPU Kernel Correctness
Luk Koska, Tom Koska, Ben Koska
Computational
Key points
From the paper's conclusion- We implement it in Lean and use it to prove the correctness of simple implementations of a WGMMA GEMM kernel, FlashAttention, and a 3-kernel MoE pipeline.
Abstract
We present an approach to mathematically formalizing PTX, an approach that allows modeling and reasoning about patterns common in GPU kernels for Deep Learning, including acquire-release, tensor cores, proxies, async operations, multi-kernel pipelines and data-dependent control flow. We implement it in Lean and use it to prove the correctness of simple implementations of a WGMMA GEMM kernel, FlashAttention, and a 3-kernel MoE pipeline.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- LARK: Lean-Assisted Reasoning for LLM-Generated GPU KernelsarXiv · 2026
- Proving LLM-Generated GPU Kernels Correct and Safe: Floating-Point Verification in Lean and VerCorsarXiv · 2026
- Taming Bitwise Behavior in GPU Kernels with Tensor Core: Black-Box Reconstruction, Compiler Enforcement, and Static VerificationarXiv · 2026
- Racer: Hunting GPU Kernel Bugs with Symbolic Equivalence CheckingarXiv · 2026
- Kuiper: Correct and Efficient GPU Programming with Dependent Types and Separation LogicProceedings of the ACM on Programming Languages · 2026
- Equivalence Checking of ML GPU KernelsProceedings of the ACM on Programming Languages · 2026