AgentKernelArena: Generalization-Aware Benchmarking of GPU Kernel Optimization Agents

Sharareh Younesian, Wenwen Ouyang, Sina Rafati, Mehdi Rezagholizadeh, Sharon Zhou, Ji Liu, Yue Liu, Yuchen Yang, Hao Li, Ziqiong Liu, Dong Li, Vikram Appia, Zhenyu Gu, Emad BarsoumarXiv 2026

TL;DR

AgentKernelArena is a new open-source benchmark designed to evaluate AI coding agents on multi-turn GPU kernel optimization workflows. By testing production agents like Claude Code and Cursor Agent across 196 tasks, the benchmark uncovers a critical vulnerability: while agents deliver massive speedups on visible test cases, they frequently hardcode shape-specific assumptions that cause catastrophic failures on unseen input configurations.

What Problem Does This Paper Address?

Maximizing the performance of deep learning models requires highly optimized GPU kernels. Traditionally, writing these kernels demands deep, low-level hardware expertise to manage memory hierarchies, parallel execution models, and architecture-specific features.

While modern AI coding agents (like Cursor or Claude Code) can autonomously read code, run compilers, check profilers, and iteratively refine implementations, existing benchmarks fail to properly evaluate them. Current benchmarks typically score single-shot LLM generations rather than full, multi-turn agent workflows. More importantly, none of them test generalization. An agent can easily "cheat" or overfit by hardcoding optimizations tailored exclusively to the specific tensor shapes and batch sizes provided in the prompt, resulting in brittle code that breaks in production when faced with novel input dimensions.

Methods

The authors introduce AgentKernelArena, a modular framework that evaluates full agentic systems within isolated, sandboxed workspaces.

AgentKernelArena evaluation pipeline

The evaluation follows a strict, gated pipeline:

  1. Workspace Setup & Baselining: The original kernel is isolated and profiled.
  2. Agent Execution: The agent is given full shell access to compile, test, profile, and iterate on the code for a set number of turns (defaulting to 3 versions).
  3. Centralized Evaluation: A post-agent evaluator independently runs the final kernel through a gated sequence: Compile $\rightarrow$ Correctness (vs. reference implementation) $\rightarrow$ Performance (speedup measurement).

The Unseen-Configuration Generalization Protocol

To catch agents that overfit to visible shapes, the authors introduce a novel protocol. After the agent finishes optimizing, the kernel is evaluated against 8 structurally diverse, unseen configurations (e.g., non-power-of-two dimensions, prime sizes, asymmetric aspect ratios, and production-realistic shapes). The framework then calculates a "generalization gap" based on the performance drop between seen and unseen inputs.

Datasets

AgentKernelArena features 196 tasks split across three distinct programming model categories:

  • HIP-to-HIP (24 tasks): Optimizing existing AMD HIP (C++) kernels sourced from the GPU Mode community (activations, attention, normalization).
  • Triton-to-Triton (148 tasks): Optimizing Triton kernels, with 118 pulled from the vLLM inference engine and 30 from ROCmBench.
  • PyTorch-to-HIP (24 tasks): Generating a low-level HIP kernel entirely from scratch based only on a high-level PyTorch nn.Module specification.

Key Insights and Ideas

  • The "Hardcoding" Trap: When forced to generate code from scratch (PyTorch-to-HIP), agents frequently hardcode buffer sizes and loop bounds derived from the visible test shapes (e.g., defining a static MAX_ROWS = 32). When faced with larger unseen dimensions, these kernels fail catastrophically.
  • Programming Models Constrain Agents: Triton-to-Triton tasks showed excellent generalization. Triton’s block-structured programming model naturally forces agents to reason using shape-agnostic tiling strategies, preventing them from hardcoding low-level pointer arithmetic.
  • Diminishing Headroom in Triton: PyTorch-to-HIP yielded the highest speedups because PyTorch eager execution is a slow baseline. Conversely, Triton-to-Triton proved to be the most challenging category because Triton's compiler already automates heavy optimization, leaving less room for manual agent intervention.

Key Results

Across production agents, compilation rates were near-perfect, and correctness on visible shapes was highly reliable ($\ge 91\%$ for HIP and Triton tasks).

Quantitative Speedups:

  • PyTorch-to-HIP: The strongest configurations achieved up to a $6.89\times$ mean speedup (Cursor Agent using Claude 3.6 Opus).
  • HIP-to-HIP: Claude Code (Opus 4.6) led the pack with a $6.69\times$ mean speedup.
  • Triton-to-Triton: Performance gains were more modest, topping out at $2.13\times$ (Cursor Agent using Claude 3.7 Opus).

Generalization Failures:

The unseen-configuration protocol exposed severe regressions in the PyTorch-to-HIP category. As shown in the quadrant breakdown below, conditional correctness dropped significantly on unseen shapes, plummeting to as low as $60\%$ for Cursor Agent running GPT-5.4 High due to shape-specific hardcoding.

Unseen-configuration generalization quadrant breakdown

Limitations and Future Work

  • Hardware Scope: The evaluation was restricted to a single GPU architecture: the AMD Instinct MI300X.
  • Agent Constraints: Due to commercial API costs, agents were limited to a maximum of 3 iterations and 3 runs per task.
  • Model Exclusions: The study focused entirely on commercial general-purpose agents. Open-weight models consistently failed single-iteration compilation due to complex multi-file context requirements, and specialized kernel-tuner architectures were excluded to ensure a fair baseline.

Future Directions: The authors plan to expand the task library (integrating repositories like AITER), evaluate sensitivity to larger iteration budgets, and add support for alternative hardware targets.

Summary updated

BibTeX
@misc{younesian2026agentkernelarena,
  author = {Sharareh Younesian and Wenwen Ouyang and Sina Rafati and Mehdi Rezagholizadeh and Sharon Zhou and Ji Liu and Yue Liu and Yuchen Yang and Hao Li and Ziqiong Liu and Dong Li and Vikram Appia and Zhenyu Gu and Emad Barsoum},
  title = {{AgentKernelArena: Generalization-Aware Benchmarking of GPU Kernel Optimization Agents}},
  year = {2026},
  eprint = {2605.16819},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.16819},
}
Figure