arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.19018cs.SE
收藏

PEAK:一种基于自然语言转换的GPU内核性能工程AI助手

PEAK: A Performance Engineering AI-Assistant for GPU Kernels Powered by Natural Language Transformations

Stanford University(斯坦福大学);Microsoft Research Redmond(微软研究院雷德蒙德);University of California Santa Cruz(加州大学圣克鲁兹分校)

Muhammad Usman Tariq, Abhinav Jangda, Angelica Moreira, Madan Musuvathi, Tyler Sorensen

AI总结:

PEAK是一种基于自然语言转换的GPU内核性能工程AI助手,通过自然语言编写代码优化并验证性能,适用于CUDA、HIP和HLSL等后端,实现与供应商库相当的性能。

摘要:

大型语言模型(LLMs)的进步在软件开发和编程辅助方面显示出有希望的影响。然而,这些模型在处理低级后端代码时遇到困难。在GPU内核领域,这种挑战更加严峻,因为性能关键的细节与快速演变的硬件特性相结合,且可用的代码示例稀少。在本工作中,我们介绍了PEAK,一种基于自然语言转换的GPU内核性能工程AI助手。PEAK利用了一个关键见解:迭代代码转换(优化)可以简单地用自然语言编写,然后由LLMs执行。因此,这些转换可以快速开发,编码通用的可移植优化,同时也能轻松专门化到特定的GPU设备和甚至内核。这些自然转换由一个模块化且可扩展的基础设施支持,该基础设施还执行验证和性能评估。我们通过将PEAK应用于三个后端(CUDA、HIP和HLSL)来展示其灵活性,并创建了16个自然转换来优化矩阵乘法内核。我们证明了我们的实现与可用供应商库相媲美,并且在HLSL(无库的情况下)我们的实现与硬件文档的FLOPS相匹配。PEAK允许对LLMs在此领域的行为进行细致探索,包括表征转换及其错误;以及性能如何沿着优化序列演变。PEAK提供了一个接口,可以由性能工程师用来提高生产力,或完全由AI代理驱动,提供了一个向前兼容的设计,可以随着AI能力的进步而继续改进。

英文摘要:

Advancements in large language models (LLMs) are showing promising impact in software development and programming assistance. However, these models struggle when operating on low-level backend code. This challenge is exacerbated in the domain of GPU kernels, where performance-critical details are coupled to rapidly evolving hardware characteristics and available code examples are sparse. In this work, we introduce PEAK, a Performance Engineering AI-Assistant for GPU Kernels powered by natural language transformations. PEAK utilizes the key insight that iterative code transformations (optimizations) can straightforwardly be written in natural language, and then carried out by LLMs. Thus, these transformations can be rapidly developed, encoding general portable optimizations, but also easily specialized to specific GPU devices and even kernels. These natural transformations are supported by a modular and extensible infrastructure that additionally performs validation and performance evaluation. We demonstrate the flexibility of PEAK by instantiating it for three backends, CUDA, HIP, and HLSL, and create 16 natural transformations for optimizing matrix multiplication kernels. We show that our resulting implementations are competitive with vendor libraries when available, and for HLSL (without a library) our implementations match the hardware documented FLOPS. PEAK allows the fine-grained exploration of several research questions around how LLMs behave in this domain, including characterizing transformations and their errors; and how performance evolves along optimization sequences. PEAK provides an interface that can either be utilized by performance engineers to improve productivity, or driven completely autonomously (e.g., by an AI agent), providing a forward-compatible design that can continue to improve with advances in AI capabilities.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑