@dogacel0: 4 months after its initial release, "auto-gpu-kernel" version 1.0 is finally out! It is a fully autonomous kernel gener…
Summary
Auto-GPU-Kernel version 1.0 is released, an autonomous GPU kernel generation and optimization tool that ranked first in the MLSys 2026 FlashInfer AI Kernel Generation Contest with a 34.93x average speedup.
View Cached Full Text
Cached at: 09/16/26, 07:56 AM
4 months after its initial release, “auto-gpu-kernel” version 1.0 is finally out!
It is a fully autonomous kernel generation “meta-harness” that evolves both the kernel and the harness layer, generating speed-of-light kernels 🧵
https://t.co/CxlLrRBpYM
Dogacel/auto-gpu-kernel
Source: https://github.com/Dogacel/auto-gpu-kernel
Auto GPU Kernel 🏆
Autonomous GPU-kernel discovery & optimizer. Supports flashinfer format and a custom format that builds its own harness around any natural language task against a given git repository.
Ranked #1 on MLSys 2026 - FlashInfer AI Kernel Generation Contest for the DeepSeek Sparse Attention (DSA) track with an average speedup of 34.93x. Submissions + optimized kernels can be found at archive.
kopttool runs the optimization agent.kbenchtool owns validation, benchmarks, and agent history.
Why use auto-gpu-kernel over other harnesses or
/goal?
auto-gpu-kernelis designed by discovering kernel-engineering best practices for agents over months of effort and research during FlashInfer kernel generation contest. It addresses common pitfalls of agents such as believing noisy results to be improvements or missing various optimizations due to measurement noise. Surely the research and optimization loop can be more fancy i.e. by adding many sub-agents, but my experience has shown those things matter less, as long as there is a robust validation pipeline for agent’s solution and the speed-up. Other harnesses usually fail on setting a good verification pipeline, the agents either hack it over-time, or they get stuck at local-minimums.My design motto is: “Don’t include any long instructions generated by AI. Those can be generated by AI itself over-time with enough attempts. Only give the key principles the agent needs to follow, so the agent knows what really matters.”
Install
You need Python 3.11+, uv, and OMP.
uv venv --python 3.12
source .venv/bin/activate
# Arbitrary local repositories
uv pip install -e ".[agent]"
# FlashInfer: choose local on Linux with a GPU, or Modal from any machine
# uv pip install -e ".[agent,local]"
# uv pip install -e ".[agent,modal]"
Make sure omp + your model provider is ready.
omp
Run a FlashInfer kernel
Download a trace set:
git lfs install
git clone https://huggingface.co/datasets/flashinfer-ai/mlsys26-contest
If using a cloud provider, upload it:
modal setup
modal volume create flashinfer-trace
modal volume put flashinfer-trace ./mlsys26-contest/
Create a project and run three iterations:
kopt init ./mlsys26-contest/definitions/dsa_paged/dsa_topk_indexer_fp8_h64_d128_topk2048_ps64.json \
--backend modal --gpu B200
cd work/dsa_topk_indexer_fp8_h64_d128_topk2048_ps64
kbench bench --quick
kopt run . -n 3 --model anthropic/claude-opus-5 --thinking low
Useful benchmark commands:
kbench bench --quick # smallest and largest workload
kbench bench --stride 2 # half of the workloads
kbench bench # full run
kbench ab --a experiments/exp_3/solution_fused.py
Development
examples/mlx-attention/ is a small naive MLX attention with tests and a benchmark.
configs/mlx_attention.toml targets it, so you can exercise the whole task-mode loop on
Apple Silicon with no remote repo or GPU cloud:
uv pip install mlx pytest
kopt init-task configs/mlx_attention.toml
kopt run work/mlx-attention -n 5 --model anthropic/claude-opus-5 --thinking low
The first run spends one setup turn generating harness/, measures the pristine
baseline (about 2.7 ms geomean on an M4 Pro; the fused mx.fast op does it in ~0.9 ms),
then starts optimizing attention.py.
Run against any Git repository
Write a short task.toml. Describe the job in plain language; the setup agent will
inspect the repository and build the benchmark harness.
[task]
name = "my-project"
workdir = "repo"
objective = """
Speed up inference without changing the public API or model outputs.
The optimizer may change code below src/runtime/.
"""
measure = """
Measure end-to-end latency for the representative example in examples/serve.py.
Lower latency is better. Include warmup and synchronize the GPU before timing.
"""
validate = """
Run the existing correctness tests and compare the example's output with the untouched
repository. Outputs must match exactly.
"""
hints = "Start with allocations and repeated kernel launches in the decode loop."
[task.repo]
url = "[email protected]:my-org/my-project.git"
base = "main"
branch = "me/auto-optimize"
# or, for a plain local directory (relative to this file), snapshotted as a fresh repo:
# path = "../my-project"
[task.hardware]
gpus = 1
gpu = "H100"
The setup agent implements the generated-task adapter by writing harness/validate.py and harness/benchmark.py before the first run. Generated-task adapters currently run on the local machine, so the target repository’s dependencies and any required GPU must be available there.
Then scaffold and run:
kopt init-task task.toml # creates work/<task.name>
kopt run work/my-project -n 20 --model anthropic/claude-opus-5 --thinking low
On the first run, kopt uses one setup turn to inspect the untouched clone and generate the validation and benchmark adapters. Kbench then runs pristine quick and full baselines. The 20 requested optimization iterations begin after setup.
To inspect or rerun what the setup agent made:
cd work/my-project
cat harness/README.md
kbench bench --quick # quick validation + quick measurement
kbench bench # full validation + metric of record
kbench ab --a <git-ref> # same current harness for A and B
Watch a run
kopt watch .
Open http://127.0.0.1:8765.
config.toml human task brief
harness/validate.py generated quick/full correctness adapter
harness/benchmark.py generated quick/full measurement adapter
harness/prepared.json pristine baseline metadata
.omp/ project-local agent instructions
.kopt/runs/ agent logs
.kopt/bench.jsonl benchmark history
experiments/ experiment notes and snapshots
Architecture
FlashInfer and arbitrary repositories use the same BenchmarkAdapter:
FlashInferAdapterpackages kernel sources and sends them through a local or Modal execution backend.GeneratedTaskAdapterruns the repository-specific validation and benchmark scripts created by the setup agent.- Kbench supplies quick/full execution, normalized measurements, history, and paired A/B for both adapters.
See kbench/README.md and kopt/README.md for the small class diagrams.
Similar Articles
@seclink: A bit interesting, learn a bit...
Version 1.0 of auto-gpu-kernel has been released, a meta-harness tool that autonomously generates high-performance GPU kernels.
@levidiamode: 163/365 of GPU Programming Looking at a few different agentic GPU kernel optimization systems today. The two I'm most i…
A tweet discussing two agentic GPU kernel optimization systems: Auto GPU Kernel by @dogacel0 and Kernel Design Agents from @songhan_mit's lab, both winners at the MLSys Sparse Attention FlashInfer competition. The thread highlights different approaches using subagents and Claude skills for GPU programming.
Auto-research with codex: How I achieved a 232x Faster Kernel
A blog post detailing how the author used Codex to optimize a kernel in a GPU Mode contest, achieving a 232x speedup in QR decomposition and sharing learnings on auto-research.
@Akashi203: i open-sourced automegakernel -- compiles any huggingface model into a single persistent megakernel batch-1 decode is b…
AutoMegaKernel is an open-source agent harness that compiles any HuggingFace model into a single persistent megakernel, fusing the entire forward pass into one GPU launch to reduce overhead. It achieves up to 1.33x speedup over CUDA-graphed cuBLAS on inference-class GPUs like L4 and L40S, while proving schedules deadlock- and race-free.
@liao_lucas: https://x.com/liao_lucas/status/2097149853499588971
This article provides an introduction to GPU kernels in the context of AI inference and performance engineering, explaining their definition, how they are used, and the advantages of custom kernels for optimization.