arXiv:2506.20807cs.LGcs.AI2025-06被引 26

用大模型自动优化GPU内核,提升性能并降低门槛。

GPU Kernel Scientist: An LLM-Driven Framework for Iterative Kernel Optimization

  • 大模型分阶段迭代优化,基于历史代码和文献生成优化假设。
  • 在AMD MI300架构上实现性能提升,仅通过运行时反馈驱动改进。
  • 适合缺乏专家资源或面对新硬件的开发者使用。

优化GPU内核以实现高性能是一项复杂任务,通常需要深入的架构知识、大量性能分析及反复实验。这一挑战在面向新型或文档较少的GPU架构时尤为突出。本文提出一个由大模型驱动的「GPU Kernel Scientist」框架,通过多阶段、演进式流程自动优化加速器内核:(a) 战略性选择有潜力的历史代码版本作为新迭代基础;(b) 基于现有代码与通用GPU文献知识生成优化假设;(c) 自主实施实验,通过代码修改并提交至外部评估系统,仅依赖观测到的执行时间作为性能反馈。我们详细阐述了该方法在AMD MI300目标架构上的应用,展示了大模型如何弥补领域专业知识不足。除实验结果外,还提供了架构设计、操作流程与定性洞察,表明大模型驱动的智能体可显著降低门槛并加速内核优化,尤其适用于资源受限或快速更新的硬件环境。

原文摘要 · Abstract (English)

Optimizing GPU kernels for high performance is a complex task, often demanding deep architectural knowledge, extensive profiling, and iterative experimentation. This challenge is amplified when targeting newer or less-documented GPU architectures where traditional development aids are scarce. This paper introduces an LLM-powered "GPU Kernel Scientist," an automated methodology for iteratively refining accelerator kernels. Our methodology employs LLMs in a multi-stage, evolutionary process: (a) strategically selecting promising prior code versions as a basis for new iterations; (b) generating hypotheses for optimization experiments, based on existing code and assimilated knowledge from general GPU literature; and (c) autonomously implementing these experiments through code modification and subsequent submission to an external evaluation system, using only observed timing data as performance feedback. We detail how this approach navigates the challenges of the AMD MI300 target architecture and leverages LLMs to compensate for limited domain-specific human expertise. In addition to our results, we present the architectural design, operational workflow, and qualitative insights, highlighting the potential of LLM-driven agents to democratise and accelerate GPU kernel optimization, especially in resource-constrained or rapidly updating hardware environment.

GPU优化大模型自动化AMD MI300

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。