Optimize CUDA kernels with agents that benchmark and profile
AI agents run a C++ CUDA test harness, get benchmarks, and profile with Nsight to optimize kernels, built with LangGraph.
Done withLangGraph
- What they did
- The user gives a workload description, or supplies their own signature, reference, kernel and input cases. A LangGraph agent proposes kernel and launch-config changes. A C++ harness compiles them with NVRTC and runs them through the CUDA Driver API. Python checks outputs against NumPy and times each candidate. Failed candidates get repaired within the iteration budget. Optional flags add Nsight Compute profiling and NVIDIA documentation research.
- How it went
- The README shows float32 GEMM runs on an RTX 3060 Laptop GPU, with a second run continuing from the first run's best kernel. It states no speedup numbers, and no comparison against cuBLAS.
- Worth knowing
- Generated input scripts run unsandboxed on your machine and API usage (default gpt-5-mini) is billed to you. A generated reference is not an independent check of correctness.
Try it yourself with Claude Code
Optimize the CUDA kernel in [file path] for [operation, e.g. matrix multiply]. Build a test harness that checks correctness, benchmark the baseline, profile it with Nsight, and try improvements one at a time, keeping only those that pass the correctness check. Stop when you have a faster version and a table of each change with its speedup.
Discussion on HN · Sep 25, 2026
Five of these in your inbox every morning
The best things people got an AI agent to do, each with the prompt to try it.
More like this
- Claude
Build a C compiler with a team of parallel agents
Anthropic's engineering write-up on tasking Opus 4.6 agent teams with building a C compiler.
- Custom agent
Catch cloud outage risks before they happen
An autonomous ReAct agent that queries real data to stop cloud outages before they occur, built for the Sanity Challenge.
Hand narrow code changes to Devin for pull requests
A team used Devin for a month on small fixes like chart formatting and API edge cases, with tests and PRs; a complex full-stack task went poorly.
Migrate toolchain, architecture and site design with Claude Code
A developer had Claude Code switch a monorepo to oxlint/oxfmt, restructure the architecture and redesign a site, validating in a loop; the redesign took days instead of weeks.
Build and deploy a Game of Life simulation site
In a vendor launch demo, Devin built an interactive Game of Life website, added requested features step by step, and deployed it to Netlify.
Resolve a Slack-reported issue with a coding agent
A Codex agent resolved an issue passed to it in about 40 minutes, and an ops agent verified the fix back in Slack.