arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.24548cs.PL
收藏

证明大语言模型生成的GPU内核的正确性与安全性:Lean和VerCors中的浮点验证

Proving LLM-Generated GPU Kernels Correct and Safe: Floating-Point Verification in Lean and VerCors

Imperial College London(帝国理工学院);Logos Research(Logos 研究)

Archibald Browne, Eugene Lee, Cristopher Salvi

AI总结:

本文提出结合Lean自动化与语言模型引导的证明构造的框架,通过Velvet和VerCors验证大语言模型生成的GPU内核的语义等价性、线程安全性及数据竞争自由性,实现浮点值神经网络构建块内核的正确性与安全验证。

摘要:

现代统计模型开发始于PyTorch、JAX或TensorFlow等自动微分框架中的高级规范,随后该规范会被编译器下放到目标后端,或由研究工程师手动实现。本文研究前沿语言模型是否能通过从高级基准规范生成GPU内核来正确完成后一任务。我们提出一个框架,其中语言模型智能体使用嵌入在Lean中的命令式程序验证器Velvet,在一组显式假设下证明高级规范与生成的CUDA内核之间的语义等价性;同时要求该大语言模型在并行代码演绎验证器VerCors中证明生成内核的线程安全性和数据竞争自由性。我们在大语言模型生成的GPU内核形式验证方面的主要贡献是,证明Lean自动化与语言模型引导的证明构造相结合,可验证大量基于浮点值的基础神经网络构建块,使大语言模型能实现语义正确且安全的内核。在我们的框架中,浮点验证从不依赖编译代码,始终通过Lean内核进行检查。

英文摘要:

Modern statistical model development begins with a high-level specification in an automatic differentiation framework such as PyTorch, JAX, or TensorFlow, which is then lowered to a target backend by a compiler or implemented manually by a research engineer. In this paper, we study whether frontier language models can correctly perform the latter task by generating GPU kernels from high-level benchmark specifications. We introduce a framework in which a language-model agent uses Velvet, a program verifier for imperative programs embedded in Lean, to prove semantic equivalence between a high-level specification and a generated CUDA kernel under an explicit set of assumptions. It also asks the LLM to prove thread safety and data race freedom of the generated kernel in VerCors, a deductive verifier for parallel code. Our main contribution to the formal verification of LLM- generated GPU kernels is showing that a combination of Lean automation and language-model-guided proof construction can verify a broad set of basic neural- network building blocks over floating-point values, allowing LLMs to implement semantically correct and safe kernels. In our framework, floating-point verifications never rely on compiled code and are always checked via the Lean kernel.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑