AI Agents Autonomously Optimize Ascend Kernels: Exploring RSI Path
Shenzhen RiverLoop Academy and Huawei GTS AI team built AscendGYM, a benchmark where AI agents autonomously optimize Ascend NPU kernels using real workloads and hardware feedback, introducing the STS metric to balance performance gains against optimization cost; experiments show harness choice significantly impacts results, and Anthropic's Jack Clark highlights its potential for China's recursive self-improvement in AI infrastructure.
Reading font

Background: Real-World Compute Efficiency Challenge
Shenzhen RiverLoop Academy and Huawei GTS AI team faced a challenge: how to efficiently conduct vertical-domain model post-training and provide production-grade inference services under limited domestic compute resources. They turned to the underlying compute software, exploring whether AI agents could autonomously analyze performance bottlenecks, modify Ascend kernel code, and continuously optimize via real hardware feedback.
AscendGYM: Making Autonomous Kernel Optimization an Executable, Verifiable Engineering Task
1. Real Workload-Driven Kernel Optimization Tasks
AscendGYM initially includes 48 kernel optimization tasks across three difficulty batches. The first public evaluation covers Batch 1's 17 tasks. Tasks are derived from real large-model training and inference loads: the team used profiling data from MindSpeed-LLM and vLLM-Ascend to identify bottleneck kernels, then extracted existing implementations from the CANN operator library and related open-source projects. Each task retains kernel source code, input shapes, data types, target model, and execution stage, aligning optimization targets with actual compute loads. For example, in Qwen3-0.6B inference, the AddRMSNorm operator is called 56 times per forward pass during prefill, accounting for 8.77% of total compute time. This design is extensible to new models, scenarios, and Ascend deployment forms.
2. AscendForge: Real Hardware Execution and Feedback Loop
AscendForge is an execution sandbox for Ascend NPUs. It compiles candidate code, runs correctness checks, measures performance, and returns compilation logs, numerical verification results, and performance data to the agent. This creates a closed loop: performance bottleneck analysis → agent modifies kernel → AscendForge compiles and executes → correctness verification → NPU performance measurement → feedback to agent for further optimization.
3. STS: Measuring Both Optimization Gain and Resource Cost
Traditional kernel benchmarks focus on final speedup. AscendGYM introduces Speedup–Token Score (STS), combining final performance gain with token budget consumed during optimization, penalizing improvements achieved late. Cost-to-Gain (CTG) measures token consumption for additional 1%, 5%, 10% speedups. The evaluation also records geometric mean speedup, task pass rate, token consumption, model interaction rounds, and wall-clock time. Two evaluation modes are supported: fixed harness for comparing model optimization capabilities, and model combined with agent harnesses (Claude Code, Codex, OpenCode) to assess full agent system engineering performance.
First-Round Experiments: Model Capability and Harness Engineering Both Matter
Experiments on Ascend 910C compared Claude Opus 5, GPT-5.6, GLM-5.3, Qwen series, DeepSeek-V4-Flash, and various harness combinations. Three key findings:
Current autonomous kernel optimization capability has large room for improvement. About 70% of model-harness combinations achieved geometric mean speedup below 1.2x.
Harness choice significantly impacts final optimization results. For GPT-5.6, pairing with Codex yielded ~1.69x geometric mean speedup, while pairing with Claude Code gave ~1.05x, despite both passing all 17 tasks' correctness verification. This shows search strategy, tool use, feedback utilization, and experience management critically affect outcomes.
Agents can achieve significant optimization on some kernels, but gains are uneven. The best observed speedup on fused_gdn_gating was ~3.29x, yet median speedup across 13 of 17 tasks remained below 1.1x. Token consumption, interaction rounds, and wall-clock time do not always correlate; STS and related metrics aim to capture this trade-off.
Why Jack Clark Links AscendGYM to China's RSI Path
Anthropic co-founder Jack Clark featured AscendGYM as the lead topic in Import AI #482 (Nov 23), stating "AscendGYM will help China do its own form of RSI" (Recursive Self-Improvement). He previously covered MultiKernelBench (Import AI #423, Aug 2025), which compared AI kernel generation across CUDA, AscendC, and TPU Pallas, finding models performed far better on CUDA (e.g., Claude Sonnet 4: 92.3% compilation accuracy on CUDA vs 5.3% on AscendC). AscendGYM advances the question: can AI not only generate kernels for different hardware but also autonomously optimize existing implementations under real hardware feedback to continuously improve compute efficiency?
RSI's core idea is that AI systems participate in improving their own capabilities and R&D processes, creating a continuous feedback loop. For AI systems, the software infrastructure for training and inference is also a key improvement target. If AI agents can autonomously optimize kernels, compilers, and runtimes, they can increase effective compute utilization, lower training/inference costs, enable more experiments and faster model iterations, leading to stronger AI that further enhances autonomous optimization capability. The potential path: AI autonomously optimizes compute software → improves effective compute efficiency → supports more AI training and inference → accelerates model capability iteration → stronger AI further improves autonomous optimization. Clark also noted such software could become a key component for China to rapidly improve its domestic compute base efficiency, narrowing the performance gap with Western alternatives. AscendGYM currently validates one executable, measurable engineering step in this RSI path, not full recursive self-improvement.
From Benchmark to Broader Ascend Infra Optimization
Future directions: (1) continuously expand task and input configuration coverage across more model architectures, execution stages, and complex operators; (2) improve agent optimization capability via stronger base models, better harness search strategies, feedback mechanisms, and experience accumulation; (3) translate operator-level optimization into real system-level gains, verifying impact on training throughput, inference token throughput, MFU, and cost per token across different Ascend hardware generations (e.g., A2/A3) and production loads. The first public evaluation used Ascend 910C; extension to other platforms requires hardware adaptation and empirical validation.
Conclusion: Let AI Optimize the Compute Foundation That Runs AI
From real business compute efficiency challenges to agent-driven Ascend kernel optimization, to Jack Clark's feature in Import AI, AscendGYM brings a concrete engineering exploration into international frontier AI research discussions. Its value lies not only in establishing an Ascend kernel optimization benchmark, but in exploring how AI agents can continuously improve the underlying compute software that runs AI, and codifying this capability into a reusable, verifiable, extensible engineering system. For the domestic compute ecosystem, this means future opportunities to use AI to continuously improve low-level software efficiency, enabling the same hardware to support more model training, faster capability iteration, and larger-scale intelligent services. When AI begins to participate in optimizing the compute infrastructure that runs AI, compute efficiency gains can become an important component of AI's self-improvement.
Related Resources
Technical report: https://arxiv.org/abs/2611.17621 Paper code: https://github.com/SLAI-AITP/AscendGYM Online leaderboard:
https://slai-aitp.github.io/AscendGYM/
For questions about attribution, corrections or content rights, please contactand we will review it promptly.