arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.21465cs.CLcs.LG
收藏

DRTriton:大规模合成数据驱动的强化学习用于Triton内核生成

DRTriton: Large-Scale Synthetic Data Driven Reinforcement Learning for Triton Kernel Generation

Texas A&M University(德克萨斯大学)

Siqi Guo, Ming Lin, Tianbao Yang

AI总结:

提出DRTriton框架,通过合成数据生成、课程强化学习和测试时搜索,训练LLM将PyTorch程序转换为优化的Triton内核,在KernelBench Level 2任务中超越GPT-5.2和Claude-Sonnet-4.5。

摘要:

在生成式AI行业中,开发高效的CUDA内核是一项基础但具有挑战性的任务。最近的研究利用大型语言模型(LLMs)自动将PyTorch参考实现转换为CUDA内核,显著减少了工程工作量。最先进的LLMs,如GPT-5.2和Claude-Sonnet-4.5,仍然难以胜任此任务。为应对这一挑战,我们提出了DRTriton,一个可扩展的学习框架,用于训练LLM将PyTorch程序转换为高度优化的Triton内核,然后在运行时编译为CUDA内核。DRTriton包含三个关键组件:(i)数据合成算法CSP-DAG,保证在算子空间上的完全覆盖和具有可控难度的无偏均匀采样;(ii)具有解耦奖励的课程RL框架,联合优化转换成功率和执行速度;(iii)测试时搜索算法,进一步提高生成的Triton内核的执行速度。通过在使用现有LLM整理的有限PyTorch-Triton对上进行SFT预热阶段,DRTriton在合成PyTorch程序上通过RL训练,有效泛化到即使对人类专家也具挑战性的真实世界CUDA内核。实验结果表明,DRTriton-7B在92%的KernelBench Level 2任务上实现了相对于PyTorch的加速,而GPT-5.2为23%,Claude-Sonnet-4.5为19%。

英文摘要:

Developing efficient CUDA kernels is a fundamental yet challenging task in the generative AI industry. Recent research leverages Large Language Models (LLMs) to automatically convert PyTorch reference implementations to CUDA kernels, significantly reducing engineering effort. State-of-the-art LLMs, such as GPT-5.2 and Claude-Sonnet-4.5, still struggle with this task. To address this challenge, we propose DRTriton, a scalable learning framework for training LLMs to convert PyTorch programs into highly optimized Triton kernels, which are then compiled to CUDA kernels at runtime. DRTriton consists of three key components: (i) a data synthetic algorithm CSP-DAG that guarantees full coverage and unbiased uniform sampling over the operator space with controlled difficulty; (ii) a curriculum RL framework with decoupled rewards that jointly optimizes conversion success rate and execution speed; and (iii) a test-time search algorithm that further improves the execution speed of the generated Triton kernels. With a warmup stage of SFT on limited PyTorch-Triton pairs curated using existing LLMs, DRTriton trained by RL on synthesized PyTorch programs generalizes effectively to real-world CUDA kernels that are challenging even for human experts. Experimental results show that DRTriton-7B achieves speedup over PyTorch on 92% of KernelBench Level 2 tasks, compared to 23% for GPT-5.2 and 19% for Claude-Sonnet-4.5.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑