KernelMosaic: An Open Dataset and Agentic Framework for CUDA Kernel Generation
Ningyuan Xi, Yuhang Lai, Ning Miao
Key points
From the paper's conclusion- These results demonstrate that KernelMosaic enables a general-purpose model to achieve substantial gains in CUDA kernel generation.
Abstract
Training large language models to generate efficient CUDA kernels requires supervision spanning diverse computational requirements and iterative code optimization. Constructing this supervision is challenging because of heterogeneous specifications, and useful implementations emerge through iterative complicated testing and refinement. We introduce KernelMosaic, an open dataset pairing diverse CUDA tasks with verified solutions and trajectories. Human-guided review and diversity-aware selection curate tasks expressed as natural-language descriptions, reference programs, mathematical specifications, and their intersections. To build the solutions and trajectories, our agentic framework guides a strong LLM through implementation, correctness repair, and performance optimization with reusable CUDA guidance and execution feedback. Supervised fine-tuning of a small open-source model on KernelMosaic raises correctness from 4%, 0%, and 0% to 88%, 82%, and 16% on KernelBench L1, L2, and L3, respectively, while increasing the fraction of tasks with kernels faster than PyTorch eager at every level. Further training experiments show that supervision from the curated trajectories substantially outperforms direct responses and promotes sustained testing and revision. These results demonstrate that KernelMosaic enables a general-purpose model to achieve substantial gains in CUDA kernel generation.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Correct First, Fast Second: What a Local 7B Code Model Can and Cannot Do for GPU Kernel OptimizationarXiv · 2026
- ForgeKernel: Self-Evolving Kernels Catching and Surpassing Experts and AgentsarXiv · 2026
- Ask, Don't Equip: Question-Driven Coding Agents for Deep Kernel OptimizationarXiv · 2026
- D2K-Bench: Can LLM Agents Turn Expert Designs into Efficient GPU Kernels?arXiv · 2026
- KernelArmor: End-to-End Agentic System for Establishing Memory and Thread Safety for CUDAarXiv · 2026
- KernelOPT: Dispatch-Aware Agentic Search for GPU Kernel OptimizationarXiv · 2026