AscendGYM:面向昇腾NPU真实工作负载的成本感知内核优化基准

·

研究论文 · 2026/11/18

AscendGYM 是一个面向昇腾 NPU 的代价感知内核优化基准,包含 48 个内核(三个难度级别),测试用例的数据类型和张量形状来自真实训练与推理任务。它支持模型评估和模型-框架评估两种模式,并提供完整执行环境以复现实际调用方式。此外,提出 Speedup-Token Score (STS) 指标,结合加速比与 token 成本来评估实际优化能力。

该基准填补了昇腾 NPU 上针对真实工作负载的内核优化评估空白,其 STS 指标和双模式评估为模型与代理的优化能力提供了实用且可量化的衡量标准,有助于推动 LLM 训练与推理的效率提升。

Kernel optimization is essential for efficient large language model (LLM) training and inference on Ascend NPUs. Existing Ascend kernel benchmarks primarily focus on kernel generation, with less emphasis on the ability of agents to optimize existing implementations under input configurations drawn from real workloads. To address this requirement, we introduce AscendGYM, a benchmark whose initial suite comprises 48 kernels across three difficulty levels. Each kernel is paired with test cases whose data types and tensor shapes are collected from real-world training and inference tasks. Consequently, performance improvements on AscendGYM map directly to the corresponding workloads. In terms of usability, two evaluation modes are supported in AscendGYM: model evaluation and model-harness evaluation. The kernel optimization capabilities of both trained models and custom agents are allowed to be measured. It provides a complete execution environment that closely reproduces how Ascend kernels are invoked in practical pipelines. For model evaluation, it additionally includes a built-in harness equipped with search orchestration and experience accumulation. Finally, we propose a new metric, the Speedup-Token Score (STS), which quantifies performance gains relative to token cost. By jointly considering speedup and cost, STS enables the assessment of practical kernel optimization capability of a model or harness under an acceptable budget. AscendGYM is available at https://github.com/SLAI-AITP/AscendGYM.

阅读原文

参与讨论