|

ByteDance Seed and Tsinghua AIR Introduces CUDA Agent: A Large-Scale Agentic RL System for CUDA Kernel Generation

ByteDance Seed and Tsinghua AIR have launched CUDA Agent, an agentic reinforcement studying system that trains a big language mannequin to put in writing GPU kernels that beat a compiler. The hole it targets is slim however cussed: frontier fashions already produce appropriate CUDA, they simply produce sluggish CUDA. On KernelBench, the bottom mannequin Seed1.6 passes 74.0% of duties but outruns torch.compile on solely 27.2% of them, at a 0.69× geometric-mean speedup which implies its kernels are, on common, slower than what the compiler generates by itself. CUDA Agent closes that hole by placing the mannequin inside an actual CUDA growth atmosphere with profiling, correctness checks and a permission-locked sandbox, then coaching it with PPO for 150 steps at a 131,072-token context. The result’s a 98.8% move charge and a 96.8% faster-than-torch.compile charge throughout the 250-task benchmark, at 2.11× geomean over compile — roughly 40 factors forward of Claude Opus 4.5 and Gemini 3 Pro on the toughest Level-3 cut up.

Is it deployable?

Partly, however the skilled agent is just not launched. It is constructed on Seed1.6, a proprietary MoE mannequin with 23B energetic and 230B whole parameters, and the paper ships no weights. Public: the CUDA-Agent-Ops-6K dataset, the SKILL.md spec and the reward and warm-up recipes.

Which corporations: The profiling sandbox alone used 128 NVIDIA H20 GPUs, which places full replication inside frontier labs, GPU clouds and massive infrastructure groups. Mid-size groups can nonetheless undertake the components — dataset, milestone reward, anti-reward-hacking constraints, ability spec — on prime of an open base mannequin.

Industries and functions: AI infrastructure and inference serving, GPU cloud, autonomous driving, quantitative buying and selling, medical imaging and suggestion methods — wherever fused kernels sit on a latency-critical path. Uses embody fusing operator sequences torch.compile handles poorly, reducing price per token, and re-tuning kernels throughout GPU generations.

Data synthesis

The analysis staff crawls reference operators from the torch and transformers libraries. An LLM then samples as much as 5 torch operator courses and stacks them into one fused layer. A filter retains solely operators that execute in each keen and compile modes, are deterministic, produce non-constant outputs, and run between 1 ms and 100 ms in keen mode. Samples with AST similarity above 0.9 to any KernelBench process are eliminated. The result’s CUDA-Agent-Ops-6K: 6,000 samples, 83.77% of them two-operator compositions.

Environment and reward

The agent loop mirrors OpenHands tooling — Bash, Read/Write, Edit/MultiEdit, Glob, Grep, Pocket bookEdit, BashOutput, KillBash — underneath a ReAct sample. CUDA directions ship within the Agent Skills format. SKILL.md tells the mannequin to profile the PyTorch mannequin, rewrite model_new.py with customized kernels, compile in a GPU sandbox, and iterate till the kernel is at the least 5% quicker than torch.compile at atol=1e-2, rtol=1e-2.

Reward hacking will get 5 countermeasures: permission-locked verification and profiling scripts, context managers that forbid torch.nn.practical fallbacks, checks towards 5 random inputs, profiling with system synchronization and warm-up, and no internet search instrument.

The reward is discrete quite than a uncooked speedup ratio. r ∈ {−1, 1, 2, 3}: −1 on correctness failure, 3 if the kernel clears each keen and torch.compile by greater than 5%, 2 if it clears keen solely, 1 in any other case.

https://arxiv.org/pdf/2602.24286v1

Results

Table 1, total: 98.8% move charge, 98.4% quicker than keen, 96.8% quicker than torch.compile, at 2.60× and 2.11× geomean respectively. Level 2 (operator sequences) is the strongest cut up: 100% move, 100% quicker charge, 2.80× over torch.compile. Level 3 lands at 94.0% move, 90.0% quicker charge and 1.52×, roughly 40 factors above Claude Opus 4.5 (50.0%) and Gemini 3 Pro (52.0%) on quicker charge versus compile.

One inconsistency: the summary and introduction state 100% / 100% / 92% quicker charges for Levels 1–3, whereas Table 1 studies 97.0% / 100.0% / 90.0%. Table 1 is the primary outcomes desk.

Ablations are blunt. Removing the agent loop drops quicker charge versus compile from 96.8% to 14.1%. A uncooked speedup reward offers 60.4%, no RFT offers 49.8% plus reward collapse, no worth pretraining offers 50.9% plus runaway trajectories.

Case research present what the coverage learns. A diagonal matmul rewritten as row-wise scaling: 73.31× over torch.compile. A matmul-divide-sum-scale chain reordered and fused: 24.04×. A ResNet BasicBlock with BatchNorm folded into convolution andcudnnConvolutionBiasActivationForward: 3.59×.