cuPilot:一种用于CUDA内核演化的策略协调多智能体框架
cuPilot: A Strategy-Coordinated Multi-agent Framework for CUDA Kernel Evolution
AI总结:
cuPilot通过引入策略作为中间语义表示,提出了一种策略协调的多智能体框架,实现了对CUDA内核的高效优化,实验表明其在内核生成和性能提升方面表现出色。
摘要:
优化CUDA内核是一项具有挑战性和劳动密集型的任务,鉴于需要硬件软件协同设计的专业知识以及高性能内核库的专有性质。尽管最近的大型语言模型(LLMs)结合进化算法在自动内核优化方面显示出前景,但现有方法在性能上往往不足,原因在于其亚优化的智能体设计和不匹配的进化表示。本文识别了这些不匹配之处,并提出了cuPilot,一种引入策略作为内核演化的中间语义表示的策略协调多智能体框架。主要贡献包括一种策略协调的进化算法、屋顶线引导提示和策略层面的种群初始化。实验结果表明,cuPilot生成的内核在100个内核基准测试中相对于PyTorch平均加速了3.09倍。在GEMM任务中,cuPilot展示了复杂的优化,并实现了关键硬件单元的高利用率。生成的内核在https://github.com/champloo2878/cuPilot-Kernels.git上开源。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。