AscendOptimizer: Episodic Agent for Ascend NPU Operator Optimization
Organizations: School of Computer Science and Technology, East China Normal University · School of Computer Science and Technology, Tongji University · Shanghai University of International Business and Economics · Key Lab of Mathematics and Engineering Applications (MoE), East China Normal University ·
Abstract
Optimizing AscendC (Ascend C) operators for Ascend NPUs is difficult for two reasons. First, unlike CUDA, the ecosystem offers few public kernels to learn from. Second, performance depends on a coupled two-part implementation: a host-side tiling program that controls data movement and a kernel program that schedules and pipelines computation. We present AscendOptimizer, an episodic agent that builds missing optimization knowledge from execution itself. For kernel optimization, AscendOptimizer rewinds strong implementations by removing optimizations in a controlled way, then keeps the changes whose removal measurably hurts performance as reusable experience for later rewriting. For host-side optimization, it runs profiling-in-the-loop evolutionary search to find valid, fast tiling and data-movement configurations directly from hardware feedback. This combination lets the agent improve kernel structure and host-side scheduling together. On a benchmark of 101 real AscendC operators, AscendOptimizer achieves a 1.21x geometric-mean speedup over the open-source baseline, and 53.47% of operators run faster than their references. Given a same budget of evaluations per operator, AscendOptimizer consistently outperforms Best-of-N sampling and OpenEvolve in terms of geometric mean speedup, fast_p tail speedup ratios, and overall optimization progress across varying budgets.
Figures & tables
| Model | CUDA (Pass@1) | AscendC (Pass@1) |
|---|---|---|
| DeepSeek-R1 | ||
| Claude-Sonnet-4 | ||
| Qwen3-235B (think) |
| Variant | Enabled components | Performance | ||||||
|---|---|---|---|---|---|---|---|---|
| Rewrite | Experience | Tiling | GM | |||||
| Stage I only | ✓ | ✓ | ✗ | 1.16 | 18.81% | 12.87% | 9.90% | 7.92% |
| Stage I w/o Experience | ✓ | ✗ | ✗ | 1.09 | 12.62% | 8.74% | 5.83% | 3.88% |
| Stage II only | ✗ | ✗ | ✓ | 1.02 | 2.97% | 1.98% | 0.00% | 0.00% |
| AscendOptimizer | ✓ | ✓ | ✓ | 1.21 | 18.81% | 12.87% | 10.89% | 9.90% |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Aspect | Official Ascend C Best Practices | Experience Bank in This Work |
|---|---|---|
| Knowledge form | Principle-level guidance for human developers | Concrete optimization episodes with code-level rewrites and applicability conditions |
| Primary role | Explain common optimization principles | Support direct retrieval and transfer during automated operator optimization |
| Covered and aligned with docs | Tiling, DMA efficiency, double buffering, vectorized reduction | Recovers and operationalizes these documented principles in reusable optimization records |
| Beyond documented scope | Usually does not enumerate long-tail operator-specific rewrites | Includes loop restructuring, scalar index simplification, early-exit/search pruning, fine-grained synchronization tuning, and specialized SIMD paths |
| Granularity of reuse | Broad recommendations | Mechanism- and rewrite-level transferable patterns |
GPU Kernel Optimization
GPU kernel optimization improves the speed and memory efficiency of computations by tailoring code to GPU hardware and workloads.
See all 209 papers