Optimizing CUDA kernels is a challenging and labor-intensive task, given the need for hardware-software co-design expertise and the proprietary nature of high-performance kernel libraries. While recent large language models (LLMs) combined with evolutionary algorithms show promise in automatic kernel optimization, existing approaches often fall short in performance due to their suboptimal agent designs and mismatched evolution representations. This work identifies these mismatches and proposes cuPilot, a strategy-coordinated multi-agent framework that introduces strategy as an intermediate semantic representation for kernel evolution. Key contributions include a strategy-coordinated evolution algorithm, roofline-guided prompting, and strategy-level population initialization. Experimental results show that the generated kernels by cuPilot achieve an average speed up of 3.09$\times$ over PyTorch on a benchmark of 100 kernels. On the GEMM tasks, cuPilot showcases sophisticated optimizations and achieves high utilization of critical hardware units. The generated kernels are open-sourced at https://github.com/champloo2878/cuPilot-Kernels.git.


翻译:优化CUDA内核是一项具有挑战性且劳动密集型的任务,这既需要软硬件协同设计的专业知识,又受限于高性能内核库的专有性质。尽管近期将大语言模型与演化算法相结合在自动内核优化方面展现出潜力,但现有方法常因智能体设计欠佳及演化表示不匹配而导致性能不足。本研究识别了这些不匹配问题,并提出了cuPilot——一种策略协同的多智能体框架,该框架引入策略作为内核演化的中间语义表示。关键贡献包括策略协同演化算法、屋顶线引导提示以及策略级种群初始化。实验结果表明,在包含100个内核的基准测试中,cuPilot生成的内核相比PyTorch平均加速比达到3.09倍。在GEMM任务上,cuPilot展示了精密的优化技术,并实现了关键硬件单元的高利用率。生成的内核已在https://github.com/champloo2878/cuPilot-Kernels.git开源。

0
下载
关闭预览

相关内容

RAG与RAU:自然语言处理中的检索增强语言模型综述
专知会员服务
87+阅读 · 2024年5月3日
AAAI 2022 | ProtGNN:自解释图神经网络
专知会员服务
40+阅读 · 2022年2月28日
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
1+阅读 · 2016年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
VIP会员
相关基金
国家自然科学基金
1+阅读 · 2016年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员