arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.11000cs.DCcs.AIcs.LG
收藏

为GPU内核生成微调GPT-5

Fine-Tuning GPT-5 for GPU Kernel Generation

Ali Tehrani, Yahya Emara, Essam Wissam, Wojciech Paluch, Waleed Atallah, Łukasz Dudziak, Mohamed S. Abdelfattah

AI总结:

通过强化学习微调GPT-5提升GPU内核生成性能,实现正确率和效率的显著提升。

摘要:

开发高效的GPU内核对于扩展现代人工智能系统至关重要,但这一任务仍然复杂,因为涉及复杂的硬件架构和需要专门的优化专业知识。尽管大型语言模型(LLMs)在一般顺序代码生成方面表现出强大的能力,但它们在GPU代码生成中面临重大挑战,原因包括高质量标记化训练数据的稀缺、生成合成解决方案时编译器的偏见,以及在不同硬件代际之间的泛化能力有限。这使得监督微调(SFT)无法作为改进当前LLMs的可扩展方法。相反,强化学习(RL)提供了一种数据高效且适应性强的替代方案,但需要访问相关工具、精心选择训练问题以及一个稳健的评估环境。我们介绍了Makora的环境和工具,用于强化学习微调前沿模型,并报告了我们对GPT-5进行微调以生成Triton代码的结果。在单次尝试设置中,我们的微调模型将内核正确性从43.7%提高到77.0%(+33.3个百分点),并将超越TorchInductor的问题比例从14.8%提高到21.8%(+7个百分点),相比基线GPT-5,同时在KernelBench上超过了先前的最先进模型。当整合到完整的编码代理中时,它可以解决扩展后的KernelBench套件中高达97.4%的问题,优于PyTorch TorchInductor编译器在72.9%的问题上,几何平均加速率为2.12倍。我们的工作表明,针对强化学习的后训练可以解锁LLM在高度专业化的技术领域中的能力,这些领域传统监督学习受到数据可用性的限制,开辟了AI辅助加速器编程的新途径。

英文摘要:

Developing efficient GPU kernels is essential for scaling modern AI systems, yet it remains a complex task due to intricate hardware architectures and the need for specialized optimization expertise. Although Large Language Models (LLMs) demonstrate strong capabilities in general sequential code generation, they face significant challenges in GPU code generation because of the scarcity of high-quality labeled training data, compiler biases when generating synthetic solutions, and limited generalization across hardware generations. This precludes supervised fine-tuning (SFT) as a scalable methodology for improving current LLMs. In contrast, reinforcement learning (RL) offers a data-efficient and adaptive alternative but requires access to relevant tools, careful selection of training problems, and a robust evaluation environment. We present Makora's environment and tools for reinforcement learning finetuning of frontier models and report our results from fine-tuning GPT-5 for Triton code generation. In the single-attempt setting, our fine-tuned model improves kernel correctness from 43.7% to 77.0% (+33.3 percentage points) and increases the fraction of problems outperforming TorchInductor from 14.8% to 21.8% (+7 percentage points) compared to baseline GPT-5, while exceeding prior state-of-the-art models on KernelBench. When integrated into a full coding agent, it is able to solve up to 97.4% of problems in an expanded KernelBench suite, outperforming the PyTorch TorchInductor compiler on 72.9% of problems with a geometric mean speedup of 2.12x. Our work demonstrates that targeted post-training with reinforcement learning can unlock LLM capabilities in highly specialized technical domains where traditional supervised learning is limited by data availability, opening new pathways for AI-assisted accelerator programming.

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

↑