cs.AINov 3, 2026

Formalizing PTX in Lean to Prove GPU Kernel Correctness

Authors: Luk Koska, Tom Koska, Ben Koska

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.

Figures & tables

Explore similar work

CardsList
  1. LARK: Lean-Assisted Reasoning for LLM-Generated GPU Kernels

    Nov 1, 2026Zixi Zhang, Jiayi Nie, Haoran Wu +7GPU Kernel Correctness VerificationGPU Kernel Generation

  2. PTXBench: Benchmarking and Adapting LLMs for GPU Kernel Optimization with Architecture-specific PTX

    Aug 18, 2026Genghan Zhang, Yixin Dong, Chengze Fan +4LLM EvaluationGPU Kernel Optimization