arXiv:2511.06345cs.DCcs.AI2025-11被引 12

用硬件性能分析指导AI生成更优加速代码,提升计算效率。

PRAGMA: A Profiling-Reasoned Multi-Agent Framework for Automatic Kernel Optimization

  • 将硬件性能剖析数据融入AI推理,让模型理解底层瓶颈
  • 在CPU和GPU上分别实现2.81倍和2.30倍的平均加速
  • 适合关注自动优化与高性能计算的开发者

设计高性能内核需要专家级调优和对硬件特性的深入理解。近年来,大语言模型(LLMs)推动了自动化内核生成的发展,但现有系统多依赖正确性或执行时间反馈,缺乏对低层性能瓶颈的推理能力。本文提出PRAGMA,一个基于性能剖析的多智能体框架,将执行反馈与细粒度硬件剖析集成到推理循环中。PRAGMA使LLM能够识别性能瓶颈,保留历史最优版本,并迭代优化代码质量。我们在KernelBench上评估了PRAGMA,覆盖GPU和CPU后端。结果表明,PRAGMA在无剖析支持的基线AIKG基础上持续领先,在CPU和GPU平台上分别实现2.81×和2.30×的平均加速。

原文摘要 · Abstract (English)

Designing high-performance kernels requires expert-level tuning and a deep understanding of hardware characteristics. Recent advances in large language models (LLMs) have enabled automated kernel generation, yet most existing systems rely solely on correctness or execution time feedback, lacking the ability to reason about low-level performance bottlenecks. In this paper, we introduce PRAGMA, a profile-guided AI kernel generation framework that integrates execution feedback and fine-grained hardware profiling into the reasoning loop. PRAGMA enables LLMs to identify performance bottlenecks, preserve historical best versions, and iteratively refine code quality. We evaluate PRAGMA on KernelBench, covering GPU and CPU backends. Results show that PRAGMA consistently outperforms baseline AIKG without profiling enabled and achieves 2.81$\times$ and 2.30$\times$ averaged speedups against Torch on CPU and GPU platforms, respectively.

自动优化性能剖析AI生成内核优化

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