Show HN: Agentic CUDA Kernel Optimizer

https://github.com/bertaye/agentic-cuda-optimizer
Hello; I was working on optimizing some CUDA kernels and I thought may be it is a good oppurtunity learn langgraph as well. I created a simple C++ CUDA Test Harness and handed that to AI agents. They can run kernels, get benchmarks, and even can profile via nsight

Comments

fooblasterSep 25, 2026, 3:30 PM
Can someone explain why this isn't better accomplished through a single prompt to Claude code or codex? I don't think I understand.
bertayeSep 25, 2026, 5:11 PM
Hello, indeed you can just use that.

The basic idea here is just automating and limiting the steps that AI can take. These are described as ‘nodes’ and their actions are limited/more descriptive from developer perspective.

The langgraph simply allows you to set some fences around the AI agent for a goal, instead of raw terminal flow. Is it better? Arguable.

ostiSep 25, 2026, 4:13 PM
Yup, this thing is basically useless. I just did /goal optimize the cuda kernel, and ai agent just proposed and tested a bunch of ideas by itself, and it profiled them using nsight ncu etc. by itself, which lead to one order of magnitude faster kernel.
generalizationsSep 25, 2026, 1:47 PM
Very cool. Did you also try using the karpathy autoresearch? How do you think this compares?
bertayeSep 25, 2026, 2:16 PM
honestly I know it exists but I never used it so can't compare
aidiveytSep 25, 2026, 6:09 PM
in mine, only an agent's final report reaches the orchestrator, never its transcript, so a wrong turn inside a node stays invisible. that's the fence i'd want first.
gradusfyiSep 26, 2026, 7:20 PM
[flagged]
mahi1224Sep 26, 2026, 9:30 PM
[flagged]
lohr13Sep 25, 2026, 1:49 PM
[flagged]
asamadxSep 25, 2026, 12:00 PM
respect for shipping something this technical solo, this is the kind of project that usually needs a team to even validate correctness. how are you handling regression testing across kernel variants, feels like the hardest part of an agentic optimizer isn't finding a faster kernel, it's proving the faster one didn't quietly break something
bertayeSep 25, 2026, 2:15 PM
That is the funny part actually; we can either provide a reference kernel + input cases for correctness check. In this case at first it will use test harness to run reference kernel with reference inputs ad save the outputs as ground truth. Or we can let AI to create a very basic reference implementation and input cases :D for my own experiments I used second one.
saagarjhaSep 25, 2026, 3:36 PM
How are you checking that the AI is not just gaming your correctness tests? It's very easy to write incorrect synchronization for example.
bertayeSep 25, 2026, 5:15 PM
It cant if you be cautious about it because the inputs can set manually and outputs are generated through the cuda harness by executing the reference kernel, again can be provided externally.

Comparison is simply byte by byte equalness check of reference kernel outputs with candidate (optimized) outputs.

Why I added ai generated inputs then? I was just being lazy and this was more of a langgraph playground for me:)

saagarjhaSep 25, 2026, 9:58 PM
Yes, but the AI can totally make a kernel that passes your test inputs but is not correct