NVIDIA's CAKE has agents author GPU IR directly, hitting 2.05x on Kimi Delta Attention kernels

CAKE: Compiler-Agent Co-Design for Frontier Kernel Evolution

Zihao Ye, Yingyi Huang, Hongyi Jin, Bohan Hou, Junru Shao, Zhongming Yu, Jinqi Chen, Meghan Cowan, Shiyi Cao, Shanli Xing, Hanfeng Chen, Vinod Grover, Tianqi Chen, Luis Ceze

cs.LG

2026-08-13

CAKE lets agents write a typed, hardware-explicit IR while the compiler turns recurring failures into verifier rules and tactics; on B200 it reaches 2.05x over official FlashKDA on Kimi Delta Attention.

What problem this solves

GPU kernel agents and GPU programming languages have advanced on separate tracks, and expert kernels get lost in the gap. Agents treat the compiler as a fixed black box: the environment returns compiler errors, pass/fail verdicts, and end-to-end timing, but never says which program decision caused a synchronization failure, a hardware-contract violation, or a pipeline stall. When a frontier workload exposes a missing capability, those signals cannot grow either.

The writing side is equally awkward. Tile-level DSLs like Triton hide warp specialization, barrier choreography, and memory-tier placement, which is exactly what separates expert kernels from merely correct ones. Low-level DSLs like CuTe expose that control but demand a layout calculus that makes agent errors likely and hard to localize.

Method

CAKE, from NVIDIA and CMU, co-designs both sides. Agents author Cake IR, a typed, hardware-explicit schedule representation:

The distinctive part is that the harness itself evolves. Recurring failures get distilled into four things: new verifier rules (an opaque runtime crash becomes a legality check), new IR primitives, cost-model calibration targets, and reusable optimization tactics. The object of evolution is the compiler environment; the coding agent and foundation model stay fixed. Changes are test-gated against a kernel corpus, with humans still guarding the merge gates.

Results

ExperimentBaselineResult
Flash-KMeans clean start (B200, 80M-token budget)tuned FlashMLCake IR median 1.144x; direct CUDA/PTX only 0.928x
Same, convergenceCake IR plateaus 3/3 runs vs 0/3; evolve time 1.89h vs 3.73h
Kimi Delta Attention prefill (six B200 BF16 shapes)official FlashKDA, black-box timing2.05x geometric mean
KDA decode (30 public API shapes)upstream FlashInfer1.14x
Alpha-MoE megakernelFlashInfer TensorRT-LLM-derived API6.204x at N=256, 4.025x at N=512
Dispatcher portfolio (GB200, 434 shapes)per-family referencesKNN build 1.418x, KNN search 2.116x, KMeans 1.803x

In the KDA experiment, FlashKDA source was never shown to the agent. Of 11 known-kernel reproductions, 10 meet or exceed the reference and one reaches 96.5%. Four kernel changes landed as upstream PRs (KDA prefill, KDA decode, TinyGEMM2, Alpha-MoE).

Why it matters

This is a clean demonstration that environment design caps agent performance: same agents, same token budget, but a compiler that returns localized diagnostics and accumulates rules turns "never converges from scratch" into "converges three out of three". The 1.144x versus 0.928x gap comes entirely from the environment, not from a stronger model.

It is most practical for new-architecture bring-up. When an attention variant like Kimi Delta Attention ships without a hand-tuned reference, the CAKE route lets agents close that gap at the DSL level, and the output can go straight into upstream PRs. Kernel-library and inference-engine teams get reusable capacity; agent-infrastructure teams get an environment-design template worth copying.

Limitations

The authors are unusually direct: most performance evidence is on B200, the timing model is calibrated only for B200 and H100 and declines to predict elsewhere; static analyses and performance models are intentionally incomplete, used only to rank and filter while GPU execution remains ground truth; compiler evolution is still human-guided at merge gates. Transfer cost to non-NVIDIA targets is unmeasured and the backend lowering would need a rebuild. Blackwell-only features (TMEM, TMA, clusters) are absent on Ampere.

One caveat worth flagging: the headline multipliers cluster on workloads with weak references (early official KDA, the megakernel MoE), while the best result across 11 mature-kernel reproductions is about 1.27x. For kernels that experts have already tuned by hand, the headroom here is visibly narrower, and the flashiest numbers are not the general expectation.

Terms

Source

What people are saying

Related papers

All paper explainers