OptiML:一种端到端的程序合成与CUDA内核优化框架
OptiML: An End-to-End Framework for Program Synthesis and CUDA Kernel Optimization
AI总结:
OptiML通过端到端框架将自然语言意图或输入代码转化为高性能CUDA内核,结合搜索与验证技术实现优化。
摘要:
生成高性能的CUDA内核仍然具有挑战性,因为需要在嘈杂且昂贵的硬件反馈下导航低级转换的组合空间。尽管大型语言模型可以合成功能正确的CUDA代码,但要实现竞争性的性能,需要系统地探索和验证优化选择。我们提出了OptiML,一种端到端的框架,它将自然语言意图或输入CUDA代码映射到性能优化的CUDA内核,通过将内核优化建模为搜索下的验证。OptiML由两个解耦的阶段组成。当输入是自然语言时,一个混合思维生成器(OptiML-G)充当内核实现策略的提案策略,生成初始可执行程序。然后,基于搜索的优化器(OptiML-X)使用蒙特卡洛树搜索在LLM驱动的编辑上细化合成或用户提供的内核,受由分析器反馈派生的硬件感知奖励引导。每个候选转换都使用Nsight Compute进行编译、验证和分析,并通过结合运行时与硬件瓶颈代理的复合目标进行评估,同时防止退化。我们评估了OptiML在合成和优化以及仅优化的设置上,对多样化的CUDA内核套件。结果表明,OptiML在强LLM基线中一致地发现了经过验证的性能改进,并产生了基于分析器证据的可解释优化轨迹。
英文摘要:
Generating high-performance CUDA kernels remains challenging due to the need to navigate a combinatorial space of low-level transformations under noisy and expensive hardware feedback. Although large language models can synthesize functionally correct CUDA code, achieving competitive performance requires systematic exploration and verification of optimization choices. We present OptiML, an end-to-end framework that maps either natural-language intent or input CUDA code to performance-optimized CUDA kernels by formulating kernel optimization as search under verification. OptiML consists of two decoupled stages. When the input is natural language, a Mixture-of-Thoughts generator (OptiML-G) acts as a proposal policy over kernel implementation strategies, producing an initial executable program. A search-based optimizer (OptiML-X) then refines either synthesized or user-provided kernels using Monte Carlo Tree Search over LLM-driven edits, guided by a hardware-aware reward derived from profiler feedback. Each candidate transformation is compiled, verified, and profiled with Nsight Compute, and evaluated by a composite objective that combines runtime with hardware bottleneck proxies and guardrails against regressions. We evaluate OptiML in both synthesis-and-optimize and optimization-only settings on a diverse suite of CUDA kernels. Results show that OptiML consistently discovers verified performance improvements over strong LLM baselines and produces interpretable optimization trajectories grounded in profiler evidence.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。