Autonomous GPU-kernel discovery & optimizer.
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 can be found at:
| Kernel | Runtime (ms) |
|---|---|
dsa_topk_indexer_fp8_h64_d128_topk2048_ps64— DSA TopK IndexerCopy the template
directory into a separate folder / git repository to make sure your agents work in an isolated environment.
The kernel agent is compatible with FlashInfer format and can run without a local GPU on cloud using Modal. Requires Claude Code CLI.
conda create -n fi-bench python=3.12
conda activate fi-bench
pip install flashinfer-bench modal
modal setup
modal volume create flashinfer-trace
modal volume put flashinfer-trace /path/to/flashinfer-trace/
To get started clone the MLSys-2026 Contest Dataset. To change the kernel you are implementing, please refer to the FlashInfer-Trace - Bring Your Own Kernel guide.
Important
Make sure you update CLAUDE.md
to describe the kernel you are optimizing. The example in template is customized for sparse attention. Also optimize.md
and benchmark.md
has some parameters tuned for sparse attention such as number of test cases to run to get a sanity check. You can ask an agent to help you adjsut them.
To run one iteration,
claude --dangerously-skip-permissions -p "/optimize"
Or you can launch interactive mode by running claude --dangerously-skip-permissions
, selecting the right model, thinking mode and enter /loop Run /optimize every 15 minutes
.
That's it. The loop runs indefinitely, each iteration picks one optimization, benchmarks it, logs an experiment folder, and continues. Stop with Ctrl+C
when you want to step in. As agent struggles to find new optimizations, it will start to change its schedule to be less frequent.
For more details on the agentic loop, please refer to the technical report.
Agents:
- Profiler
- Research
- Workload inspector
| Command | Purpose |
|---|---|
/optimize |
|
| Main loop | |
| `/benchmark <quick | stride N |
| One-shot Modal run | |
/log-experiment |
|
Snapshot + write result.md + update index |
See CLAUDE.md
for rules and .claude/commands/
for full command specs.
solution/triton/sparse_fused.py
— the kernel being optimized (overwritten each iteration)experiments/exp_N/
— snapshot + results for iteration Nexperiments/summary.md
— master index, one row per iterationexperiments/LESSONS.md
— durable cross-experiment findings