Modern machine learning (ML) workloads increasingly rely on GPUs, yet achieving high end-to-end performance remains challenging due to dependencies on both GPU kernel efficiency and host-side settings. Although LLM-based methods show promise on automated GPU kernel generation, prior works mainly focus on single-kernel optimization and do not extend to end-to-end programs, hindering practical deployment. To address the challenge, in this work, we propose StitchCUDA, a multi-agent framework for end-to-end GPU program generation, with three specialized agents: a Planner to orchestrate whole system design, a Coder dedicated to implementing it step-by-step, and a Verifier for correctness check and performance profiling using Nsys/NCU. To fundamentally improve the Coder's ability in end-to-end GPU programming, StitchCUDA integrates rubric-based agentic reinforcement learning over two atomic skills, task-to-code generation and feedback-driven code optimization, with combined rubric reward and rule-based reward from real executions. Therefore, the Coder learns how to implement advanced CUDA programming techniques (e.g., custom kernel fusion, cublas epilogue), and we also effectively prevent Coder's reward hacking (e.g., just copy PyTorch code or hardcoding output) during benchmarking. Experiments on KernelBench show that StitchCUDA achieves nearly 100% success rate on end-to-end GPU programming tasks, with 1.72x better speedup over the multi-agent baseline and 2.73x than the RL model baselines.


翻译:现代机器学习(ML)工作负载日益依赖GPU,但由于同时依赖于GPU内核效率和主机端设置,实现高端的端到端性能仍然具有挑战性。尽管基于LLM的方法在自动化GPU内核生成方面显示出潜力,但先前的工作主要集中于单内核优化,并未扩展到端到端程序,阻碍了实际部署。为解决这一挑战,本文提出StitchCUDA,一个用于端到端GPU程序生成的多智能体框架,包含三个专门化的智能体:一个用于编排整个系统设计的规划器(Planner)、一个致力于逐步实现设计的编码器(Coder),以及一个使用Nsys/NCU进行正确性检查和性能剖析的验证器(Verifier)。为了从根本上提升编码器在端到端GPU编程中的能力,StitchCUDA集成了基于准则的智能体强化学习,该学习针对两项原子技能——任务到代码生成和反馈驱动的代码优化——结合了来自实际执行的准则奖励和基于规则的奖励。因此,编码器学会了如何实现高级CUDA编程技术(例如,自定义内核融合、cublas尾声),并且我们在基准测试过程中也有效防止了编码器的奖励欺骗行为(例如,仅复制PyTorch代码或硬编码输出)。在KernelBench上的实验表明,StitchCUDA在端到端GPU编程任务上实现了接近100%的成功率,其加速比优于多智能体基线1.72倍,优于强化学习模型基线2.73倍。

0
下载
关闭预览

相关内容

大语言模型智能体强化学习:全景综述
专知会员服务
45+阅读 · 2025年12月18日
面向大语言模型的智能体化强化学习图景:综述
专知会员服务
55+阅读 · 2025年9月3日
盘点来自工业界的GPU共享方案
计算机视觉life
12+阅读 · 2021年9月2日
概述自动机器学习(AutoML)
人工智能学家
19+阅读 · 2019年8月11日
PlaNet 简介:用于强化学习的深度规划网络
谷歌开发者
13+阅读 · 2019年3月16日
荐书丨深度学习框架PyTorch:入门与实践
程序人生
11+阅读 · 2018年1月19日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
23+阅读 · 2009年12月31日
国家自然科学基金
48+阅读 · 2009年12月31日
VIP会员
相关VIP内容
大语言模型智能体强化学习:全景综述
专知会员服务
45+阅读 · 2025年12月18日
面向大语言模型的智能体化强化学习图景:综述
专知会员服务
55+阅读 · 2025年9月3日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
23+阅读 · 2009年12月31日
国家自然科学基金
48+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员