Model2Kernel: Model-Aware Symbolic Execution For Safe CUDA Kernels

📅 2026-03-06
🏛️ arXiv.org
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
为解决LLM推理系统中CUDA内核的内存错误问题,提出M2K框架明确模型-内核接口,并通过符号执行检测内存错误。
📝 Abstract
The widespread adoption of large language models (LLMs) has made GPU-accelerated inference a critical part of modern computing infrastructure. Production inference systems rely on CUDA kernels to implement core transformer operations, yet these kernels are highly susceptible to memory-safety bugs due to model-dependent tensor layouts, intricate memory indexing, and massive thread-level parallelism. Such bugs can corrupt model weights, crash inference services, or even enable adversarial attacks. Existing techniques either depend on unavailable hardware, incur high overhead, or fail to handle kernel inputs with variable lengths, and none can effectively detect CUDA memory bugs in LLM inference systems. This paper presents Model2Kernel, the first practical system for automatically verifying the memory safety of CUDA kernels used in LLM inference. Model2Kernel performs model-aware dynamic analysis to determine how each model invokes kernels and to classify kernel arguments as either fixed by the model architecture or controlled by model users. Using this information, Model2Kernel then applies CUDA-specialized symbolic execution, supported by new abstractions for dynamic tensor memory and thread identifiers, to accurately pinpoint memory bugs in kernels. In the evaluation on CUDA kernels and models from vLLM, Hugging Face, and recent LLM research papers, Model2Kernel discovers 353 previously unknown bugs while producing only nine false positives, demonstrating its effectiveness.
Problem

Research questions and friction points this paper is trying to address.

CUDA kernels
memory bugs
LLM inference systems
model-kernel interface
Innovation

Methods, ideas, or system contributions that make the work stand out.

M2K
CUDA kernel verification
symbolic execution
model-kernel interface
large language model inference
🔎 Similar Papers
No similar papers found.