arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.18616cs.DCcs.AIcs.PL
收藏

ARGUS:通过数据流不变量指导的代理GPU优化

Ave: Guiding Agentic GPU Optimization Using Data-Flow Invariants

CausalFlow Inc.(CausalFlow公司);HKUST(香港科技大学);Tsinghua University(清华大学);Stanford University(斯坦福大学);UCAS;UC Riverside(UC河滨分校)

Haohui Mai, Xiaoyan Guo, Xiangyun Ding, Daifeng Li, Qiuchu Yu, Chenzhun Guo, Cong Wang, Jiacheng Zhao, Christos Kozyrakis, Binhang Yuan

AI总结:

ARGUS通过数据流不变量指导代理生成高效GPU内核,解决传统代理在关键计算任务中的性能不足问题,实现接近人工优化的性能和广泛的任务泛化能力。

摘要:

基于LLM的编码代理能够生成功能正确的GPU内核,但其性能远低于人工优化的库在矩阵乘法、注意力和混合专家(MoE)等关键计算中的表现。峰值GPU性能需要协调紧密耦合的优化,包括分块、共享内存 staging、软件流水线和指令调度,而现有代理依赖稀疏的通过/失败反馈,无法诊断全局约束违规。我们提出了Argus,一个通过数据流不变量解决这一问题的框架:编译时规范编码数据在内核执行中的 choreography。Argus引入了基于分块的Pythonic DSL,暴露硬件指令和编译器策略,同时隐藏低级表示。DSL提供标签函数以通过数据和控制流传播符号注释,并提供标签断言以在使用站点强制执行关系约束。当发生违规时,编译器返回具体的反例,识别线程、数据元素和程序点,使代理能够获得密集的结构化反馈以进行针对性修复。不变量通过抽象解释和SMT求解在编译时验证,无运行时开销。一个上下文强化学习计划器学习选择优化并合成有效的不变量,由一个精心编纂的GPU优化技术知识库支持。我们在AMD MI300X GPU上评估Argus,涵盖GEMM、flash attention和MoE内核,占LLM推理中GPU时间的90%以上。生成的内核达到99-104%的当前最佳人工优化汇编吞吐量,并且比现有代理系统快2-1543倍。Argus进一步泛化到200个KernelBench任务,解决100%的Level 1和90%的Level 2问题。

英文摘要:

LLM coding agents can generate correct GPU kernels, but their performance still trails expert libraries. Reaching peak throughput requires coordinating low-level optimizations such as shared-memory staging, software pipelining, and instruction scheduling. Yet unit tests and profiles provide only sparse end-to-end feedback, making it difficult for agents to identify which global constraints an optimization violates. We present Ave, an agentic framework that uses data-flow invariants as compile-time guardrails for GPU kernel optimization. Ave provides a tile-based Pythonic DSL that exposes hardware instructions and compiler policies while abstracting complex memory layouts. Tag functions assign symbolic labels to data, the compiler propagates them through data and control flow, and tag assertions enforce required relationships at use sites. A flow-sensitive, path-insensitive analysis with an SMT solver checks these assertions and returns concrete counterexamples for violations, with no runtime overhead. An in-context reinforcement learning planner proposes optimizations from a curated knowledge base, while a lowering agent implements them and instantiates the required invariants. We evaluate Ave on AMD MI300X across GEMM, flash attention, and MoE, which together account for up to 90% of GPU time in LLM inference. With GPT-5.6 Sol, Ave achieves 89-99% of the effective throughput of state-of-the-art hand-optimized libraries and improves geometric-mean throughput by 1.62-1176x over uncontaminated agentic baselines. On 200 KernelBench tasks, Ave produces valid kernels within three attempts for 100% of Level 1 and 88% of Level 2 problems.

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

↑