在Lean中形式化PTX以证明GPU内核的正确性
Formalizing PTX in Lean to Prove GPU Kernel Correctness
AI总结:
研究人员在Lean中形式化PTX,建模推理深度学习GPU内核的多种常见模式,实现该方法后证明了WGMMA GEMM内核、FlashAttention及3内核MoE流水线的简单实现的正确性。
摘要:
我们提出一种对PTX进行数学形式化的方法,该方法可对深度学习GPU内核中常见的模式进行建模与推理,包括获取-释放语义、张量核心、代理、异步操作、多内核流水线及依赖数据的控制流。我们在Lean中实现该方法,并用以证明WGMMA GEMM内核、FlashAttention及3内核MoE流水线的简单实现的正确性。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。