Kernel Forge Optimizes CUDA Kernels with LLM Agents for Faster AI Models

Joshua Brodsky, Dhravid Kumar, Savini Kashmira, Jayanaka Danatanarayana, Jason Mars, Krisztian Flautner, Lingjia Tang· July 29, 2026 View original

Summary

Kernel Forge is an open-source agentic system that uses large language models and Monte Carlo Tree Search to automatically generate and optimize CUDA kernels for PyTorch models. It significantly boosts performance across vision, diffusion, and LLM workloads, outperforming PyTorch eager mode.

Kernel Forge is a new open-source, end-to-end agentic harness designed to automate the generation and optimization of CUDA kernels using large language models (LLMs). This system addresses the traditional challenge of requiring expert engineers to hand-write low-level GPU code for performance-critical machine learning operations. Kernel Forge can accept any unmodified PyTorch model, supporting a wide range of workloads including vision, diffusion, and LLMs. A key innovation in Kernel Forge is its use of Monte Carlo Tree Search (MCTS) to explore multiple optimization paths, moving beyond simple linear refinement chains. It also provides a graphical user interface for monitoring progress, inspecting candidate kernels, and debugging. Evaluations on an NVIDIA DGX Spark with a GB10 GPU demonstrated significant performance gains, with Kernel Forge optimizing 14 kernels to outperform PyTorch eager mode. It achieved speedups of up to 2.83x on softmax in Gemma 4 E2B and 1.70x on group_norm in Stable Diffusion 3.5 Medium, showcasing its potential to reduce latency and cost in ML deployments.

Why it matters

For AI engineers and product developers, Kernel Forge offers a powerful tool to automatically optimize the performance of machine learning models, leading to faster inference, reduced operational costs, and more efficient resource utilization.

How to implement this in your domain

  1. 1Download and integrate Kernel Forge into your PyTorch development environment.
  2. 2Experiment with Kernel Forge to optimize critical CUDA kernels within your existing ML models.
  3. 3Utilize the graphical user interface to monitor optimization progress and debug generated kernels.
  4. 4Benchmark the performance improvements achieved by Kernel Forge against your current PyTorch eager mode or hand-optimized kernels.

Who benefits

AI DevelopmentCloud ComputingAutonomous VehiclesGamingScientific Research

Key takeaways

  • Kernel Forge uses LLM agents to automatically generate and optimize CUDA kernels.
  • It supports various PyTorch models and workloads, including vision, diffusion, and LLMs.
  • The system employs Monte Carlo Tree Search for robust optimization path exploration.
  • Kernel Forge significantly outperforms PyTorch eager mode, reducing latency and cost.

Original post by Joshua Brodsky, Dhravid Kumar, Savini Kashmira, Jayanaka Danatanarayana, Jason Mars, Krisztian Flautner, Lingjia Tang

"arXiv:2607.24762v1 Announce Type: new Abstract: Machine learning models are increasingly embedded in everyday software, and most of their runtime is spent in a small set of compute kernels such as matrix multiplication, convolution, and normalization. Optimizing these kernels is…"

View on X

Originally posted by Joshua Brodsky, Dhravid Kumar, Savini Kashmira, Jayanaka Danatanarayana, Jason Mars, Krisztian Flautner, Lingjia Tang on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses