CUDA-L1: Improving CUDA Optimization via Contrastive Reinforcement Learning
Xiaoya Li, Xiaofei Sun, Albert Wang, Jiwei Li, Chris Shum
Abstract
The exponential growth in demand for GPU computing resources has created an urgent need for automated CUDA optimization strategies. While recent advances in LLMs show promise for code generation, current state-of-the-art models achieve low success rates in improving CUDA speed. In this paper, we introduce CUDA-L1, an automated reinforcement learning (RL) framework for CUDA optimization that employs a novel contrastive RL algorithm.
CUDA-L1 achieves significant performance improvements on the CUDA optimization task: trained on NVIDIA A100, it delivers an average speedup of ×3.12 with a median speedup of ×1.42 against default baselines over across all 250 CUDA kernels of KernelBench, with peak speedups reaching ×120. In addition to the default baseline provided by KernelBench, CUDA-L1 demonstrates ×2.77 over Torch Compile, ×2.88 over Torch Compile with reduce overhead, and ×2.81 over CUDA Graph implementations. Furthermore, the model also demonstrates portability across GPU architectures, achieving average speedups of ×3.85 (median ×1.32) on H100, ×3.13 (median ×1.31) on L40, ×2.51 (median ×1.18) on RTX 3090, and ×2.38 (median ×1.34) on H20 despite being optimized specifically for A100.
Beyond these benchmark results, CUDA-L1 demonstrates several properties: CUDA-L1 1) discovers a variety of CUDA optimization techniques and learns to combine them strategically to achieve optimal performance; 2) uncovers fundamental principles of CUDA optimization, such as the multiplicative nature of optimizations; 3) identifies non-obvious performance bottlenecks and rejects seemingly beneficial optimizations that actually harm performance. The capabilities demonstrate that, RL can transform an initially poor-performing LLM into an effective CUDA optimizer through speedup-based reward signals alone, without human expertise or domain knowledge. In this process, it identifies CUDA optimization patterns, discovers new techniques, synthesizes them to achieve speedups, and more importantly, extends the acquired reasoning abilities to new kernels. This paradigm opens possibilities for automated optimization of CUDA operations, and holds promise to substantially promote GPU efficiency and alleviate the rising pressure on GPU computing resources.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 29c8c1bb-4cd8-414e-b0ba-3da15732fb38Cited by top-tier papers8
- Mastering Sparse CUDA Generation through Pretrained Models and Deep Reinforcement LearningYaoyu Wang, Hankun Dai, Zhidong Yang, Junmin Xiao et al.ICLR 2026 · 476 citations
- KernelFoundry: Hardware-Aware Evolutionary GPU Kernel OptimizationNina Wiedemann, Quentin Leboutet, Michael Paulitsch, Diana Wofk et al.ICML 2026 · 11 citations
- StitchCUDA: An Automated Multi-Agents End-to-End GPU Programing Framework with Rubric-based Agentic Reinforcement LearningShiyang Li, Zijian Zhang, Winson Chen, Yuebo Luo et al.ICML 2026 · 9 citations
- CuBridge: An LLM-Based Framework for Understanding and Reconstructing High-Performance Attention KernelsXing Ma, Yangjie Zhou, Wu Sun, Zihan Liu et al.ACL 2026 · 2 citations
- DistRS: Disaggregated Reward Service for RLVR with Batch-Level ConstraintRuidong Zhu, Mingcong Han, Yinmin Zhong, Wencong Xiao et al.NSDI 2026 · 1 citation
Builds on3
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software EvolutionYuxiang Wei, Olivier Duchenne, Jade Copet, Quentin Carbonneaux et al.NeurIPS 2025 · 291 citations
- Evolution of Heuristics: Towards Efficient Automatic Algorithm Design Using Large Language ModelFei Liu, Xialiang Tong, Mingxuan Yuan, Xi Lin et al.ICML 2024 · 238 citations
Related papers
- QiMeng-Kernel: Macro-Thinking Micro-Coding Paradigm for LLM-Based High-Performance GPU Kernel GenerationXinguo Zhu, Shaohui Peng, Jiaming Guo, Yunji Chen et al.AAAI 2026 · 9 citations
- STARK: Strategic Team of Agents for Refining KernelsJuncheng Dong, Yang Yang, Tao Liu, Yang Wang et al.ICLR 2026 · 26 citations
- Kevin: Multi-Turn RL for Generating CUDA KernelsCarlo Baronio, Pietro Marsella, Ben Pan, Simon Guo et al.ICLR 2026 · 81 citations
- PerfDojo: Automated ML Library Generation for Heterogeneous ArchitecturesAndrei Ivanov, Siyuan Shen, Gioele Gottardo, Marcin Chrapek et al.SC 2025 · 2 citations
- EGG: An Expert-Guided Agent Framework for Kernel GenerationYaochen Han, Ke Fan, Hongxu Jiang, Wanqi Xu et al.ICML 2026
