Robots Atlas>ROBOTS ATLAS
Evaluation

KernelBench

2025ActivePublished: 30 November 2026Updated: 30 November 2026Published
Key innovation
The first open benchmark that measures not just correctness but the actual speedup of GPU kernels generated by language models, via the fast_p metric that couples functional correctness with a speedup threshold over a reference PyTorch baseline.
Category
Evaluation
Abstraction level
Benchmark
Operation level
Evaluation (runtime)Inference
Use cases
Evaluating language models' ability to generate GPU kernelsMeasuring real speedup (not only correctness) of AI-generated codeResearch on automated code optimization and LLM-assisted compilersComparing models and iterative, execution-feedback refinement strategiesDeveloping agents for GPU performance engineering

How it works

Each task provides a reference PyTorch module (forward pass). The language model generates a replacement GPU kernel for that operation. The evaluation harness first checks correctness by comparing the output against the PyTorch reference on several randomized input sets within a numerical tolerance, then times execution and computes speedup as t_baseline / t_generated (only over correct solutions). Results are aggregated with the fast_p metric: the fraction of tasks for which the kernel is correct and achieves a speedup greater than threshold p (e.g. fast_1 = correct and faster than PyTorch, fast_2 = at least 2x faster, fast_0 = correctness only). Tasks are split into three levels: Level 1 (100 single operators such as matrix multiplies, convolutions, normalizations), Level 2 (100 simple fusion patterns such as conv + bias + ReLU), and Level 3 (50 full model architectures such as MobileNet, VGG, MiniGPT).

Problem solved

Writing fast GPU kernels is hard and time-consuming, and prior evaluations of LLM code generation focused mainly on correctness while ignoring real performance. KernelBench provides a standardized, executable way to measure whether a generated kernel is not only correct but genuinely faster than optimized PyTorch.

Components

250-task suite across three levelsDefines the benchmark task space

250 PyTorch operations split into Level 1 (100 single operators), Level 2 (100 fusion patterns) and Level 3 (50 full architectures). The repository also adds an aspirational Level 4 (20 tasks from HuggingFace architectures, without official baselines).

fast_p metricCouples correctness with performance in a single measure

The fraction of tasks for which a kernel is both correct and achieves a speedup greater than an adjustable threshold p over the PyTorch baseline. fast_1 = correct and faster than PyTorch, fast_2 = at least 2x faster, fast_0 = correctness only. Speedup is computed as t_baseline / t_generated, over correct samples only.

Evaluation harness (correctness + timing)Executes and scores solutions

The mechanism that runs the generated kernel, checks correctness on randomized inputs within a numerical tolerance (e.g. 1e-2), and times execution on a target GPU (the paper reports measurements on an NVIDIA L40S). It supports backends including cuda, triton, cute, tilelang, thunderkittens, and AMD via hip.

Implementation

Implementation pitfalls
Hardware-dependent speedupsMedium

Speedup values depend on the target GPU; the paper's results were measured on an NVIDIA L40S and do not transfer 1:1 to other hardware.

Fix:Always report speedups together with the GPU name and the same baseline.
Baseline sensitivityMedium

Speedup depends on whether the baseline is eager PyTorch or torch.compile; the same metric differs across baselines.

Fix:Fix and explicitly state the baseline (e.g. torch vs torch.compile) when comparing.
Correctness checked empiricallyMedium

Correctness is verified on a finite set of randomized inputs (e.g. 5 sets) with a numerical tolerance (e.g. 1e-2), which is an empirical rather than formal guarantee – a subtly wrong kernel can pass.

Fix:Treat the result as an empirical signal; for critical kernels add your own broader tests.

Evolution

Original paper · 2025 · arXiv:2502.10517 (cs.LG) · Anne Ouyang
KernelBench: Can LLMs Write Efficient GPU Kernels?
Anne Ouyang, Simon Guo, Simran Arora, Alex L. Zhang, William Hu, Christopher Ré, Azalia Mirhoseini
2025
KernelBench released (arXiv:2502.10517)
Inflection point

The Scaling Intelligence Lab (Stanford) publishes the benchmark with 250 PyTorch tasks and the fast_p metric.

2025
Dataset v0.1 – Level 4 added (270 tasks total)

The HuggingFace dataset update (07-2025) adds an aspirational Level 4 with 20 tasks from HuggingFace architectures, without official baselines.

Hyperparameters (configurable axes)

Speedup threshold pCritical

The adjustable speedup threshold in the fast_p metric. Raising p increases benchmark difficulty.

0 (fast_0)
1 (fast_1)
2 (fast_2)
Difficulty levelHigh

Task subset: Level 1 (operators), Level 2 (fusions), Level 3 (full architectures).

Level 1
Level 2
Level 3
Target GPUHigh

The hardware on which speedup is measured; results are hardware-dependent (the paper used an NVIDIA L40S).

NVIDIA L40S
Kernel backend / DSLMedium

The language/DSL of the generated kernel.

cuda
triton
hip (AMD)
Number of samples (pass@k)Medium

Number of attempts per task for pass@k estimation (the blog uses n=100 for pass@1,3,5,10).

100

Hardware requirements

Primary

The benchmark targets GPU kernels (CUDA and related DSLs) and measures their performance on NVIDIA GPUs; it also supports AMD via the hip backend.