cs.LGNov 10, 2026

KernelMosaic: An Open Dataset and Agentic Framework for CUDA Kernel Generation

Authors: Ningyuan Xi, Yuhang Lai, Ning Miao

Organizations: Department of Data Science, City University of Hong Kong · Hong Kong Institute of AI for Science, City University of Hong Kong

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.

Figures & tables

Appendix figures & tables22 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. CUDA Agent: Large-Scale Agentic RL for High-Performance CUDA Kernel Generation

    Feb 27, 2026Weinan Dai, Hanlin Wu, Qiying Yu +13GPU Kernel GenerationGPU Kernel Optimization

  2. From Tokens to Regions: CUDA-Sensitive Instruction Tuning for GPU Kernel Generation

    Jun 15, 2026Wentao Chen, Jiace Zhu, Xing Zhe Chai +4GPU Kernel OptimizationLLM Fine-Tuning