PreprintCited by 2Parallel Computing and Optimization TechniquesSoftware Engineering ResearchNatural Language Processing Techniques

KernelBench: Can LLMs Write Efficient GPU Kernels?

Open access
Ouyang, Anne, Guo, Simon, Arora, Simran, Zhang, Alex L., Hu, William, Ré, Christopher, Mirhoseini, Azalia·2025·arXiv

Abstract

Efficient GPU kernels are crucial for building performant machine learning architectures, but writing them is a time-consuming challenge that requires significant expertise; therefore, we explore using language models (LMs) to automate kernel generation. We introduce KernelBench, an open-source framework for evaluating LMs' ability to write fast and correct kernels on a suite of 250 carefully selected PyTorch ML workloads. KernelBench represents a real-world engineering environment and making progress on the introduced benchmark directly translates to faster practical kernels. We introduce a new evaluation metric fast_p, which measures the percentage of generated kernels that are functionally correct and offer a speedup greater than an adjustable threshold p over baseline. Our experiments across various state-of-the-art models and test-time methods show that frontier reasoning models perform the best out of the box but still fall short overall, matching the PyTorch baseline in less than 20% of the cases. While we show that results can improve by leveraging execution and profiling feedback during iterative refinement, KernelBench remains a challenging benchmark, with its difficulty increasing as we raise speedup threshold p.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2502.10517

Cites

Statistics

Recomputing p-values needs the paper’s full text.

Claims the paper makes

We couldn’t retrieve this paper’s full text, so its claims and self-check weren’t run. The registry and citation checks still apply.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • The original KernelBench protocol completely ignores whether generated kernels increase peak GPU memory consumption.

    “yet the original KernelBench protocol completely ignores whether generated kernels increase peak GPU memory consumption.”

    From KernelBench-Verified: Do LLM-Generated Kernels Actually Beat PyTorch? (2026) · cites this paper as Ouyang et al., 2025

  • KernelBench provides a standardized benchmark comprising 250 kernel programming problems of varying difficulty.

    “KernelBench (Ouyang et al., 2025) provides a standardized benchmark comprising 250 kernel programming problems of varying difficulty”

    From KernelBench-Verified: Do LLM-Generated Kernels Actually Beat PyTorch? (2026) · cites this paper as Ouyang et al., 2025

  • The original KernelBench framework measures generated kernels against standard PyTorch that executes in float32 mode.

    “The original KernelBench framework measures generated kernels against standard PyTorch that executes in float32 mode.”

    From KernelBench-Verified: Do LLM-Generated Kernels Actually Beat PyTorch? (2026) · cites this paper as Ouyang et al., 2025

  • The standard KernelBench evaluation uses eager mode.

    “the standard KernelBench evaluation uses eager mode”

    From KernelBench-Verified: Do LLM-Generated Kernels Actually Beat PyTorch? (2026) · cites this paper as Ouyang et al., 2025

  • Following the KernelBench protocol, the baseline executes the original PyTorch implementation in eager mode.

    “Following the KernelBench protocol (Ouyang et al., 2025), our baseline executes the original PyTorch implementation in eager mode, the default execution mode where each operator dispatches a separate CUDA kernel immediately.”

    From KernelBench-Verified: Do LLM-Generated Kernels Actually Beat PyTorch? (2026) · cites this paper as Ouyang et al., 2025

No citation lists for this paper

No citation lists for this paper yet — checked again daily.

Cited by 2

Authors
Ouyang, A., Guo, S., Arora, S., Zhang, A. L., Hu, W., Ré, C., & Mirhoseini, A.
Venue
arXiv
Publisher
arXiv
Published
2025
ISSN
2331-8422 (ISSN-L)
OpenAlex
W4407683692
Cited by
2
References
0
Citations by year
2026: 2
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University) (cc-by)
Topics
  • Physical Sciences › Computer Science › Hardware and Architecture › Parallel Computing and Optimization Techniques
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
Keywords
large language models, automatic code generation, benchmark, iterative refinement, machine learning model performance

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review