---
name: iterate-on-cuda-kernels-using-benchmark-and
description: "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."
license: CC-BY-4.0
compatibility: "Needs access to: Terminal, GitHub, Docs."
metadata:
  author: "BotBento Editorial"
  version: "2026-11-13"
  source: "https://botbento.com/usecases/iterate-on-cuda-kernels-using-benchmark-and/"
  kind: workflow
  hermes:
    tags: ["cuda", "benchmarking", "profiling", "gpu", "optimization"]
    category: coding
---
# Iterate on CUDA kernels using benchmark and profiler feedback

Proposes faster kernel variants and checks they still pass.

## When to use

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.

## Steps

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

## Instructions

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.

## Source

Summarized in our own words from [Show HN: Agentic CUDA Kernel Optimizer](https://news.ycombinator.com/item?id=49842596) (Hacker News, checked 2026-11-13). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/iterate-on-cuda-kernels-using-benchmark-and/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
