AscendGYM: A Cost-Aware Kernel Optimization Benchmark for Real-World Workloads on Ascend NPUs

AI Training Platform Team, Bingwei Zhang, Jing Li, Amir Abdullin, Sihang Chen, Xin Chen, Liangjun Feng, Yingmeng Gao and 19 others

Shenzhen Loop Area Institute

Published November 13, 2026 · on the feed November 18, 2026 · ▲ 94 · arXiv 2611.17621

The abstract

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.

The Brief

2:16

A short podcast summary of the paper. Written and voiced by AI.

Transcript

AscendGYM. A Cost-Aware Kernel Optimization Benchmark for Real-World Workloads on Ascend NPUs. By AI Training Platform Team and twenty-six others, from the Shenzhen Loop Area Institute. Published on the thirteenth of November.

Training and serving large language models efficiently on Ascend NPUs depends on kernel optimization. The benchmarks that exist for Ascend kernels mostly focus on kernel generation: writing a kernel from nothing. Much less attention goes to a different and practical skill, which is an agent's ability to take an implementation that already exists and make it faster, under input configurations drawn from real workloads.

AscendGYM measures that skill. It asks how much an agent can speed up an existing kernel on the shapes and data types it will actually meet, and it asks what that improvement cost. Because the test cases come from real tasks, a gain on the benchmark maps directly onto the corresponding workload rather than onto a synthetic one.

The initial suite has forty-eight kernels across three difficulty levels. Each kernel is paired with test cases whose data types and tensor shapes were collected from real training and inference tasks. The benchmark provides a complete execution environment that closely reproduces how Ascend kernels are invoked in practical pipelines.

For usability there are two evaluation modes: model evaluation and model-harness evaluation. Between them, the kernel optimization capabilities of both trained models and custom agents can be measured. For model evaluation, AscendGYM additionally includes a built-in harness, equipped with search orchestration and experience accumulation.

The main new instrument is a metric, the Speedup-Token Score, or STS. It quantifies performance gains relative to the token cost spent getting them. By weighing speedup and cost jointly, STS is meant to assess the practical kernel optimization capability of a model or a harness under an acceptable budget. The abstract does not report scores for particular models, so what it offers is the measuring apparatus rather than a ranking.

Two choices shape what this benchmark rewards. Grounding every test case in real workloads means a speedup is a speedup someone would actually feel. Charging for tokens means that an agent which reaches the same kernel by spending far more is not counted as equally good. Together they move the question from whether an agent can optimize a kernel at all to whether it can do so on real inputs, within a budget it can afford.

The deep dive

6:34

A longer episode, written from the whole paper. Written and voiced by AI.

Transcript

AscendGYM. A Cost-Aware Kernel Optimization Benchmark for Real-World Workloads on Ascend NPUs. By AI Training Platform Team and twenty-six others, from the Shenzhen Loop Area Institute. Published on the thirteenth of November. This is the long version: the whole paper rather than the abstract.

The existing kernel benchmarks for Ascend NPUs mostly ask one question: given a specification, can a model write a kernel that compiles, is correct, and runs fast? The engineering job this paper cares about is a different one. You start from a kernel that already works, and you have to make it faster for the exact shapes a real training or inference workload feeds it, without breaking it, on a budget. And two systems can finish with the same speedup, one after a handful of attempts and the other after a long, expensive search. A leaderboard of final speedups cannot tell them apart.

The authors profile real workloads, pick the bottleneck kernels, and keep the deployment context attached to every test case: the model, the execution phase, the parallelism, and the resulting tensor shapes and data types. Their worked example is a residual addition followed by RMS normalization, taken from the prefill phase of a small Qwen model with an input of thirty-two tokens. It runs fifty-six times per forward pass and accounts for eight point seven seven percent of total computation time. The full suite holds forty-eight kernels in three batches of rising difficulty: memory access on basic kernels, then multistep computations like normalization and quantization, then complex and sparse attention. Only the seventeen tasks of Batch 1 are evaluated here. The baseline is always the implementation shipped with the task, measured on the same hardware, and every speedup is relative to it.

The execution side is a sandbox called AscendForge, built on SandboxFusion. A scheduling proxy picks a compatible worker, which builds and runs the kernel. The test driver checks correctness first and only then measures performance, and the two results come back separately, so an agent can tell a build failure from a numerical accuracy failure from a performance regression. Each measurement runs eight rounds, discards three as warm-up, and averages the device-side time of the rest. An agent gets at most eighty candidate evaluations, with a soft target of fifty genuinely different proposals. Failed submissions spend the budget. The prompt forbids touching tolerances, golden references, tests or shapes. When search ends, the chosen implementation is measured five more times, with no feedback returned.

Then the scoring. The headline metric is the Speedup Token Score. Its first term is one hundred times the base-two logarithm of the final speedup, so doubling speed earns a hundred points. The second term subtracts a penalty for each improvement: that improvement's gain in log speedup, weighted by the fraction of the token budget already spent when it arrived, times fifty. Tokens spent on failed attempts count. Supporting metrics sit around it. Cost to Gain asks how many extra tokens it took to improve speedup by one, five or ten percent. Task pass rate records whether any correct candidate appeared at all.

Gains are modest. About seventy percent of model and harness combinations land below one point two times geometric mean speedup. Per kernel, the best observed result is about three point two nine times on a fused gating kernel, yet the median across combinations stays below one point one times on thirteen tasks. The comparison that tests the thesis most directly concerns GPT five point six. It passes every task with all three harnesses, Claude Code, Codex and OpenCode, yet its speedup is about one point six nine times with Codex against one point zero five times with Claude Code. Correctness, in other words, says little about gain.

Cost tells a similar story. Codex with GPT five point six spends about one hundred and forty point four million tokens per task. Claude Code with Opus five spends eighty-one point seven five million, and gets the higher speedup. The smaller Qwen model reaches nearly identical speedups under OpenCode and Codex with comparable tokens, but takes eleven point one hours per task with one and two point two hours with the other. In the fixed-harness mode, holding GPT five point six Luna constant, the warm configuration seeded with five strategy lessons beats the cold one at every budget, so harness settings move the score as well as the model.

There is no limitations section, but limits are visible in what is reported. Only seventeen of the forty-eight kernels are evaluated; the remaining two batches are left to future updates. Each combination is represented by its latest record per task, so there are no independent repeats and no error bars, though the metric section notes repeats could assess stability. The grid is incomplete: Opus five is not run under Codex. The warm against cold comparison is not like for like, and the appendix says so: warm uses eleven measurement executions on some tasks rather than eight, and on three tasks its lessons come from a cold run of the same kernel. The two weights inside the score are stated rather than tested.

The idea to carry away is that optimization is a search, and a benchmark should score the search, not just where it ended. AscendGYM starts from working code and real shapes, and charges for every token, including the wasted ones. On those terms, current agents mostly find small wins, and the same model can look strong or weak depending on the harness around it.

Paper Quest · 7 chapters · about 33 min

Play this paper

Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.

Chapter 1 🧩 · The problem

Measuring an agent sounds easy until you ask what, exactly, you are measuring.

You want to know whether a coding agent can make AI chip kernels faster. The existing benchmarks for these chips ask agents to write kernels from nothing, and score compilation, correctness and speed.

The road ahead

  1. 1 · The problem ~7 min Existing chip-kernel benchmarks test writing kernels from nothing, but real work means speeding up working code on real inputs, at some cost.
  2. 2 · What came before ~3 min
  3. 3 · The key idea ~9 min AscendGYM hands agents working kernels with real-workload inputs, checks every attempt by real execution, and scores speedup against tokens spent.
  4. 4 · Choose your own research ~3 min
  5. 5 · How it works ~3 min
  6. 6 · What they found ~3 min
  7. 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Join free to play the whole quest ›

Free, with Google or an email address. Your stars and progress are kept.

KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.