Presents CAKE, a CANN-native system that enables AI agents to generate high-performance custom kernels for Ascend NPUs at expert level.
CANNBot-CAKE is an open-source, CANN-native agentic workflow developed by Huawei that automates the generation and optimization of high-performance custom operators for Ascend NPUs. It addresses the difficulty of writing expert-level AscendC kernels by employing a collaborative agentic system that combines adaptive multi-DSL routing, evolutionary optimization, and a shared knowledge base called CAKE Book.
Key capabilities and results include: Automated Pipeline: It transforms natural language requirements or existing baselines into deployable CANN packages through Generation (validation and repair) and Evolution (multi-round performance optimization) modes. Benchmark Performance: On 53 operators from CANN-Bench v1.1 tested on the Ascend 950PR, CAKE achieved a 100% pass rate on the standard set and 98.28% on the hidden set, with an average performance speedup of 1.334× over the baseline. * Self-Evolution: The system utilizes a Self-Evolving Agent and CAKE Book to accumulate verified engineering lessons, allowing the router and repair templates to improve across user sessions and operator types.
CANNBot-CAKE presents CAKE, a CANN-native system for generating custom kernels for Huawei Ascend NPUs using AI agents. The work positions kernel development not as a one-shot code-generation task, but as a collaborative, evolutionary process in which agent-driven stages propose, validate, and refine candidate kernels within the constraints of the CANN software stack. The stated goal is to produce kernels that are not only correct and compilable, but also high-performance and comparable in quality to expert-authored NPU kernels.
A key contribution is a system-level approach to hardware-specific code generation: grounding language-model agents in CANN APIs, Ascend execution semantics, and performance-oriented optimization loops. The central insight is that agentic workflows can bridge the gap between generic model-generated code and the low-level, vendor-specific expertise normally required for NPU kernel tuning. By combining reasoning, constraint-aware generation, and iterative refinement, CAKE aims to automate parts of the kernel-engineering process that are traditionally labor-intensive and difficult to scale.
This matters because Ascend NPUs and similar accelerators can be underutilized when developers lack deep familiarity with the underlying software stack. Custom kernels are often the primary lever for closing performance gaps between high-level framework code and optimized application workloads. CAKE is therefore significant both as a practical tool for accelerating Ascend kernel development and as a broader example of how agentic systems can be applied to performance-critical, hardware-specific programming domains.