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

学习新型AI加速器的多智能体内核优化循环案例研究

A Case Study of a Multi-Agent Kernel-Optimization Loop That Learns a New AI Accelerator

Fluidstack

Byonggon Chun

AI总结:

本文通过案例研究,构建针对FuriosaAI RNGD NPU的LLM智能体循环,经12天优化3个Gemma-4-12B解码内核,最终获9.293倍几何平均加速比,为新型AI加速器内核优化提供了可行方案。

摘要:

前沿大语言模型(LLM)可为大多数单算子基准任务编写正确的CUDA内核,但在其架构和编程语言极少被接触的加速器上,准确率会大幅下降。本文针对此类加速器开展了一项LLM智能体循环的案例研究,研究对象为FuriosaAI RNGD NPU,其采用文档稀疏的新型Rust领域特定语言(DSL)编程。该循环在稀缺的共享设备上耗时12天,对3个Gemma-4-12B解码内核进行了优化。该循环自主构建目标知识:编写并检查DSL文档摘要、通过微基准测试测量芯片性能、记录编译器派生的合法性规则,并在工具链变更时重新审视这些知识,尽可能重新检查规则和测量结果。该循环采用基于角色的逐内核设计树搜索,探索完整内核设计,并在每个内核的最优版本中积累小的已接受变更。由于设备时间稀缺且测量结果存在噪声,该循环在任何设备运行前都会用低成本检查筛选新设计;在运行后期,一项变更仅在与设备上的最优内核反复比较后才被接受。最终内核达到比官方基准9.293倍的几何平均加速比,每个内核的周期仅比移动其权重所需周期多1.25倍。本文的提示词、分析器和验收测试可在该https URL获取。

英文摘要:

Frontier large language models write correct CUDA kernels for most single-operator benchmark tasks, yet their accuracy collapses on accelerators whose architecture and programming language they have rarely seen. We present a case study of an LLM agent loop built for such accelerators. Our example is the FuriosaAI RNGD NPU, programmed in a recent, sparsely documented Rust DSL, where the loop optimized three Gemma-4-12B decode kernels over 12 days on a shared, scarce device. The loop builds its own target knowledge: it writes and checks a summary of the DSL documentation, measures the chip with microbenchmarks, records compiler-derived legality rules, and revisits this knowledge when the toolchain changes, rechecking rules and measurements where it can. A role-based search over per-kernel Design Trees explores whole-kernel designs and accumulates small accepted changes in the best version of each kernel. Because device time is scarce and readings are noisy, cheap checks screen new designs before any device run, and late in the run a change was accepted only after repeated comparisons with the best kernel on the device. The final kernels reach a 9.293x geomean speedup over the official baseline, each within 1.25x of the cycles needed just to move its weights. Our prompts, profiler and acceptance test are available at https://github.com/bgchun-fs/multi-agent-kernel-gen-loop.

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

↑