Performance measurement · Research feature

Study Benchmarks Real-World Performance of GPU Kernel Generation Agents

A new benchmark evaluates how well AI agents generate GPU kernels that function correctly in real production models, not just in isolated tests.

Adapted from research by Gabriele Oliaro, Jaeseong Lee, Yichao Fu and colleagues.

arXiv preprint revision · 2026-10-01 · Attribution & reuse
In this article
Editorial illustration of processor die.

Editor’s introduction

The study assesses LLM-based agents generating GPU kernels for HuggingFace Transformers architectures using a benchmark of 384 tasks across 47 models. Tasks are structured hierarchically, with higher-level modules depending on lower-level ones, mirroring actual production code composition. Kernels are evaluated both in isolation and within full models running real workloads. The research finds that while agents achieve significant kernel-level speedups, these shrink to at most 1.25× end to end, and only 20% of winning kernel sets run correctly without failure. A key finding is that kernel-level performance does not reflect real-world deployment success, as agents like Claude Code outperform KDA in isolated tests but are outperformed end to end. The evaluation includes real production execution paths with crash detection and model re-runs, ensuring only deployable kernel sets are scored. The benchmark validates that speedups in synthetic settings do not translate to production performance, highlighting a gap between sandboxed and real-world execution.

Introduction

LLM-based agents for GPU kernel generation now achieve strong scores on isolated benchmarks, with state-of-the-art systems autonomously compiling, profiling, and refining CUDA or Triton code. Yet these gains often fail to transfer into production inference frameworks such as vLLM and SGLang: kernels that score well in sandbox evaluation routinely regress once they encounter real serving interfaces, compilation stacks, and workloads.

The root cause is benchmark–production misalignment. Current benchmarks rely heavily on synthetic inputs, single-GPU isolated kernels, simplified interfaces, and independent task levels that do not compose into full inference pipelines. They therefore reward kernels that are fast in isolation but brittle in deployed systems, hiding interface mismatches, compilation-stack conflicts, and correctness degradation that only appears at model scale.

Our approach

Because integration failures only surface at model scale, FastKernels also scores every candidate end to end, inside the models its tasks come from and on their production execution path (continuous batching, chunked prefill, CUDA graphs, torch.compile, tensor parallelism). This model runtime is the benchmark’s measurement instrument, not a separate contribution, and we validate it against vLLM, SGLang, and the other production references before scoring any agent (Section 6.1). The result is an open leaderboard that ranks agents by what survives deployment, scored with MacroEval, and we seed it with a 6,900-agent-hour evaluation of five representative agents, from an RL-trained kernel model to contest-winning long-horizon harnesses.

GPU kernel benchmarks

KernelBench pioneered the evaluation of LLM-generated GPU kernels, drawing from an earlier generation of architectures (e.g., AlexNet, VGG). robust-kbench addressed KernelBench’s numerical instabilities and reward-hacking vulnerabilities. SOL-ExecBench scores subgraphs against B200 speed-of-light bounds rather than software baselines. FlashInfer-Bench integrates with an inference engine but is limited to FlashInfer LLM operators, while CUDABench and TritonBench evaluate operators in isolation. Further efforts broaden backend and robustness coverage while retaining an operator-level, single-GPU scope. Concurrent benchmarks target multi-GPU code directly: CommBench evaluates communication programs across NVLink and RDMA, and ParallelKernelBench asks agents to replace PyTorch+NCCL references with fused multi-GPU kernels; both score each program in isolation. FastKernels is complementary and fills four gaps: it is the first kernel benchmark to (i) organize tasks into a compositional hierarchy from primitives to full models, mirroring production assembly, and to show that this hierarchy produces measurable composition effects (Section 6.2). It also (ii) measures speedup against the kernels shipped in state-of-the-art inference frameworks rather than PyTorch or theoretical bounds, (iii) matches production module interfaces, enabling copy–paste deployment, and (iv) scores communication kernels inside the tensor-parallel models that issue them.

Top-Down, Model-Driven Construction

Unlike prior benchmarks that construct tasks bottom-up by combining primitive operators or extracting subgraphs via automated pipelines, FastKernels takes a top-down approach. We begin with real model families—selected to represent the current and near-future frontier of AI workloads—and recursively decompose them into the kernels that constitute their inference paths.

Task construction

For each model architecture, we load the HuggingFace configuration and architecture definition, walk the forward pass, and produce standalone task implementations for each computational kernel with all configuration constants (hidden size, number of heads, data types) inlined from the model’s configuration. Every task is then audited to verify: (i) semantic correctness of the reference implementation, (ii) that the task captures the operator as it actually executes in the model (not a simplified proxy), (iii) that tensor shapes and data types match the model’s real configuration, and (iv) that the task’s interface matches the corresponding module in the production reference library (Section 3.4). The construction pipeline ships with FastKernels, so users can add new architectures from HuggingFace with minimal effort. No task is synthetic: unlike KernelBench’s Level-2 random fusions or SOL-ExecBench’s LLM-selected subgraphs, every task is an operation that runs in a real model during inference.

Standalone and composed evaluation

Crucially, the hierarchy is not just organizational—it is executable. L2–L4 baselines import their lower-level dependencies via relative imports (e.g., an L3 decoder layer does from..L2.attention import Attention), mirroring how production frameworks assemble modules. In standalone mode (—standalone), each candidate is benched in isolation: imported lower-level modules resolve to their production baselines regardless of what other candidate files exist. In composed mode, all candidate files in the candidate directory are active simultaneously, so an L3 block’s lower-level imports resolve to agent-generated candidates rather than production baselines. The standalone score measures how well the agent optimized one module; the composed score measures what a real deployment would observe when multiple agent-generated modules interact. The gap between the two—the composition effect—is a first-order signal that flat benchmarks are structurally unable to produce (Section 6.2).

Architecture Coverage

To measure coverage, we implemented every architecture in HuggingFace Transformers (commit 89b6b17) on FastKernels without adding any operator: 94.6% (472/499) of them run and match native HF outputs within dtype-dependent tolerances, and only 5 require a genuinely new operation. The methodology and per-architecture results are in Appendix M.

Interface-Compatible Design

A central design principle of FastKernels is that optimized kernels should be deployable into existing production systems with minimal effort. For each model architecture family, we identify the corresponding state-of-the-art production library (e.g., vLLM for LLMs, SGLang for serving) and design each task’s interface—its __init__ constructor signature and forward method—to closely match the corresponding module in that reference library.

A kernel optimized within FastKernels can therefore be copied into vLLM, SGLang, or another production framework without interface refactoring. Unlike FlashInfer-Bench’s FIApply, which substitutes at the kernel dispatch level (an abstraction internal to FlashInfer), FastKernels’s compatibility operates at the module level, the unit production frameworks compose.

Scenario sets

A scenario fixes a checkpoint, TP degree, dtype, and workloads from public datasets for its modality (e.g., WildChat for LLMs, Parti-prompts for diffusion, COCO for detection). The full set has one scenario per architecture (47 scenarios, 184 workloads, TP 1–8) and is used to validate the benchmark (Section 6.1). The default set is the 11-model subset on which agents are scored, because a single long-horizon agent already spends up to 2,500 agent-hours on it: it spans all 8 categories, TP 1–4, and BF16/FP16/FP8/MXFP4 (48 workloads), and its models run 133 distinct L1–L3 tasks (Appendix C).

Workload capture

fastkernels capture runs each scenario end to end and records, for every task module, a reconstructable constructor recipe and the shape, dtype, and stride of every forward argument. Identical calls merge into one variant with a call count; the kernel tier then merges variants across workloads and benchmarks up to five per operator (smallest, median, and largest problem, then the most frequent): on the default B200 capture, 12.4M calls reduce to 87.7K distinct cases and 582 benchmarked ones (Appendix D).

Kernel-level tier

The kernel tier rebuilds each candidate next to its baseline from the recipe, shares weights, and compares outputs and runtimes on the selected cases, one operator per isolated process with reward-hack checks. Values are synthesized from the captured shapes, with offsets, indices, and cache slots kept consistent with the call; for data-dependent operators such as MoE dispatch, FastKernels additionally replays golden inputs captured from real end-to-end executions, ensuring that both correctness and performance are measured on the actual tensors encountered by the model (Appendix E).

End-to-end tier

The end-to-end tier swaps a candidate set into full model executions on the production path and real requests, next to a baseline run and a noise run that calibrates correctness thresholds, and produces the MacroEval metrics (Section 5). The kernel tier gives agents fast feedback; the end-to-end tier is the ground truth that the leaderboard reports. Both tiers integrate with profilers, NVIDIA Nsight Compute (NCU) for kernel-level analysis and Nsight Systems (NSYS) for end-to-end traces, with LLM-based extraction of the main bottlenecks, and with MLflow for tracking kernel lineage across agent runs.

Evaluation

The evaluation has two parts: Section 6.1 evaluates the benchmark itself, checking that its baselines match each family’s production framework so that speedups over them are meaningful; Sections 6.2 and 6.3 evaluate kernel agents on the default set, at the kernel level and end to end.

Deduplication

Each call is keyed by the canonical serialization of its record, and identical keys are merged into one variant that keeps a call count. Each forward variant also records which constructor variants built the instances it ran on, so the benchmark can rebuild exactly the module configuration that produced each shape. Since every layer of a model and every decode step with the same batch composition produce the same key, the 12.4M L1–L3 forward calls of the default B200 capture reduce to 93.3K variants across its 48 per-workload reports, and to 87.7K distinct (constructor, forward) cases once merged across reports. The distribution is long-tailed: half of the operators have at most seven distinct cases, while operators whose shapes follow the per-step token count (decode attention, RMSNorm, linear layers, embeddings) reach thousands. For the few operators that read the global inference context inside forward (MLA attention), a coarse context summary (prefill or decode, and a power-of-two bucket of the number of prefill sequences) is folded into the key, which is enough to rebuild the code path without defeating deduplication.

Verification

Two independent checks run after every workload. First, a forward pre-hook, registered separately from the wrappers, re-observes every operator call; its per-operator keys and counts must match the wrapper records. Second, a mock continuous-batching and chunked-prefill scheduler, driven only by each request’s real prompt and generated lengths, the engine’s token and sequence budgets, and its KV-block pool, replays the serving schedule and predicts the per-step batch composition; the captured leading dimensions (token counts, sequence counts, batch sizes) must agree with it. The replay does not model speculative decoding, so only the first check applies to EAGLE-3.

Case selection

fastkernels bench loads every report of a capture and deduplicates cases across reports by (constructor recipe, forward record). When an operator has more than five distinct cases (the default budget), it keeps the smallest, median, and largest by total input elements and fills the remaining slots with the most frequently called cases, so the selection covers the size range rather than only the hot decode shape. On the default B200 capture this yields 582 benchmarked cases over the 154 operator classes defined in the 133 target tasks.

Input materialization

Floating-point inputs are drawn from a standard normal (FP8 inputs are clamped normals cast to FP8) and masks are all ones. Integer tensors are made valid for the call: cumulative sequence-length vectors are rebuilt as partitions consistent with the query and key token counts, token and position indices are bounded by the vocabulary size and maximum position, expert indices by the expert count, and slot mappings and block tables by the cache they index. Captured non-contiguous layouts are reproduced with the recorded strides. Baseline and candidate share randomly initialized weights; quantized weights (block-scaled FP8, NVFP4, MXFP4) are produced with the model’s own quantization and weight-preparation routines, so kernels see the layouts they would see after checkpoint loading. For data-dependent operators such as MoE dispatch, whose control flow depends on input values (Appendix E), the kernel tier can instead replay golden inputs captured from real end-to-end executions, so that correctness and performance are measured on the tensors the model actually produces. Cases whose inputs the baseline rejects, or whose baseline output is all zeros (so that a stub would pass), are skipped. The all-reduce and row-parallel linear run in an NCCL group spawned with world size equal to the capture’s TP degree, with every rank executing the same seeded cases.

Serving benchmark

Autoregressive L4 throughput uses a mixed-length request mix and a long-context mix against the production server (vLLM, SGLang, or FLA); latency uses single-request (batch 1) and fixed-batch-32 decoding. Each latency measurement is the median of 5 iterations. Non-AR models use family-specific public workloads (Parti-prompts, SEED-TTS-Eval, LibriSpeech, COCO val, Food101, MS MARCO, ALOHA, etc.) as listed in Tables 5 and 6.

Selection

We chose agents to cover the three lines of work that currently produce the strongest kernels. From the KernelBench ecosystem we run Dr. Kernel, one of its most recent agents; of the others we tried, KernelAgent did not reproduce its reported results in our setting, and the rest assume KernelBench’s single-file tasks with a self-contained reference and cannot load production-shaped modules that require configuration objects, KV-cache wrappers, packed quantized weights, or a distributed context. From the MLSys 2026 FlashInfer AI Kernel Generation Contest, whose tasks were drawn from production LLM workloads and scored against FlashInfer’s expert kernels, we run KDA, whose full-agent entry placed first on MoE, second on DSA, and third on GDN, and AKO (its AKO4X harness was adapted by the GEMM People entry, which placed second on MoE), whose release reports beating the FlashInfer expert kernels on 9 of 10 operator families on B200. Finally, we run Claude Code and Codex directly, with no harness. Because KDA and AKO drive the same Claude model as our Claude Code runs (KDA adds a GPT reviewer), comparing them with Claude Code isolates the contribution of the harness.

AlphaEvolve and KernelEvolve are not publicly available. OpenEvolve is, and was the organizers’ agent baseline in the MLSys 2026 contest, but evolutionary frameworks evaluate a population of candidates in every generation, and on FastKernels each evaluation compiles a kernel and benchmarks it on its production-shaped cases (for collectives, on a full tensor-parallel group); their cost per operator therefore scales with population size times the number of generations, on top of the LLM calls that produce each candidate, which puts a 133-operator campaign beyond our budget. The AKO authors also report that, during the contest, search-based methods performed far worse than letting a coding agent optimize kernels directly.