GPU Kernel Optimization

GPU: Graphics Processing Unit

Overview

GPU kernel optimization studies how to implement individual operations—such as matrix multiplication, attention, reductions, and sparse computations—so they use GPU memory and compute units efficiently. Common approaches include tiling and fusion, low-precision arithmetic, compiler scheduling, and domain-specific languages such as CUDA, Triton, and CuTe. Autotuners and LLM-based agents increasingly search these design spaces using profiling, execution feedback, evolutionary search, or reinforcement learning, with benchmarks such as KernelBench measuring correctness and speed. A central challenge is that gains often depend on the workload and GPU architecture: generated kernels may pass correctness checks yet lose to vendor libraries, regress on unseen shapes, or yield little end-to-end improvement.

Latest papers

211 papers28 papers in the last four weeks, up 56% on the four weeks before. 0.2% of all new papers.

Jul 18, 2025

CUDA-L1: Improving CUDA Optimization via Contrastive Reinforcement Learning

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 SOTA models achieve low success rates in improving CUDA speed. In this paper, we introduce CUDA-L1, an automated reinforcement learning framework for CUDA optimization that employs a novel contrastive RL algorithm. CUDA-L1 achieves significant performance improvements on the CUDA optimization task: trained on A100, it delivers an average speedup of x3.12 with a median speedup of x1.42 against default baselines over across all 250 CUDA kernels of KernelBench, with peak speedups reaching x120. In addition to the default baseline provided by KernelBench, CUDA-L1 demonstrates x2.77 over Torch Compile, x2.88 over Torch Compile with reduce overhead, x2.81 over CUDA Graph implementations, and x7.72 over cuDNN libraries. Furthermore, the model also demonstrates portability across different GPU architectures. Beyond these benchmark results, CUDA-L1 demonstrates several properties: it 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. 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. Project: deepreinforce-ai.github.io/cudal1_blog