arXiv:2610.38329cs.LGOct 2026

Manuscript Offprint

arXiv:2610.38329

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

Byonggon Chun

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Byonggon Chun

Fluidstack

byonggon@fluidstack.io

Abstract—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.293× geomean speedup over the official baseline, each within 1.25× 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.

I. INTRODUCTION

Frontier large language models (LLMs) have become capable kernel programmers on mature platforms. On CUDA, the best of them produce functionally correct kernels for most KernelBench Level 1 tasks, single operators such as matrix multiplication, within a few tries [1], [2], and agentic systems built on them tune kernels for accelerators such as Gemmini and AWS Trainium [3], [4]. This strength does not carry over to data-scarce targets: when these tasks move to Ascend C, an NPU language with little public code, GPT-5.2's few-shot correctness (pass@4) drops from 92% on CUDA to 14% [2]. A new domain-specific accelerator can start from exactly this cold start, with a new memory hierarchy, a new programming language and almost no expert kernels to learn from.

We study this cold start on one such target, in a live setting. In Round 1 of the NPU Model Optimization Competition at MICRO 2026 [5], we spent 12 days speeding up three decoder kernels of Gemma-4-12B [6] on the FuriosaAI RNGD, a Tensor Contraction Processor [7] programmed in furiosa-opt, a recent Rust DSL [8]. RNGD is a fitting example: its DSL is sparsely documented, and no curated knowledge of the chip or the DSL existed for prompts. The device was shared and scarce, reached only through FuriosaAI's Arena job scheduler, and the toolchain and the grader changed during the round. Existing LLM kernel optimizers start from human-written target knowledge in their prompts [3], [4] or learn across many tasks [2]; a new target has no such knowledge, and speeding up one model may give only a few tasks. JAXBench points to what must come first: on the sparsely documented Pallas DSL, curated documentation raised per-sample correctness from 5.8% to 37.3% with no change to the search [9].

Each part of our loop answers one constraint that such a target imposes. With no prompt-ready knowledge of the target, onboarding (Figure 1) builds and checks a target knowledge base: a verified summary of the DSL book, device facts measured by microbenchmarks, and compiler-derived legality rules, rechecked when the toolchain changes. With few kernels to optimize, the loop searches deeply within each: per-kernel Design Trees hold whole-kernel designs and their variants, and the head, the best accepted version of each kernel, accumulates the levers (kinds of change) that pass the acceptance test, one or several at a time. With a shared, scarce device, the loop spends device time sparingly: new designs pass cheap checks before their first device run, races stop losing variants early, and the acceptance test can stop after a few pairs. With noisy readings, a profiler ties each change to the device timeline, and an acceptance test compares a candidate with the head over repeated device runs. Roles that keep notebooks and budgets (Figure 2) carry what the loop learns across short-lived agents. In our case, the round gave three kernels and two device jobs per account (Section III).

The final kernels reach speedups of 3.75×3.75\times, 11.17×11.17\times and 19.16×19.16\times over the official baseline cycles, a 9.293 geomean that placed 7th of 79 teams on the public leaderboard (Section VI). Each takes at most 1.25×1.25\times its peak, the fewest cycles needed just to move its weights (Section III-E). Our contributions are:

• Onboarding as an explicit phase that builds and rechecks target knowledge for a new chip and DSL (Section IV).

  • A role-based loop over per-kernel Design Trees for an unfamiliar accelerator, with its checks ordered around a scarce device (Section V).

• Device-grounded judging under noise, with what our acceptance test could not do (Sections V and VIII).

• A record of what failed in a live competition (Section VII).

Two approaches failed: the compiler's static schedule did not predict small gains on the device, and the loop proposed test-input shortcuts, which we accepted at first, then banned, and exclude from all results (Section VII).

References (26)