CAKE: Compiler-Agent Co-Design for Frontier Kernel Evolution
Abstract: GPU kernel agents and GPU programming languages have advanced separately, leaving expert kernels difficult to reproduce. Agents usually treat the compiler as a fixed black box and receive only errors, correctness outcomes, and timing, while existing DSLs either hide critical scheduling decisions or expose them through difficult layout abstractions. We present CAKE, a compiler-agent co-design in which agents author CAKE IR, a typed, hardware-explicit schedule representation. CAKE exposes warp roles, memory movement, synchronization, and pipelines while supporting verification, cost modeling, and localized diagnostics. The harness itself evolves: recurring failures become verifier rules, IR primitives, model calibrations, and reusable optimization tactics. In matched implementation-hidden Flash-KMeans clean starts on B200, the best CAKE IR candidate at an 80-million-token budget runs at 1.144x the tuned FlashML baseline, compared with 0.928x for direct CUDA/PTX. Beyond this benchmark, agent-generated Kimi Delta Attention achieves a 2.05x geometric-mean speedup over official FlashKDA and passes end-to-end serving validation. Dispatcher-backed KNN and KMeans improve performance by 1.42x to 2.12x across more than 400 shapes, and four kernel changes are available as upstream PRs. CAKE targets NVIDIA GPUs from Ampere through Blackwell and separates single-shape evolution from library generalization and dispatch.
Paper Prompts
Sign up for free to create and run prompts on this paper.
Top Community Prompts
Explain it Like I'm 14
1. What is this paper about?
This paper introduces CAKE, a system that helps AI agents create fast programs for GPUs.
GPUs are powerful computer chips often used for artificial intelligence. However, writing programs that use them efficiently is difficult. A program may give the correct answer but still run too slowly. Expert GPU programmers carefully control many details, such as:
- Which parts of the work different groups of GPU workers perform
- Where data is stored
- When data is moved
- How workers communicate and wait for one another
- How several operations are combined into a single program
CAKE combines an AI coding agent with a special compiler. A compiler is software that translates a program into instructions the computer can run. The main idea is that the AI should not write completely raw GPU code. Instead, it should use a structured language that shows important hardware decisions clearly.
The paper’s title, Compiler–Agent Co-Design for Frontier Kernel Evolution, means that both the AI agent and the compiler are designed to improve together.
2. What questions does the research ask?
The researchers mainly investigate three questions:
- Can CAKE help an AI agent create faster GPU programs than writing low-level CUDA code directly?
- Can CAKE create efficient programs for new or difficult AI operations without seeing an expert’s low-level implementation?
- Can CAKE reproduce or improve programs that are already considered highly optimized?
The researchers also ask a broader question:
If the AI repeatedly makes the same kind of mistake, can the compiler learn to detect and explain that mistake better next time?
This is important because many existing AI coding systems only say things like “the program failed” or “the program was slower.” They often do not explain why.
3. How does CAKE work?
A special program format
Instead of writing ordinary CUDA or very detailed machine instructions, the AI writes a program in Cake IR.
“IR” means intermediate representation. It is a kind of middle-level language: more detailed than a simple mathematical description, but easier to manage than raw machine code.
An analogy is building with LEGO:
- A high-level language might say, “Build a house.”
- Raw GPU code might require describing every tiny movement of every LEGO piece.
- Cake IR provides specialized pieces such as walls, windows, doors, and instructions for connecting them, while still allowing the builder to choose the important structure.
Cake IR lets the agent describe:
- Warp roles: different groups of GPU workers and their jobs
- Memory regions: where data is stored
- Pipelines: several stages of work that can overlap
- Barriers: signals that tell one group to wait until another group has finished
- Data movement and calculations: how information travels and is processed
The compiler automatically fills in some difficult low-level details, such as exact addresses and hardware-specific instruction settings.
Early checking before running the program
CAKE does not immediately run every program on a GPU. First, it checks the program for possible problems, including:
- Unsafe memory use
- Incorrect synchronization
- Invalid hardware instructions
- Incompatible data formats
- Missing or incorrectly connected steps
This is similar to a spell-checker and safety inspector working before a machine is turned on.
Instead of simply returning “failed,” CAKE tries to give a more useful explanation, such as:
- Which part of the program caused the problem
- Which memory buffer or worker group was involved
- Whether the issue came from synchronization, data movement, or hardware limits
Estimating performance
CAKE also uses a cost model. This is a program that estimates how fast a proposed GPU program might be.
For example, it may predict that a candidate is limited by:
- Too much computation
- Slow memory movement
- Workers waiting too often
- Too many synchronization steps
The estimate is used to reject or rank candidates before testing them on the real GPU. Actual GPU timing is still treated as the final test.
Improving the compiler itself
A key feature of CAKE is that the compiler environment can evolve.
Suppose the AI repeatedly tries to use a hardware feature that CAKE cannot describe. The researchers can add a new command to Cake IR. Or, if many programs fail in the same way, CAKE can gain a new safety check for that failure.
In this way, failures become reusable knowledge rather than isolated problems.
4. What experiments were performed?
The researchers tested CAKE on NVIDIA GPUs, including architectures from Ampere through Blackwell. Their main clean-start comparison used a B200 GPU and a workload called Flash-KMeans.
K-means is a method for grouping data into clusters. In this experiment, the GPU had to compare many data points with many cluster centers and decide which center was closest.
The researchers compared two groups:
- An agent writing programs with Cake IR
- An agent writing programs directly with CUDA and PTX, which are lower-level GPU programming tools
Both groups used the same AI model, task description, correctness tests, and time budget. The agents were not allowed to inspect the hidden low-level implementations being used as references.
They also tested CAKE on several other operations, including:
- Kimi Delta Attention
- Gated DeltaNet
- Sparse attention
- TinyGEMM
- Mixture-of-Experts, or MoE, programs
- KNN and KMeans workloads
- Attention and matrix multiplication kernels
A kernel in this context is a small GPU program designed to perform a particular operation efficiently.
5. Main findings
CAKE performed better in the clean-start comparison
For Flash-KMeans, the best Cake IR programs reached a median speed of 1.144 times the tuned baseline.
The direct CUDA/PTX programs reached 0.928 times the baseline.
A score above 1.0 means the new program was faster than the baseline. A score below 1.0 means it was slower.
CAKE also reached its target performance in all three test runs, while the direct CUDA/PTX approach did not reach the target in any of its three runs.
The Cake IR agents also used less active development time:
| Approach | Median best performance | Reached target in runs | Active development time |
|---|---|---|---|
| Cake IR | 1.144× baseline | 3 out of 3 | 1.89 hours |
| Direct CUDA/PTX | 0.928× baseline | 0 out of 3 | 3.73 hours |
This suggests that giving the AI a structured way to describe GPU behavior can make its search more successful.
CAKE created fast new kernels
For Kimi Delta Attention, a difficult operation used in newer AI models, the generated program achieved a 2.05× geometric-mean speedup over the official FlashKDA implementation across six tested shapes.
A geometric mean is a way of averaging speedups that prevents one unusually large result from dominating the overall average.
The generated program was also tested in an entire serving system, rather than only as an isolated kernel. This is important because a program can be fast by itself but fail to improve a complete AI application.
CAKE improved several production programs
The paper reports improvements in multiple practical systems:
- TinyGEMM became about 18–23% faster across 35 important shapes.
- A Blackwell version of an MoE program showed large end-to-end improvements.
- Known-kernel tests met or exceeded the listed reference performance in 10 of 11 comparisons.
- KNN and KMeans program families improved across hundreds of input shapes, with speedups between about 1.42× and 2.12×.
The paper also reports that four changes were prepared as contributions to public software projects. This suggests that the results were not limited to laboratory demonstrations.
6. Why are these findings important?
GPU programming is powerful but complicated. An AI agent writing raw CUDA code may make mistakes that are difficult to understand. For example, a program might:
- Make one group of workers wait forever
- Use memory incorrectly
- Choose an inefficient way to move data
- Use a hardware feature in an unsupported way
CAKE makes important decisions visible and gives the agent more detailed feedback. This is similar to the difference between receiving the message “your science experiment failed” and receiving “the temperature was too high during step three, causing the chemical reaction to stop.”
Better explanations allow the AI to improve more quickly.
The results also show that a compiler can be more than a translator. It can act as a guide, safety checker, performance adviser, and source of reusable knowledge for the AI.
7. From one input size to many
A program that is extremely fast for one input size may not be fast for another. Real software libraries must handle many different sizes and shapes.
CAKE treats this as a separate problem. It can create several specialized versions of a kernel and use a dispatcher to choose the best version for each input.
A dispatcher is like a traffic controller:
- Small inputs go to one program.
- Large inputs go to another.
- Unusual inputs use a safe fallback program.
The paper reports that this approach improved KNN and KMeans performance across more than 400 shapes. The researchers also checked that the programs produced correct results, including perfect recall for the KNN tests.
8. Limitations
The paper does not claim that CAKE solves every GPU programming problem.
Important limitations include:
- Most performance tests were performed on B200 GPUs.
- The timing model was calibrated mainly for B200 and H100 GPUs.
- CAKE currently targets NVIDIA GPUs, not all kinds of GPUs.
- Its static safety checks and performance predictions are incomplete.
- Actual GPU execution is still needed to confirm correctness and speed.
- Human researchers still review and approve important compiler changes.
- Results for one carefully selected input shape may not represent performance across all possible shapes.
Therefore, the results are promising, but broader testing would be needed before concluding that CAKE is always better than direct GPU programming.
9. Overall impact
The paper presents CAKE as a new way for AI agents and compilers to work together.
Its main lesson is:
AI agents are more effective at writing fast GPU programs when they receive structured hardware information and detailed explanations of their mistakes.
If this approach continues to improve, it could make highly optimized GPU software easier and faster to create. This may help developers build AI systems that use less computing power, respond more quickly, and support newer models.
In simple terms, CAKE gives an AI programmer better building materials, a clearer instruction manual, and a teacher who explains mistakes. It does not replace human experts completely, but it could help AI agents reach expert-level GPU performance more reliably.
Knowledge Gaps
The paper leaves the following knowledge gaps, limitations, and open questions unresolved:
- Limited statistical power: The clean-start comparison uses only three runs per representation, making the reported differences vulnerable to run-to-run variation and insufficient to establish robust statistical significance.
- Narrow clean-start workload: The controlled Cake-versus-CUDA/PTX experiment evaluates one fixed Flash-KMeans shape and only the
assignkernel; it does not establish whether the advantage persists across operators, shapes, numerical formats, or workloads with different bottlenecks. - No complete ablation of Cake’s contributions: The paper does not isolate the effects of the typed IR, localized verifier feedback, cost model, compiler evolution, reusable tactics, or dispatcher design. Consequently, the relative contribution of each component remains unclear.
- Unclear comparison with alternative representations: Cake is compared directly with CUDA/PTX in the main clean-start experiment, but not under an equally controlled protocol against Triton, CuTe DSL, TileLang, Gluon, or other hardware-aware representations.
- Agent-specific results: All reported agent tasks use GPT-5.6-sol with a fixed scaffold and reasoning configuration. It remains unknown whether Cake’s benefits transfer to other foundation models, open-weight models, weaker agents, or agents trained specifically for GPU programming.
- Unmeasured human-engineering effort: The paper does not quantify the human time, expertise, and infrastructure required to design the initial corpus, define workload contracts, implement compiler changes, review agent-generated modifications, and enforce merge gates.
- Incomplete causal account of compiler evolution: Although recurring failures are said to produce new IR primitives, verifier rules, and cost-model updates, the paper does not report how many improvements arose from each mechanism, how often proposed changes were rejected, or how much performance gain was attributable to compiler evolution rather than ordinary kernel search.
- Potential selection bias in the kernel corpus: The validated corpus was assembled from production kernels and selected families, but the paper does not specify systematic inclusion criteria or report failures on workloads that were difficult to express in Cake IR.
- Unresolved expressiveness limits: The paper does not characterize which NVIDIA programming patterns, instructions, synchronization idioms, layouts, or communication mechanisms remain inexpressible or require fallback strategies in Cake IR.
- Missing completeness guarantees for verification: The static analyses are explicitly incomplete, but the paper does not measure false-negative rates, false-positive rates, or the classes of unsafe schedules that can pass the pre-compilation checks.
- Insufficient diagnosis of numerical robustness: Correctness is evaluated against workload-specific references, but the paper does not systematically test numerical stability across adversarial inputs, extreme values, accumulation orders, long sequences, underflow/overflow cases, or all supported precision combinations.
- Limited correctness coverage for generated programs: The number of GPU correctness cases is reported, but the coverage of input distributions, boundary conditions, randomized tests, and semantic corner cases for each kernel family is not detailed enough to assess residual correctness risk.
- Cost-model accuracy is not quantified: The paper describes bottleneck attribution and performance guidance but does not report prediction error, ranking correlation, calibration drift, or the frequency with which the model incorrectly filters out high-performing candidates.
- Architecture transfer remains largely unvalidated: Cake structurally targets Ampere through Blackwell, but most performance evidence is from B200, with calibration only for B200 and H100. Performance portability across Ampere, Hopper, GB200/GB300, and other supported devices is therefore not established.
- No evidence for non-NVIDIA portability: The paper acknowledges that non-NVIDIA targets are unmeasured; it remains unknown whether Cake’s role, barrier, pipeline, and memory abstractions can support AMD, Intel, or other GPU architectures without a fundamentally different IR design.
- Incomplete cross-architecture compiler evaluation: The paper does not measure how much target-specific lowering, legality analysis, and cost-model engineering is required when moving between NVIDIA generations or whether schedules that are portable structurally remain competitive after lowering.
- Unclear end-to-end serving impact: End-to-end serving validation is reported for selected models, but the paper does not provide systematic measurements of throughput, latency distributions, memory use, energy, and tail latency across workloads, batch sizes, concurrency levels, and distributed configurations.
- Kernel-level gains may not translate to application-level gains: Several results distinguish API-level speedups from GPU-span speedups, but the paper does not consistently quantify launch overheads, scheduling effects, host-side costs, and interaction with other operators across the full application stack.
- Generalization is evaluated on selected families only: Dispatcher-backed KNN and KMeans results do not establish whether the proposed tuned-shape-to-library procedure generalizes to attention, MoE, GEMM, normalization, or highly dynamic workloads.
- Unclear cost of dispatch portfolios: The paper reports dispatcher-inclusive speedups but does not quantify compilation time, binary size, code-cache usage, guard evaluation overhead, maintenance burden, or memory consumption as the number of specialized routes grows.
- Unresolved portfolio scalability: It remains unknown how many shape-specific schedules are needed before dispatch complexity, compilation cost, and validation effort outweigh performance gains.
- Limited distribution-shift testing: Generalization uses deterministic unseen shards from the declared shape domain, but robustness to real production distributions, workload drift, unseen sequence-length regimes, and changes in model configuration is not established.
- Baseline comparability is uneven: Results use different hosts, baselines, shape distributions, and protocols across experiments, limiting direct comparison among reported speedups and preventing a unified estimate of Cake’s overall advantage.
- Reference quality and tuning are not fully characterized: The paper compares against tuned or official implementations but does not consistently report their tuning budgets, compiler versions, configuration choices, or whether all baselines received equivalent optimization effort.
- No evaluation of search efficiency beyond token counts: Token consumption and active evolution time are reported for one experiment, but the paper does not analyze GPU-hours, compilation time, failed-candidate cost, energy consumption, or total infrastructure cost.
- Failure modes are not systematically reported: The paper emphasizes successful evolution but does not provide a taxonomy and frequency distribution of failed searches, irreparable verifier conflicts, compiler bugs, incorrect outputs, performance regressions, or unsupported schedules.
- Human merge gates remain a scalability bottleneck: Compiler evolution is still human-guided, yet the paper does not determine whether review and validation requirements can scale as the IR, verifier, cost model, and kernel corpus continually expand.
- Risk of overfitting the harness to its corpus: Corpus-gated compiler changes may improve known workloads while introducing blind spots or regressions on unseen kernel structures; out-of-corpus regression testing is not reported.
- Long-term stability is unexamined: The paper does not study whether repeatedly evolving the IR and harness causes abstraction fragmentation, backward-compatibility problems, verifier brittleness, or accumulation of architecture-specific special cases.
- Reproducibility is incomplete: Although artifacts and upstream PRs are referenced, the paper does not provide enough detail about prompts, agent trajectories, candidate populations, random seeds, compiler revisions, hardware environments, and exact measurement scripts to independently reproduce every result.
- Readability and maintainability are unresolved: Cake IR is shorter than audited device cores in the reported comparisons, but the paper does not evaluate human comprehensibility, debugging time, editability, or maintainability relative to CUDA, PTX, Triton, or CuTe DSL.
- Security and trust implications are unexplored: The paper does not address whether agent-generated compiler changes or kernels can introduce covert correctness, memory-safety, resource-exhaustion, or supply-chain vulnerabilities despite passing the stated validation gates.
- Interaction with dynamic and irregular workloads is unclear: The demonstrated corpus emphasizes known operator families and declared shape domains; support for data-dependent control flow, dynamic sparsity, irregular memory access, and workloads whose schedule depends on runtime values remains uncertain.
Practical Applications
Immediate Applications
The paper’s results support near-term deployment primarily in GPU software engineering, AI infrastructure, and performance optimization. These applications are feasible now when organizations use supported NVIDIA GPUs, maintain reliable correctness oracles, and retain human review for compiler and production changes.
- Automated optimization of production GPU kernels (AI infrastructure, software engineering)
- Use Cake to evolve kernels in libraries such as FlashInfer, CUTLASS, TensorRT-LLM, or related inference stacks. Agents can propose Cake IR schedules, apply static safety checks, benchmark surviving candidates, and submit validated CUDA changes upstream.
- Potential products include an agent-assisted kernel optimization service, a CI job for GPU-kernel performance regression testing, or a developer tool that recommends warp roles, pipeline depth, synchronization structure, and memory placement.
- This is supported directly by the reported KDA, TinyGEMM, and Alpha-MoE changes, including four upstream-ready contributions.
- Dependencies: NVIDIA GPU support from Ampere through Blackwell, a representative benchmark suite, a trusted numerical oracle, target-specific performance calibration, and human approval before merging generated compiler or kernel changes.
- Performance improvement for large-language-model inference and serving (AI platforms, cloud computing)
- Integrate Cake-generated kernels into serving systems such as SGLang or FlashInfer for attention, recurrent-state attention, decode, MoE, and small-batch GEMM workloads.
- Likely workflows include replacing a reference kernel with a Cake-generated implementation, validating bitwise or tolerance-based correctness, and measuring throughput and latency under realistic batch sizes and concurrency.
- The paper reports end-to-end serving validation for Kimi Delta Attention and throughput improvements for GPT-OSS workloads, making this more than a purely synthetic kernel use case.
- Dependencies: The reported gains are hardware- and shape-dependent; deployment requires testing actual model architectures, sequence lengths, concurrency levels, tensor-parallel configurations, and fallback behavior.
- Automated optimization of KNN and KMeans workloads (analytics, recommendation systems, computer vision, scientific computing)
- Use Cake’s dispatcher-backed portfolios to route different KNN or KMeans shapes to specialized GPU schedules.
- Practical uses include semantic search, vector databases, clustering of video or multimodal tokens, nearest-neighbor retrieval, and preprocessing for machine-learning pipelines.
- The paper reports improvements across more than 400 shapes, including dispatcher-inclusive geometric-mean speedups of approximately for KNN build, for KNN search, and for KMeans.
- Dependencies: These figures were measured on specific NVIDIA systems and benchmark distributions. Production users must validate recall, numerical tolerances, memory consumption, dispatch overhead, and performance on their own data distributions.
- GPU-kernel correctness and safety gates in continuous integration (software engineering, DevOps)
- Add Cake’s pre-compilation checks to GPU development workflows to detect synchronization hazards, illegal memory use, invalid resource declarations, unsupported instructions, producer–consumer mismatches, and schedule inconsistencies before expensive execution.
- A practical CI workflow could be:
- 1. construct or mutate a Cake IR candidate;
- 2. run verifier and hardware-conformance checks;
- 3. execute numerical tests;
- 4. benchmark only validated candidates;
- 5. reject performance regressions or correctness failures.
- This can reduce debugging time relative to workflows that expose only compiler errors, crashes, or a single pass/fail result.
- Dependencies: Static analyses are incomplete and GPU execution remains the final authority. Sanitizers, numerical tests, and on-device profiling are still required.
- Performance-diagnostic tooling for GPU programmers (developer tools, HPC)
- Use the harness’s localized diagnostics and cost-model reports to explain whether a candidate is limited by synchronization, memory movement, pipeline structure, resource usage, or computation.
- This could become an IDE or command-line tool that maps a performance issue to a particular role, barrier, buffer, or pipeline stage rather than merely reporting kernel latency.
- Dependencies: The cost model must be calibrated for the target architecture. The paper states that performance predictions are strongest on B200 and H100 and should not be treated as ground truth elsewhere.
- Porting and modernization of kernels across NVIDIA GPU generations (HPC, scientific computing, enterprise AI)
- Preserve the high-level schedule structure of an existing Hopper or Ampere kernel while using target-specific lowering for newer Blackwell instructions and resources.
- This is particularly useful for attention, MoE, quantization, and fused kernels whose synchronization and memory behavior are difficult to rewrite manually. The Alpha-MoE rewrite from Hopper to Blackwell illustrates this workflow.
- Dependencies: Portability is structural rather than universal. Architecture-specific instruction legality, resource limits, lowering support, and performance calibration must be implemented and tested for each target.
- Research and teaching infrastructure for GPU programming (academia, education)
- Use Cake IR as an intermediate teaching layer between high-level tensor DSLs and raw CUDA/PTX. Students can explicitly study warp specialization, barriers, memory tiers, and pipeline stages without manually calculating every low-level address or descriptor encoding.
- Research groups can use the harness to create reproducible assignments or benchmarks in which generated schedules are evaluated for correctness, safety, and performance.
- Dependencies: Educational use requires stable documentation, open artifacts, accessible hardware, and carefully designed tasks that distinguish conceptual scheduling ability from model-specific prompt engineering.
- Auditable benchmarking of AI-generated systems code (academia, industry governance)
- Adopt Cake-style workload contracts that fix input shapes, correctness oracles, tolerances, hardware, permitted references, and dispatch domains. This enables more reproducible comparisons between kernel-generation systems.
- The retained candidate histories and localized failure reports can provide an audit trail for why a generated implementation was accepted.
- Dependencies: Benchmark claims remain sensitive to hardware, baseline selection, cache state, compiler versions, token budgets, and workload distributions. Independent reruns are necessary.
Long-Term Applications
The longer-term opportunities depend on broader compiler support, more complete validation, better cross-architecture models, and evidence that generated kernel portfolios remain reliable under changing workloads.
- Self-improving compiler toolchains for emerging GPU architectures (compiler research, semiconductor software)
- Build compiler systems in which recurring agent failures automatically motivate new IR primitives, verifier rules, lowering patterns, and cost-model calibration tasks.
- A future toolchain could identify that a new hardware instruction or synchronization idiom is repeatedly needed, propose an abstraction, test it against a corpus, and expose it to subsequent optimization agents.
- Dependencies: This requires robust corpus-based regression testing, strict human or organizational merge gates, secure code review, and mechanisms preventing an agent from weakening safety checks to obtain better benchmark scores.
- General-purpose kernel portfolio synthesis for production libraries (AI infrastructure, HPC, cloud services)
- Extend the paper’s dispatcher stage into an automated system that creates a portfolio of specialized schedules, learns shape predicates, and selects kernels dynamically for arbitrary batch sizes, sequence lengths, sparsity patterns, and data types.
- Potential products include an autotuned GPU operator library or a runtime that selects among attention, GEMM, KNN, and MoE schedules based on workload characteristics.
- Dependencies: Generalization cannot be inferred from a single optimized shape. It requires held-out shapes, boundary and tail testing, explicit fallbacks, dispatch-overhead measurement, and controls against evaluation leakage.
- Cross-vendor and heterogeneous accelerator support (hardware, cloud computing, edge computing)
- Adapt the Cake approach to AMD GPUs, Intel accelerators, custom AI chips, or heterogeneous systems by retaining the role–barrier–pipeline abstraction while implementing new backends and legality models.
- This could help organizations maintain one agent-facing scheduling workflow across multiple accelerator vendors.
- Dependencies: The current evidence is limited to NVIDIA GPUs. Each new target requires backend lowering, instruction and memory models, architecture-specific verification, and independently calibrated performance models; portability cannot be assumed.
- Automated optimization of full model-execution graphs (AI compilers, robotics, scientific workloads)
- Move beyond individual kernels toward agent-generated fused graph programs that combine data movement, communication, routing, normalization, attention, and reduction.
- Such systems could reduce kernel-launch overhead and intermediate memory traffic in LLM serving, robotics perception pipelines, simulation, and large-scale scientific applications. The Alpha-MoE megakernel provides an early example of this direction.
- Dependencies: Full-graph optimization introduces more difficult memory-lifetime, synchronization, fault-isolation, and scheduling problems. It also requires reliable graph-level correctness tests and safeguards against excessive fusion that harms occupancy or flexibility.
- Energy- and cost-aware GPU optimization (cloud operations, sustainability, data centers)
- Extend Cake’s cost model beyond latency to optimize energy per query, total GPU-hours, thermal limits, memory consumption, or cloud serving cost.
- A serving platform could select a slightly slower schedule if it substantially reduces power or if it improves throughput per dollar under a particular utilization level.
- Dependencies: This requires hardware power telemetry, stable energy models, workload-level accounting, and multi-objective optimization. The paper evaluates primarily GPU timing, not energy, carbon impact, or operational cost.
- Autonomous maintenance of specialized scientific and engineering kernels (HPC, physics, chemistry, climate modeling)
- Apply the compiler–agent co-design loop to domain-specific kernels such as sparse linear algebra, particle methods, stencil computations, molecular simulation, and numerical solvers.
- Agents could preserve domain-specific numerical contracts while adapting schedules to new GPU generations or problem sizes.
- Dependencies: Scientific applications often require strict reproducibility, precision guarantees, and complex validation against physical invariants. The existing corpus is concentrated on machine-learning and retrieval workloads, so domain transfer requires substantial new testing.
- Safety-certified or formally constrained agentic code generation (policy, regulated computing, critical infrastructure)
- Use typed schedules, explicit resource declarations, and localized verification as a foundation for stronger guarantees about synchronization, memory safety, and hardware conformance in generated accelerator code.
- This could eventually support certification workflows for medical imaging, autonomous systems, aerospace simulation, or public-sector high-performance computing.
- Dependencies: The current verifier is not a formal proof system and is explicitly incomplete. Certification would require soundness proofs, formally specified hardware contracts, traceable compiler transformations, supply-chain security, and independent verification.
- Adaptive edge and robotics inference systems (robotics, autonomous vehicles, edge AI)
- Generate and select GPU kernels dynamically for changing sensor resolutions, camera workloads, batch sizes, and latency or power budgets in robots and embedded systems.
- Specialized portfolios could optimize perception, tracking, nearest-neighbor search, attention, and multimodal fusion under real-time constraints.
- Dependencies: Edge hardware may differ from the evaluated data-center GPUs, and dynamic dispatch must satisfy hard deadlines, thermal constraints, and safety requirements. Offline validation and conservative fallbacks would be essential.
- Natural-language interfaces for expert hardware scheduling (education, research, software development)
- A developer could describe goals such as “prioritize low latency for small-batch decode while preserving FP16 accuracy,” and an agent could translate that intent into explicit Cake IR schedules, diagnostics, and benchmark experiments.
- This would make advanced GPU optimization more accessible without hiding the hardware decisions needed for expert performance.
- Dependencies: Natural-language objectives must be converted into measurable workload contracts. Human experts will still be needed to resolve ambiguous numerical requirements, assess trade-offs, and review generated low-level code.
- Public policy and procurement standards for AI infrastructure efficiency (policy, government, sustainability)
- Policymakers and large infrastructure buyers could require reproducible kernel benchmarks, energy-per-inference reporting, correctness evidence, and cross-shape generalization tests when evaluating AI accelerator software.
- Cake’s separation between single-shape optimization and dispatcher-backed generalization offers a useful template for distinguishing isolated benchmark wins from library-level benefits.
- Dependencies: Standards would need vendor-neutral metrics, disclosure of hardware and compiler versions, independent audit procedures, and safeguards against benchmarks that overfit a narrow shape distribution.
Glossary
- Asynchrony: Execution in which operations proceed independently and may overlap rather than occurring in a strictly sequential order. “Gluon \cite{gluon2026} sits between the two, reusing Triton's compiler stack while exposing lower-level control over layouts, memory movement, and asynchrony.”
- Atomic contention: Competition among parallel threads or warps to update the same memory location atomically. “centroid_update is bandwidth- and atomic-contention-sensitive.”
- Backend lowering: The compiler process of translating a higher-level representation into target-specific lower-level instructions or code. “Variants that land below their reference generally reflect compiler-integration maturity rather than a different algorithmic target: where a feature a kernel wants is still being integrated into the compiler and code generator, the submitted artifact uses the closest supported strategy.”
- Barrier choreography: The deliberate coordination of synchronization barriers among parallel execution units. “Tile-level DSLs hide the warp specialization, barrier choreography, and memory-tier placement that separate expert kernels from merely correct ones;”
- Bitwise correctness: Exact agreement between computed outputs and reference outputs at the level of individual bits. “It is bitwise correct on its validation contract and was verified in end-to-end Kimi-K3 serving under SGLang.”
- Black-box performance baseline: A reference implementation whose performance can be measured without exposing its internal implementation. “An external implementation may still be executed through the benchmark harness as a black-box performance baseline; its internals remain unavailable to the agent.”
- Calibration target: A measured or specified objective used to adjust a model so that its predictions better match observed behavior. “a systematic misprediction becomes a calibration target.”
- Cost model: A predictive model that estimates the computational or execution cost of a program candidate. “A calibrated cost model estimates candidate performance and returns high-level bottleneck attribution and optimization guidance.”
- Cross-role handoff: The transfer of data or synchronization responsibility between distinct groups of parallel workers. “every cross-role handoff is visible rather than an implicit convention.”
- Dataflow: The movement and dependency relationships of data through operations in a program. “Before compilation, the harness checks the typed schedule for broad classes of synchronization, memory-safety, data-flow, resource, instruction, and data representation violations.”
- Dispatcher-backed: Implemented with a runtime dispatcher that selects among specialized implementations according to input characteristics. “Dispatcher-backed KNN and KMeans families improve performance by -- across more than 400 shapes,”
- Domain-specific language (DSL): A programming language designed for a particular application domain or class of computations. “Existing DSLs fall into two camps, both awkward for agent-driven kernel development.”
- Epilogue: The final computation or data-processing stage appended to a main matrix or tensor operation. “assign is a compute-bound BF16 GEMM-and-reduction kernel, while centroid_update is bandwidth- and atomic-contention-sensitive.”
- Fallback path: A general or alternative implementation used when no specialized implementation is applicable. “Before reporting an aggregate, validation covers representative and held-out inputs, boundary and tail cases, overlapping or missing guards, and the fallback path.”
- Fence proxy: A synchronization mechanism that orders or makes visible operations across a particular memory or execution-proxy boundary. “lm.fence_proxy()”
- Geometric mean: The multiplicative average of a set of ratios, commonly used to aggregate speedups across workloads. “A FlashKDA-compatible prefill covers fixed, packed-variable, and tail inputs and reaches a geometric-mean speedup over that baseline across six B200 BF16 shapes.”
- Hardware conformance: Compliance with the resource, instruction, and behavioral constraints of a target processor. “Hardware conformance & pre-compile gate & Enforce supported resource, instruction, and architecture contracts”
- Intermediate representation (IR): A structured compiler-level representation of a program between source code and generated machine code. “Agents author Cake IR, a typed, hardware-explicit schedule representation that gives fine-grained control without a layout algebra”
- Instruction admission: The target-specific decision about whether a particular instruction form is permitted under hardware and program constraints. “the same schedule language targets NVIDIA GPUs from Ampere through Blackwell, so a role--barrier--pipeline schedule is portable in structure while instruction admission and lowering remain target-specific.”
- Layout algebra: A formal system for describing and manipulating how data is arranged across memory and parallel execution units. “Low-level DSLs such as CuTe DSL \cite{cutedsl2025} expose hardware control but demand domain-specific expertise like layout algebra”
- Memory coalescing: Combining compatible memory accesses from parallel threads into efficient hardware transactions. “The compiler then checks that producer and consumer representations are compatible with the target hardware”
- Megakernel: A single GPU kernel that fuses multiple computational stages that might otherwise be launched separately. “It fuses routed gather, two projections, activation, requantization, and route-weighted output accumulation into one device program.”
- Memory-tier placement: Assigning data to an appropriate level of a hierarchical memory system, such as registers, shared memory, or global memory. “Tile-level DSLs hide the warp specialization, barrier choreography, and memory-tier placement that separate expert kernels from merely correct ones;”
- NVIDIA Tensor Memory (TMEM): A specialized on-chip memory resource used to store tensor data or accumulators on supported NVIDIA GPUs. “tmem_acc = lm.tmem(cols=0, width=128, shape=(128,128), dtype=lm.f32)”
- Occupancy: The proportion of a GPU’s available parallel execution capacity occupied by active warps or thread blocks. “Expert kernel programmers work differently. They keep a compact model of the workload, reason over explicit hardware resources, and carry reusable rules between kernels.”
- Pipeline staging: Organizing repeated computation and data movement into overlapping stages, often using multiple buffers. “smem_q = pool.view(offset=0, shape=(128,128), dtype=lm.bf16, stage=3)”
- Quantization: Representing numerical values with reduced precision to lower memory use or accelerate computation. “The validated corpus covers dozens of kernel families---% attention and linear attention, dense, grouped, and quantized GEMM”
- Requantization: Converting an intermediate result back into a lower-precision or quantized representation. “It fuses routed gather, two projections, activation, requantization, and route-weighted output accumulation into one device program.”
- Sanitizer: A program-analysis or runtime tool that detects classes of errors such as invalid memory accesses or synchronization violations. “Structured analysis and performance modeling operate on Cake IR, while conventional sanitizer and profiler feedback comes from the generated code.”
- Schedule semantics: The structural and behavioral meaning of the operations, dependencies, and synchronization specified by an execution schedule. “Schedule semantics & pre-compile gate & Check structural invariants of the declared schedule”
- Shape specialization: Optimizing an implementation for particular tensor dimensions or input sizes. “An exact shape gives the inner loop a clean denominator and permits aggressive specialization.”
- Static analysis: Program analysis performed without executing the program. “Static analyses and performance models remain intentionally incomplete---they rank and filter during evolution while GPU execution stays ground truth”
- Tensor core: A specialized GPU execution unit designed for high-throughput matrix or tensor operations. “The two have different profiles---assign is a compute-bound BF16 GEMM-and-reduction kernel, while centroid_update is bandwidth- and atomic-contention-sensitive.”
- Tile abstraction: A programming abstraction that represents computation and data in rectangular blocks or tiles rather than individual elements. “High- and mid-level tile DSLs---Triton \cite{tillet2019triton}, Helion \cite{helion2026}, TileLang \cite{ye2025tilelang}, cuTile \cite{cutile2026}---hide hardware behind tile abstractions”
- Warp specialization: Assigning different groups of GPU warps distinct roles, such as loading data, computing, or synchronizing. “It can start from a high-level description or a Triton implementation and let agents choose warp specialization, layout, and pipeline structure in Cake IR”
- Workload contract: A fixed specification defining the inputs, correctness requirements, hardware, and evaluation conditions for an optimization task. “The workload contract fixes the shapes, oracle, tolerances, hardware, and permitted references”

