A numerical kernel that gives a wrong answer quickly has not solved an optimization task. A program that finds a fast kernel only after a very expensive search raises a different measurement question. AscendGYM studies optimization for Ascend neural processing units, bringing the cost of obtaining a solution into a domain often summarized by the speed of the winning implementation.
Why the search budget enters the score
The AscendGYM team introduces a Speedup-Token Score that relates an achieved performance gain to token expenditure. This gives two systems producing an equally fast final kernel a way to rank differently if one consumes substantially more model output during optimization. It also makes the cost unit important. Tokens are a convenient logged quantity, but they do not directly measure elapsed accelerator time, electricity or the price of every possible inference service. Recording the underlying speedup and token count preserves information a reader needs to apply a different local cost model.
Real-World Context as the Benchmark Foundation
Each optimization task in AscendGYM is rooted in actual large language model (LLM) workloads. For instance, one task—AddRMSNorm—mirrors a precise step in Qwen3-0.6B inference: residual addition followed by RMS normalization during the prefill phase. The test case includes exact parameters like batch size, sequence length, tensor shapes, and data types (e.g., BF16), all drawn directly from real deployment logs. This ensures that any performance improvement measured is tied to a specific operational context. Without such fidelity, gains in speed could be misleading or irrelevant to how models actually run in production environments. By preserving the full input configuration, AscendGYM links kernel-level changes to their impact on end-to-end workload efficiency.
Measuring Optimization Beyond Just Speed
AscendGYM introduces a new evaluation metric called the Speedup-Token Score (STS), which moves beyond simple speedups to account for how much computational effort—measured in tokens processed—is required to achieve each improvement. This reflects the real cost of optimization: agents must balance performance gains against the number of iterations, memory accesses, or configuration changes needed to reach them. STS combines final execution time improvements with cumulative token consumption across all refinement steps. This dual metric allows for fair comparison between different agents or model-harness combinations, especially when their underlying search strategies differ.
The benchmark is structured into three difficulty levels to reflect the complexity of real-world kernels. These tasks are relatively straightforward but still require understanding how data layout affects performance under specific input shapes. The initial analysis covers only Batch 1 (17 tasks), with future reports expanding to include the more complex batches.
Each task includes a complete, runnable kernel implementation as a starting point—no assumptions about prior knowledge or code quality are made. The evaluation environment, AscendForge, runs all tests in a consistent sandbox that handles compilation, correctness validation, and performance measurement. For model evaluation, a built-in harness manages the optimization process, including search orchestration and experience accumulation across iterations. This allows researchers to assess both standalone agent capabilities and how well a model interacts with its own optimization strategy.
A key design decision is that AscendGYM does not treat performance alone as the sole success criterion. Instead, it evaluates three interrelated aspects: final performance, resource cost (in tokens), and reliability of results. The joint metrics—especially STS—provide a more holistic view than traditional benchmarks, which often only report speedup ratios. These scores help determine whether an agent is not just faster but also smarter in its optimization process.
The framework supports both model evaluation and model-harness evaluation. In the former, a fixed default harness runs optimizations uniformly across all models. In the latter, different agents can be paired with custom harnesses that implement unique search logic or memory management strategies. This enables deeper analysis of how optimization process design influences outcomes. The results show that performance gains are not uniform across kernels—some benefit significantly from simple changes in data layout, while others require complex restructuring.
It provides a structured environment for testing agents under realistic conditions but does not offer automated solutions or definitive best practices. The evaluation remains grounded in measurable outcomes derived from actual workloads. Open questions remain about how well different search strategies scale with increasing task complexity and whether certain kernels are inherently more difficult to optimize due to hardware constraints or data dependencies.
Ultimately, AscendGYM shifts the focus of kernel benchmarking from theoretical correctness to practical impact. By embedding optimization tasks in real deployment contexts and measuring both performance and cost, it offers a clearer picture of what agents can achieve—and where they fall short—in real-world systems.
The introduction of the Speedup-Token Score (STS) marks a significant shift from traditional benchmarks that evaluate only final performance gains. STS combines performance improvement with cumulative token consumption during optimization iterations, offering a more nuanced view of efficiency. However, this metric does not account for variations in how different agents or harnesses allocate computational effort across stages—such as whether one agent spends early iterations on structural changes or focuses on micro-optimizations. For example, an agent might achieve high performance with low token use by converging quickly on a viable solution, while another could explore more paths before stabilizing—yet both may yield similar STS values. Without a breakdown of how each iteration contributes to the total cost, it is difficult to determine whether the metric truly captures process efficiency or merely correlates with it. A test that isolates per-iteration token use and links it to specific code changes (e.g., loop unrolling, memory access patterns) would distinguish between these competing interpretations.
The Real-World Context as a Kernel Optimization Foundation
AscendGYM begins by extracting kernel-level bottlenecks from actual large language model (LLM) training and inference workloads running on Ascend NPU platforms. Profiling data is collected from real systems using frameworks like MindSpeed-LLM and vLLM-Ascend, where performance-critical kernels are identified based on their contribution to overall latency or throughput. These kernels—such as matrix multiplication, attention computation, and tensor reduction—are selected not because they are theoretically complex, but because they appear frequently in production pipelines and significantly impact end-to-end performance. Each kernel is then formalized into a test task that includes the original source code, input tensor shapes and data types, and reference outputs derived from CPU-based execution to ensure correctness. This ensures every optimization challenge mirrors real deployment conditions: a model may use a specific data layout or parallelism strategy that must be preserved during refinement. The inclusion of such contextual metadata allows any performance gain to be directly attributed to improvements in actual workloads rather than abstract benchmarks.
An Experimental Workflow for Kernel Refinement
The evaluation process follows a structured, iterative loop designed to simulate how real-world optimization would unfold. Then, an agent—whether trained or custom—is tasked with refining the implementation through successive iterations: analyzing bottlenecks, modifying code, and recompiling the candidate. Each new version is submitted to AscendForge, a sandbox environment that handles compilation, device-side binding, and correctness verification against reference outputs. After each iteration, the system records execution time, token consumption (used as a proxy for computational effort), and any changes in memory access patterns or parallelism. These metrics are then used to inform subsequent refinements, creating a feedback loop where experience accumulates over time. The process continues until either the allocated resource budget is exhausted or a predefined maximum number of iterations is reached. At termination, the best-performing candidate undergoes final validation: its performance is re-measured in isolation, and all optimization traces are aggregated to compute composite metrics.
Interpreting Performance Gains with Cost Awareness
The results from AscendGYM do not rely solely on raw speedup ratios; instead, they use a new metric called the Speedup-Token Score (STS) to evaluate both outcome and process efficiency. STS combines the final performance improvement—measured in terms of execution time reduction—with the cumulative token consumption across all optimization steps. This dual dimension reveals how effectively an agent balances progress toward better performance with the computational cost of achieving it. Conversely, a smaller improvement with minimal token use might represent a more sustainable and practical optimization path. This indicates that while models can generate code that performs better than the baseline, they often do so through inefficient exploration paths. The observed variation in STS across tasks reflects differences in kernel complexity and input context: simpler kernels with predictable shapes yield more consistent and higher-scoring results, whereas dynamic or irregular workloads require deeper understanding of data flow and memory access patterns. These findings highlight that optimization success is not just about correctness or speed but also about the agent’s ability to navigate cost-sensitive design spaces. The scope of these observations remains limited to the initial 48 kernels drawn from real-world LLM pipelines, with no extrapolation beyond this dataset. Future work will expand the suite to include more diverse and complex scenarios across batches 2 and 3.
The Boundary of Real-World Input Coverage
The evidence in AscendGYM is limited to kernels and test cases extracted from actual LLM training and inference workloads. This selection process establishes a direct link between benchmark performance and real-world usage, but it does not establish whether the full spectrum of possible input configurations—such as extreme tensor shapes, rare data types, or edge-case memory layouts—is adequately represented. The current suite includes 48 kernels across three difficulty levels, with Batch 1 containing only 17 tasks focused on memory access optimization. For instance, a kernel optimized for small tensor sizes might fail under large-scale, sparse inputs that are common in long-context inference but not present in the original data collection. Competing explanations would differ in whether the test cases reflect typical usage patterns or represent only the most frequently encountered configurations. A benchmark that includes a wide range of input distributions—such as logarithmic scaling of tensor dimensions or varying precision combinations—would provide stronger evidence for generalizability, while one relying on common-case inputs risks underestimating failure modes in production environments.
The Open Question of Optimization Path Dependence
The evaluation workflow includes iterative refinement, feedback loops, and experience accumulation, suggesting that prior decisions influence subsequent actions. If performance differences emerge based on the sequence of changes, this would imply path dependence and suggest that optimization is not a purely outcome-driven process. Conversely, if both paths yield identical performance and token costs despite divergent intermediate steps, it would support the idea that convergence to optimal solutions is robust regardless of exploration strategy. This distinction is critical because it affects how we interpret agent capabilities: if path matters, then agents must possess memory or planning abilities; if not, their success may stem from heuristic search rather than deep understanding. No current evaluation has tested this by comparing equivalent end states with different trajectories, leaving the nature of optimization as a dynamic process—rather than a static endpoint—uncertain and underexplored.
The Role of Execution Context in Measuring Optimization Efficiency
AscendGYM’s design fundamentally shifts kernel optimization from a purely performance-centric exercise into one grounded in real-world operational conditions. A key mechanism introduced in the evidence is the preservation of full deployment context—such as hardware configuration, data types, tensor shapes, and execution phase—for each test case. This allows measured speedups to be directly tied to how kernels behave within actual model pipelines. For instance, the AddRMSNorm task in Qwen3-0.6B inference runs with a specific sequence length (32 tokens), BF16 precision, and single-NPU execution, resulting in 56 invocations per forward pass that consume 8.77% of total computation time.
What the existing analysis underplays is how this context enables a new kind of efficiency metric: optimization cost relative to real-world workload exposure. The execution context thus becomes not just a label but a quantitative input for evaluating how much effort is required per unit of performance gain.
This leads to a hypothetical contrast between two agents operating on the same AddRMSNorm task: Agent A and Agent B. While both achieve similar performance gains in the specific test case, Agent B’s solution is more efficient in terms of optimization cost—its path requires fewer trials and offers broader applicability.
The evidence shows that AscendGYM tracks both performance gains and cumulative token consumption during optimization—this is central to the Speedup-Token Score (STS). Without it, a high STS might reflect either superior code quality or excessive trial-and-error effort. With context, STS becomes a proxy for how efficiently an agent navigates real-world variability.
This mechanism reveals an underexplored dimension of kernel optimization: not just what works, but how much effort it takes to make it work in diverse real-world scenarios. The design of AscendGYM’s test cases ensures that every performance metric is anchored in a deployment scenario. This allows evaluation to move beyond simple speedup and instead assess the cost-effectiveness of optimization paths. In practice, this means agents must balance between achieving high performance on specific inputs and maintaining low exploration costs across a range of configurations—something that traditional benchmarks fail to capture.
Ultimately, the inclusion of real-world execution context transforms kernel benchmarking from a static comparison into a dynamic evaluation of engineering trade-offs. It introduces a new layer of insight: optimization is not just about speed, but about how efficiently it can be achieved under practical constraints. This shift makes the benchmark more aligned with actual development workflows, where developers must balance performance gains against time, computational cost, and code maintainability.
A Hypothetical Comparison: Two Kernels with Equal Speed but Divergent Token Costs
An unrun editorial thought experiment illustrates how AscendGYM’s Speedup-Token Score (STS) shifts the interpretation of kernel optimization from pure speed to cost-aware performance. Consider two hypothetical kernels—K1 and K2—both optimized for a single, real-world inference workload: a medical diagnosis model processing patient records.
The test is conducted by a researcher evaluating two different agent strategies: one that prioritizes minimal computation (Strategy A), and another that explores broader code transformations (Strategy B). The researcher observes the total number of tokens generated during optimization—each token representing an intermediate computation step, such as matrix multiplication or activation evaluation—alongside the final execution time.
This divergence suggests different optimization philosophies: Strategy A likely reduces redundant operations and avoids unnecessary data flow, minimizing token expenditure. Strategy B may have introduced more complex control paths or intermediate computations that increase internal activity even if the final output is unchanged. In this scenario, the STS reveals that K2 appears more “costly” in terms of computational overhead per unit of progress.
Two distinct outcomes emerge from such a comparison. First, if a deployment environment charges per token processed during training or inference (e.g., due to cloud-based inference pricing), then K1 would be cheaper to operate despite equal end-to-end latency. This makes STS directly relevant for cost modeling in production systems where every intermediate step contributes to operational expense. Second, if the system has strict energy budgets—say, a hospital using edge devices with limited power—the lower token count of K1 might indicate better power efficiency, even without direct measurement of power draw.
Crucially, these outcomes are conditional on assumptions about cost models. If the local cost model assigns equal value to all tokens regardless of type or function, then both kernels remain equivalent in economic terms. But if token count correlates with energy use (e.g., larger tensor operations consume more power), then K1’s lower token count may imply lower environmental impact.
The thought experiment also highlights a key limitation: STS depends on the definition of “token” within the system. In this case, tokens are not output tokens from the model but intermediate computational units generated during kernel execution. This distinction is vital—confusing them could mislead users into thinking cost is tied to final outputs rather than internal workloads.
Why This Matters for Real-World Evaluation
In practical deployment, faster kernels are not always more efficient if they consume more computational resources during optimization. This allows users to evaluate agents not just on whether they improve latency, but also on how efficiently they use the system’s resources.
Without such a metric, benchmarking would risk rewarding over-engineering or excessive computation. A model might generate faster kernels by adding redundant operations that inflate token counts—achieving speed at the cost of higher operational expense. The STS forces a trade-off between performance and resource consumption, making it a useful tool for comparing different optimization strategies under real-world constraints.
Ultimately, the STS does not replace direct measurement of power or time but provides a measurable proxy that aligns with how users might assign value to computation in their own environments. Its utility depends on whether local cost models treat token expenditure as meaningful—something that must be explicitly defined by each user, not assumed.


