arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.24595cs.PLcs.AI
收藏

Model2Kernel: 用于安全CUDA内核的模型感知符号执行

M2K: Making the Model-Kernel Interface Explicit for Reliable CUDA Kernel Verification

The Pennsylvania State University(宾夕法尼亚州立大学);State Key Lab of Processors, Institute of Computing Technology, CAS(中国科学院计算技术研究所处理器实验室);Peking University(北京大学)

Mengting He, Shihao Xia, Haomin Jia, Wenfei Wu, Linhai Song

AI总结:

本文提出Model2Kernel,通过模型感知动态分析验证LLM推理中CUDA内核的内存安全,利用专门的符号执行技术发现353个未知bug,仅产生9个误报。

摘要:

大规模语言模型的广泛应用使得GPU加速推理成为现代计算基础设施的关键部分。生产推理系统依赖CUDA内核实现核心Transformer操作,但这些内核因模型依赖的张量布局、复杂的内存索引和大规模线程级并行而极易出现内存安全漏洞。现有技术无法有效检测LLM推理系统的CUDA内存漏洞。本文提出Model2Kernel,通过模型感知动态分析确定模型如何调用内核,并将内核参数分类为固定或由用户控制。利用这些信息,Model2Kernel应用CUDA专用的符号执行技术,结合动态张量内存和线程标识符的新抽象,准确定位内核中的内存漏洞。在vLLM、Hugging Face和近期LLM研究论文的CUDA内核和模型评估中,Model2Kernel发现353个此前未知的bug,仅产生9个误报,证明其有效性。

英文摘要:

Large language model (LLM) inference systems rely on CUDA kernels for core GPU computations, yet the interface between models and kernels is implicit and poorly specified. Models and kernels evolve independently and often make incompatible assumptions about tensor shapes and input sizes, leading to subtle memory bugs in CUDA kernels. These bugs can crash inference services, corrupt model weights, or be exploited by remote adversaries. Existing techniques either incur prohibitive runtime overhead, require specialized hardware, or fail to handle dynamic tensor shapes and variable kernel launch configurations, leaving the CUDA memory bugs largely unaddressed. This paper presents M2K, a fully automated framework that makes the model-kernel interface explicit and leverages it to detect memory bugs in CUDA kernels used in LLM inference systems. M2K consists of two components. HFProbe traces model execution without GPU hardware, classifies kernel arguments into model-fixed and user-variable, and emits symbolic constraints that capture the interface. cuKLEE then performs symbolic execution on CUDA kernels to pinpoint memory bugs under the interface constraints, modeling tensors as disjoint memory regions and treating thread identifiers symbolically to scale to thousands of threads. In the evaluation, M2K discovers 181 previously unknown bugs in real LLM inference systems, while producing only nine false positives, demonstrating its effectiveness.

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

↑