用AI自动生成适配多种硬件的高效计算程序。
KForge: Program Synthesis for Diverse AI Hardware Accelerators
- 双智能体协作:生成与性能分析循环优化代码。
- 仅需一个样例即可适配新硬件平台。
- 跨平台知识迁移提升生成质量,支持CUDA与Metal。
GPU核是机器学习性能的关键,但在不同加速器上优化难度大。我们提出KForge,一个平台无关的框架,基于两个协同的LLM智能体:生成智能体通过编译和正确性反馈迭代生成并优化程序;性能分析智能体解析性能剖析数据以指导优化。该架构仅需单次示例即可适配新平台。主要贡献包括:(1) 提出迭代优化机制,生成与性能分析智能体通过功能与优化流程协作,解读多样化的剖析数据(来自程序化API到图形界面工具),生成可操作建议,实现任意加速器的程序合成;(2) 证明生成智能体能有效利用跨平台知识迁移,一个架构的参考实现显著提升其他硬件目标的生成质量;(3) 验证方法的平台无关性,在本质不同的并行计算平台(NVIDIA CUDA与Apple Metal)上均实现有效程序合成。
原文摘要 · Abstract (English)
GPU kernels are critical for ML performance but difficult to optimize across diverse accelerators. We present KForge, a platform-agnostic framework built on two collaborative LLM-based agents: a generation agent that produces and iteratively refines programs through compilation and correctness feedback, and a performance analysis agent that interprets profiling data to guide optimization. This agent-based architecture requires only a single-shot example to target new platforms. We make three key contributions: (1) introducing an iterative refinement system where the generation agent and performance analysis agent collaborate through functional and optimization passes, interpreting diverse profiling data (from programmatic APIs to GUI-based tools) to generate actionable recommendations that guide program synthesis for arbitrary accelerators; (2) demonstrating that the generation agent effectively leverages cross-platform knowledge transfer, where a reference implementation from one architecture substantially improves generation quality for different hardware targets; and (3) validating the platform-agnostic nature of our approach by demonstrating effective program synthesis across fundamentally different parallel computing platforms: NVIDIA CUDA and Apple Metal.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。