# Formalizing PTX in Lean to Prove GPU Kernel Correctness

arXiv: https://arxiv.org/abs/2611.04447 · HTML: https://mlsanity.com/paper/2611.04447/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Builds on 5 of its 25 references that are in the map.
- Submitted 3 Nov 2026.

## Builds on (most cited first, 5 of 5)

- [FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness](https://mlsanity.com/paper/2205.14135/) (2022)
- [ProofWright: Towards Agentic Formal Verification of CUDA](https://mlsanity.com/paper/2511.12294/) (2025)
- [Equivalence Checking of ML GPU Kernels](https://mlsanity.com/paper/2511.12638/) (2025)
- [TorchLean: Formalizing Neural Networks in Lean](https://mlsanity.com/paper/2602.22631/) (2026)
- [GPUMC: A Stateless Model Checker for GPU Weak Memory Concurrency](https://mlsanity.com/paper/2505.20207/) (2025)

## Abstract (arXiv)

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.
