GPU kernel optimization represents a paradigm where functional correctness is assumed and execution efficiency is the objective. We present daVinci-kernel, a reinforcement learning framework that couples skill discovery with skill exploitation through a dynamically evolving skill library. daVinci-kernel jointly trains three agents sharing one LLM backbone: a Skill Selection Agent that retrieves relevant techniques via BM25 and LLM reranking, a Policy Agent that generates multi-turn CUDA/Triton kernels conditioned on selected skills, and a Skill Summary Agent that distills successful rollouts into reusable skills. Candidate skills are added only after execution-based verification confirms reproducible speedups. All three agents share a single LLM backbone, are initialized via a structured SFT cold start on diversity-filtered data, and are then jointly optimized end-to-end with multi-turn REINFORCE and per-agent advantage estimation. On KernelBench, daVinci-kernel-14B achieves 37.2%, 70.6%, and 32.2% on Level 1, Level 2, and Level 3 under the Fast$_1$ threshold, outperforming the strongest prior RL-trained model, Dr.Kernel-14B.
翻译:GPU内核优化代表了这样一种范式:功能性正确性被视为前提,执行效率成为优化目标。本文提出daVinci-kernel框架——一种通过动态演进的技能库将技能发现与技能利用相结合的强化学习系统。该框架联合训练共享同一LLM骨干网络的三个智能体:技能选择智能体(通过BM25与LLM重排序检索相关技术)、策略智能体(基于选定技能生成多轮CUDA/Triton内核)以及技能总结智能体(将成功执行轨迹提炼为可复用技能)。候选技能仅在执行验证确认其能带来可复现的性能提升后才被纳入技能库。三个智能体共享单一LLM骨干网络,通过基于多样性过滤数据的结构化SFT冷启动初始化,随后采用多轮REINFORCE算法与独立优势估计进行端到端联合优化。在KernelBench测试中,daVinci-kernel-14B在Fast₁阈值条件下,于Level 1、Level 2和Level 3分别取得37.2%、70.6%和32.2%的领先性能,全面超越此前最强的强化学习训练模型Dr.Kernel-14B。