arXiv:2607.20518cs.AI2026-07被引 1

为华为Ascend NPU打造可量化评估AI生成算子的基准测试

CANN Bench: Benchmarking Agent Generated Kernels against Real NPU and Algorithmic Limits

论文配图:CANN Bench: Benchmarking Agent Generated Kernels against Real NPU and Algorithmic Limits
图 1 · 摘自论文原文
  • 构建四层难度的算子测试集,覆盖53个算子和1060个用例
  • 采用三维加权评分,性能对比真实NPU极限与基线模型
  • 专为抵抗奖励作弊设计,支持社区长期共建

AI代理现已能针对不同硬件平台编写、编译并迭代优化底层算子内核。然而现有基准测试几乎仅聚焦于CUDA与Triton,导致编程模型较不透明的硬件生态缺乏统一评估标准。本文提出CANN Bench,一个面向华为Ascend NPU的开源算子生成基准。当前版本涵盖53个算子和1060个测试用例,分为四类难度层级——从基础逐元素运算到MoE分发与FlashAttention内核,覆盖FP16、BF16、FP32及INT8精度。评估采用三维度加权综合得分,将编译质量、功能正确性与性能表现作为独立指标,为算子生成代理提供合理奖励信号。性能评分基于原生PyTorch-on-Ascend基线与真实NPU上的逐案例硬件锚定性能(HAP)上限,确保分数反映真实优化空间而非测量误差。评估框架从设计上防范奖励劫持。CANN Bench在官方CANN仓库中版本化管理,支持长期社区共建,为Ascend生态提供可量化、可复现且可持续维护的算子生成能力度量标尺。

原文摘要 · Abstract (English)

AI agents are now capable of writing, compiling, and iteratively optimizing low-level operator kernels on different hardware platforms. Existing benchmarks, however, focus almost exclusively on CUDA and Triton, leaving hardware ecosystems with less-exposed programming models without a common evaluation baseline. We present CANN Bench, an open benchmark for AI-generated operator code on Huawei's Ascend NPU. The current release covers 53 operators and 1060 test cases organized into four difficulty tiers -- from simple elementwise primitives to MoE dispatch and FlashAttention kernels -- spanning FP16, BF16, FP32, and INT8 precision formats. Evaluation adopts a \textbf{three-dimensional weighted composite score} that treats compilation, functional correctness, and performance as independent axes, providing a principled reward signal for kernel-generation agents. Performance is graded against an out-of-the-box PyTorch-on-Ascend baseline and an analytical per-case Hardware-Anchored Performance (HAP) limit on real NPU hardware, ensuring scores reflect genuine optimization headroom rather than measurement artifacts. The evaluation harness is designed to resist reward hacking from the ground up. CANN Bench is versioned within the official CANN repository and is designed for long-term community co-construction, providing the Ascend ecosystem with a quantitative, reproducible, and sustainably maintained yardstick for AI operator-authoring capability.

算子优化NPUAI代理基准测试

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。