Urgent.News

What's breaking now, across thousands of outlets.

AI

Show HN: Agentic CUDA Kernel Optimizer

Agentic CUDA kernel optimizer unveiled, transforming workload descriptions into GPU implementations through an automated process. This system, built with LangGraph, employs an agent to explore kernel implementations and launch configurations, while also querying GPU properties and researching NVIDIA documentation for optimization insights.

Experiment results are recorded, and the quickest validated implementation is kept for future use. The model can modify both kernel code and launch configurations. A C++ harness compiles kernels using NVRTC, launches them via the CUDA Driver API, and stores outputs. Python is responsible for comparison and candidate selection. Each case must pass validation, and ranking is based on the geometric mean of latency across performance cases, with correctness cases not impacting the score.

Timings exclude compilation time and profiler replay timings. Developed on Windows with an RTX 3060 Laptop GPU, the optimizer requires Python 3.12+, an NVIDIA GPU, compatible CUDA Toolkit/driver, CMake 3.24+, a C++17 compiler, and an OpenAI API key. Build commands utilize Visual Studio 2026 with C++ tools installed. The default model is gpt-5-mini with medium reasoning effort, and usage is billed to the account.

The optimizer can be customized with --signature, --reference, --initial-kernel, and --input-cases, with omitted components inferred or generated. Saved inputs allow continuation from earlier runs. The optimization is focused on individual kernels, and passing supplied cases doesn't guarantee general correctness. Generated reference code isn't an independent correctness oracle, and improvements depend on the workload.

The optimizer is experimental and doesn't compare against cuBLAS or other vendor libraries. Generated input scripts run locally as Python subprocesses, while generated CUDA kernels execute on the local GPU. A LangGraph workflow with Nsight profiling enabled is visualized in a graph, with conditional routes represented by dashed edges. Without --use-nsight, evaluation routes bypass NVIDIA research unless --nvidia-research is set.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at github.com →

More in AI

10 Friday AM Reads

My end-of-week morning reads: • Tokens Too Cheap to Meter. The price of using machine learning intelligence is decreasing by several orders of magnitude a year and shows no signs of slowing.

More from Friday 25 September →