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

0
下载
关闭预览

相关内容

Python图像处理,366页pdf,Image Operators Image Processing in Python
论文浅尝 | GEOM-GCN: Geometric Graph Convolutional Networks
开放知识图谱
14+阅读 · 2020年4月8日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员