CUDA-L2: Surpassing cuBLAS Performance for Matrix Multiplication through Reinforcement Learning
Not on the map. Why?
Abstract (arXiv)
In this paper, we propose CUDA-L2, a system that combines large language models (LLMs) and reinforcement learning (RL) to automatically optimize Half-precision General Matrix Multiply (HGEMM) CUDA kernels. Using CUDA execution speed as the RL reward, CUDA-L2 automatically optimizes HGEMM kernels across 1,000 configurations. CUDA-L2 systematically outperforms major matmul baselines to date, from the widely-used torch.matmul to state-of-the-art Nvidia's closed-source libraries, i.e., cuBLAS, cuBLASLt. In offline mode, where kernels are executed consecutively without time intervals, CUDA-L2 yields +22.0% over torch.matmul on average; +19.2% over cuBLAS using the optimal layout configuration (normal-normal NN and transposed-normal TN); +16.8% over cuBLASLt-heuristic, which queries cuBLASLt library and selects the algorithm based on the heuristic's suggestion; and +11.4% over the most competitive cuBLASLt-AutoTuning model, which selects the fastest algorithm from up to 100 candidates from cuBLASLt's suggestions. In server mode, where kernels are executed at random intervals simulating real-time inference, the speedups further increase to +28.7%, +26.0%, +22.4%, and +15.9% for torch.matmul, cuBLAS, cuBLASLt-heuristic, and cuBLASLt-AutoTuning respectively. CUDA-L2 shows that even the most performance-critical, heavily-optimized kernels like HGEMM can be improved through LLM-guided RL automation by systematically exploring configuration spaces at scales impractical for humans. Project and code can be found at github.com/ornith-ai/CUDA-L2
Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 12 of its 17 references that are in the map. First posted on arXiv 2 Dec 2025.
Builds on
12 of 17 references.
References · 12
- 2023GPT-4 Technical Reportcited by 18,132
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2025Qwen3 Technical Reportcited by 8,195
- 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,655
- 2023Instruction Tuning with GPT-4cited by 676
- 2023Instruction Tuning for Large Language Models: A Surveycited by 617
- 2025KernelBench: Can LLMs Write Efficient GPU Kernels?cited by 206
- 2019MLPerf Inference Benchmarkcited by 195
- 2025Kevin: Multi-Turn RL for Generating CUDA Kernelscited by 73
- 2025CUDA-L1: Improving CUDA Optimization via Contrastive Reinforcement Learningcited by 59
- 2025SwizzlePerf: Hardware-Aware LLMs for GPU Kernel Performance Optimizationcited by 11
Built on by
Citing papers per year: 2026: 13.
13 papers.
Sort:
By area:
- 2026KernelFoundry: Hardware-aware evolutionary GPU kernel optimizationcited by 11
- 2026Towards Automated Kernel Generation in the Era of LLMscited by 9
- 2026StitchCUDA: An Automated Multi-Agents End-to-End GPU Programing Framework with Rubric-based Agentic Reinforcement Learningcited by 7
- 2026CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programscited by 5
- 2026OptiML: An End-to-End Framework for Program Synthesis and CUDA Kernel Optimizationcited by 3
- 2026Making LLMs Optimize Multi-Scenario CUDA Kernels Like Expertscited by 3
- 2026AscendOptimizer: Episodic Agent for Ascend NPU Operator Optimizationcited by 2
- 2026Surprisal-Guided Selection: Compute-Optimal Test-Time Strategies for Execution-Grounded Code Generationcited by 1
- 2026Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewardscited by 0
- 2026MobileKernelBench: Can LLMs Write Efficient Kernels for Mobile Devices?cited by 0
- 2026Step-TP: A Grounded, Step-Level Dataset with Chain-of-Thought Reasoning for LLM-Guided Tensor Program Optimizationcited by 0
- 2026EGG: An Expert-Guided Agent Framework for Kernel Generationcited by 0
- 2026PTXBench: Benchmarking and Adapting LLMs for GPU Kernel Optimization with Architecture-specific PTX18 Aug 2026
- 2026EGG: An Expert-Guided Agent Framework for Kernel Generation25 Jun 2026
- 2026Step-TP: A Grounded, Step-Level Dataset with Chain-of-Thought Reasoning for LLM-Guided Tensor Program Optimization25 May 2026
- 2026CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs19 May 2026
- 2026AscendOptimizer: Episodic Agent for Ascend NPU Operator Optimization24 Mar 2026
- 2026KernelFoundry: Hardware-aware evolutionary GPU kernel optimization12 Mar 2026
- 2026MobileKernelBench: Can LLMs Write Efficient Kernels for Mobile Devices?12 Mar 2026
- 2026Making LLMs Optimize Multi-Scenario CUDA Kernels Like Experts7 Mar 2026
- 2026StitchCUDA: An Automated Multi-Agents End-to-End GPU Programing Framework with Rubric-based Agentic Reinforcement Learning3 Mar 2026
- 2026OptiML: An End-to-End Framework for Program Synthesis and CUDA Kernel Optimization12 Feb 2026
- 2026Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewards12 Feb 2026
- 2026Surprisal-Guided Selection: Compute-Optimal Test-Time Strategies for Execution-Grounded Code Generation7 Feb 2026
1 more
- 2026Towards Automated Kernel Generation in the Era of LLMs22 Jan 2026
- 2026KernelFoundry: Hardware-aware evolutionary GPU kernel optimizationcited by 11
- 2026CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programscited by 5
- 2026OptiML: An End-to-End Framework for Program Synthesis and CUDA Kernel Optimizationcited by 3
- 2026Making LLMs Optimize Multi-Scenario CUDA Kernels Like Expertscited by 3
- 2026AscendOptimizer: Episodic Agent for Ascend NPU Operator Optimizationcited by 2
- 2026Surprisal-Guided Selection: Compute-Optimal Test-Time Strategies for Execution-Grounded Code Generationcited by 1
- 2026Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewardscited by 0
- 2026MobileKernelBench: Can LLMs Write Efficient Kernels for Mobile Devices?cited by 0
- 2026PTXBench: Benchmarking and Adapting LLMs for GPU Kernel Optimization with Architecture-specific PTXcited by 0
- 2026PTXBench: Benchmarking and Adapting LLMs for GPU Kernel Optimization with Architecture-specific PTX18 Aug 2026
- 2026CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs19 May 2026
- 2026AscendOptimizer: Episodic Agent for Ascend NPU Operator Optimization24 Mar 2026
- 2026KernelFoundry: Hardware-aware evolutionary GPU kernel optimization12 Mar 2026
- 2026MobileKernelBench: Can LLMs Write Efficient Kernels for Mobile Devices?12 Mar 2026
- 2026Making LLMs Optimize Multi-Scenario CUDA Kernels Like Experts7 Mar 2026
- 2026OptiML: An End-to-End Framework for Program Synthesis and CUDA Kernel Optimization12 Feb 2026
- 2026Improving HPC Code Generation Capability of LLMs via Online Reinforcement Learning with Real-Machine Benchmark Rewards12 Feb 2026
- 2026Surprisal-Guided Selection: Compute-Optimal Test-Time Strategies for Execution-Grounded Code Generation7 Feb 2026