Skip to content

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

Mar 2026 · 0 citations · 75 references
Computer Science

TL;DR

M2K is presented, 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, and discovers 181 previously unknown bugs in real LLM inference systems.

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.

View source

Similar papers

#artificial intelligence Preprint Sep 2026

KernelOPT: Dispatch-Aware Agentic Search for GPU Kernel Optimization

KernelOPT is a multi-agent system that treats compiled models as structured artifacts and exclusively targets generated Triton sub-kernels using five profiling-guided LLM agents and achieves geometric mean speedups over PyTorch.

Aheli Poddar, Sanskar Prasad, Arindam Samanta et al. · 0 citations
#artificial intelligence Preprint Aug 2026

CUDA-Harness: Harnessing Agentic CUDA Kernel Generation and Optimization from Natural Language

This paper proposes CUDA-Harness, a framework for harnessing agentic CUDA kernel generation and optimization from natural language, and introduces Intermediate-Structured Generation to connect high-level semantic understanding with low-level kernel generation.

Qi Fan, An Zou, Yehan Ma · 0 citations
#machine learning Preprint Sep 2026

KernelZero: Co-Evolving Proposer and Coder for Continuously Improved GPU Kernel Generation

High-performance GPU kernels are essential to modern machine learning systems, yet automatically generating kernels that are both correct and efficient remains challenging. Existing LLM-based approaches face two major limitations: the scarcity of high-quality training data aligned with the model's current capabilities,...

Changxin Ke, Rui Zhang, Zi-Xiang Fang et al. · 0 citations
#machine learning Preprint Sep 2026

Accelerating the Mitigation of LLM Inference Nondeterminism Across GPU Architectures

This work presents a solution employing a set of fixed-configuration fused-upcast GEMM kernels that load 16-bit weights from memory, upcast them to FP32 in registers, and accumulate with IEEE-754 arithmetic in a reduction order that is a pure function of the problem shape and is therefore independent of the device, its...

L. Cooper, Shinnung Jeong, Hyeran Jeon et al. · 1 citation
Book Open access Aug 2026

Weaver: Diagnosing Extra Kernel and Synchronization Interference in GPU Workloads

Weaver is a low-overhead cross-layer diagnosis framework for GPU kernels that builds a semantic execution graph from operator, kernel timeline, and warp/block evidence, distinguishes blocked and slowed kernels, and reports an interpretable root-cause chain.

Jingyuan Zhu, Meng-Hao Zhang, Yuxuan Chen · 0 citations
#machine learning Preprint Aug 2026

DataKernelBench: Can LLMs Optimize Database Queries on GPUs?

DataKernelBench is introduced, which translates SQL into validated PyTorch TorchPlan programs and evaluates LLMs that optimize either the core tensor-bounded snippet or the full query in CUDA or Triton through execution-guided repair and finds that higher-performing implementations commonly use kernel fusion and execut...

Gokul Karthik Kumar, Yotam Perlitz, Corey Lammie et al. · 1 citation

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.