M2K: Making the Model-Kernel Interface Explicit for Reliable CUDA Kernel Verification
cs.PL, cs.AI
Submitted: 2026-03-06
Updated: 2026-08-29
Code: https://github.com/vllm-project/vllm
License: http://creativecommons.org/licenses/by-nc-sa/4.0/
The gist: 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.
Terminology
Abstract
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.
Sources
- ProofWright: Towards Agentic Formal Verification of CUDA
- Evaluating Large Language Models Trained on Code
- Emergent autonomous scientific research capabilities of large language models
- On the Opportunities and Risks of Foundation Models
- Sparks of Artificial General Intelligence: Early experiments with GPT-4
- A Complete Survey on LLM-based AI Chatbots
- A Survey on Large Language Models for Code Generation
- Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context
- A Survey of Large Language Models
- A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trends
- GPUArmor: A Hardware-Software Co-design for Efficient and Scalable Memory Safety on GPUs
Related papers
- Language-Based Agent Control
- ANEForge: Python for direct computation on the Apple Neural Engine
- CrossTL: Hub-Based Translation of GPU Programs and the Preservation of Source Rules
- Volition Elicitation: Operational Semantics for People and Their Machines
- Griotte: Verified Compartmentalisation via Capabilities
- GraphMend: Code Transformations for Fixing Graph Breaks in PyTorch 2