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

提问而非装备:用于深度内核优化的提问驱动型编码智能体

Ask, Don't Equip: Question-Driven Coding Agents for Deep Kernel Optimization

Snowflake AI Research(Snowflake AI研究);Carnegie Mellon University(卡内基梅隆大学)

Gabriele Oliaro, Jaeseong Lee, Zhaoyuan Su, Sreeram Vennam, Zhihao Jia, Samyam Rajbhandari

AI总结:

该研究提出提问驱动型编码智能体KernelSeek,无需算子特定知识即可优化CUDA内核,在FlashAttention任务上性能优于主流工具丰富型自主智能体,生成无依赖的高效内核并发布相关资源。

摘要:

用于GPU内核优化的大语言模型智能体在结构自由度权衡中处于两个极端:脚本式智能体通过学习到的策略、优化菜单或固定角色在每一步固定模型的行为,在适用场景中样本效率高,但在不适用场景中会停滞;开放式智能体允许自主模型对内核种群进行变异,却需为这种自由度付出代价:数千次评估、重复编辑以及错误候选。两者均通过为智能体配备更多工具来应对复杂目标,包括解析的性能分析器输出、反汇编分析、文档与库检索以及经验存储。本文指出两者均缺乏方向,这是当前仍存在差距的核心假设,而在恰当时机提出的简短问题即可提供方向,且不会限制智能体后续的操作空间。我们提出KernelSeek,一种提问驱动型智能体,无需算子特定知识、无需模仿现有更快实现即可将CUDA内核提速:它是一种通用编码智能体、一个可验证目标的最小框架,以及在决策点提出的问题——首先来自人类,随后来自智能体自身应用的问题库。在相同任务、评估器、硬件和周期下,采用主流风格构建的工具丰富型自主智能体在133次模型驱动步骤后,在FlashAttention-3上的性能稳定在0.50倍;而KernelSeek达到1.13倍。随后它为Hopper和Blackwell架构生成了无依赖的FlashAttention前向内核,即不含CUTLASS、CuTe、cuBLAS或cuDNN的单个CUDA文件,在每种架构的182种场景中均正确,几何平均性能分别为FlashAttention-3的1.16倍和FlashAttention-4的1.46倍。在162条人类消息和11500次智能体工具调用中,所有性能提升均由推动智能体进入系统不同层级或拒绝声称限制的问题驱动,从未由提供信息的问题驱动。我们发布了这些内核、框架、问题库及所有轨迹。

英文摘要:

LLM agents for GPU kernel optimization sit at two ends of a structure-freedom tradeoff. Scripted agents fix what the model does at each step, via a learned policy, an optimization menu, or fixed roles, and are sample-efficient where the recipe applies and stall where it does not. Open-ended agents let a self-directed model mutate a population of kernels and pay for the freedom in trials: thousands of evaluations, repeated edits, and wrong candidates. Both respond to hard targets by equipping the agent with more: parsed profiler output, disassembly analysis, retrieval over documentation and libraries, and stores of lessons. We argue that both lack direction, a hypothesis about where the remaining gap is, and that a short question asked at the right moment supplies it without narrowing what the agent may do next. We present KernelSeek, a question-driven agent that makes an existing CUDA kernel faster with no operator-specific knowledge and no faster implementation to imitate: a general-purpose coding agent, a minimal harness that enforces a verifiable goal, and questions at decision points, first from a human, then from a bank the agent applies to itself. On the same task, evaluator, hardware, and week, a tool-rich autonomous agent built in the prevailing style plateaued at 0.50x FlashAttention-3 after 133 model-driven steps; KernelSeek reached 1.13x. It then produced dependency-free FlashAttention forward kernels for Hopper and Blackwell, single CUDA files with no CUTLASS, CuTe, cuBLAS, or cuDNN, correct on all 182 scenarios per architecture and 1.16x FlashAttention-3 and 1.46x FlashAttention-4 (geometric mean). Across 162 human messages and 11.5K agent tool calls, every large gain followed a question that moved the agent to a different layer of the system or rejected a claimed limit, never one that supplied information. We release the kernels, harness, question bank, and all traces.

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

↑