Canonical: https://botbento.com/usecases/iterate-on-cuda-kernels-using-benchmark-and/
Format: Markdown representation of the public HTML page.

# Iterate on CUDA kernels using benchmark and profiler feedback

[Coding](https://botbento.com/usecases/coding/) · Advanced

Proposes faster kernel variants and checks they still pass.

A bot takes a GPU kernel and a small test harness, compiles candidate variants, measures runtime, and reads profiler output. It iterates toward faster versions. It reruns existing correctness checks on every candidate so speed gains are not accepted at the cost of broken results. Each round ends with a short comparison and a proposed patch for a human to review.

## Quick answers

**What does it do?** Proposes faster kernel variants and checks they still pass. Result: Candidate patch with results.

**What does it need?** Tools: GitHub, Terminal, Docs. Advanced: more tools and setup.

**How do I run it?** When you ask: Request kernel optimization. Copy the prompt below into a bot in BotBento.

## How it works

1. When you ask: Request kernel optimization
2. Then: Benchmark and profile variants
3. Result: Candidate patch with results

## Prompt to start with

```text
You help optimize GPU kernels inside a scratch working copy of the repository. When the user points you at a kernel file and a build harness, compile it, record baseline timings over several runs, and capture profiler output. Then propose one change at a time, rebuild, and measure again under the same conditions. After every candidate, run the existing correctness and regression checks before reporting anything. Keep a results table of variant, timing, and pass or fail. Present the best candidate as a diff with its measurements and the tradeoffs you observed. Never commit, push, merge, or delete files, and never post results anywhere, until the user explicitly approves; ask first and wait.
```

## Tools it uses

Terminal, GitHub, Docs

## Works with

BotBento

## Tags

cuda, benchmarking, profiling, gpu, optimization

## Source

[Show HN: Agentic CUDA Kernel Optimizer](https://news.ycombinator.com/item?id=49842596) — Hacker News · checked 2026-11-13

Summarized in our own words. Any results described there are the authors’ own, not measured by BotBento.

By BotBento Editorial · Added 2026-11-13 · Updated 2026-11-13 · [Suggest a correction](https://botbento.com/contact/)

## Related use cases

- [Refactoring code to satisfy strict size constraints](https://botbento.com/usecases/refactoring-code-to-satisfy-strict-size-constraints/) — Analyze code to reduce binary footprint while preserving logic and competitive performance.
- [GPU cluster job resource optimizer](https://botbento.com/usecases/gpu-cluster-job-resource-optimizer/) — Right-size cluster compute allocations and catch resource crashes before batch jobs run
- [Optimizing speech model configurations for voice agents](https://botbento.com/usecases/optimizing-speech-model-configurations-for-voice-agents/) — Evaluate speech models and benchmarks to maintain low-latency, cost-effective voice stacks
