MaxKernel uses AI agents to generate optimized TPU kernels

MaxKernel uses AI agents to generate optimized TPU kernels

Writing fast, hardware-specific kernels for accelerators normally takes deep low-level expertise, and researchers behind a new project called MaxKernel argue large language models paired with real-time compiler feedback can take over much of that work. MaxKernel is a multi-agent system built for TPU kernel development that offers three distinct ways of working: a human-in-the-loop (HITL) mode where a person collaborates step by step with the agent on a design; a fully autonomous (Auto) mode that runs a metric and trace driven optimization loop on its own; and a graph-based autonomous search mode that scales the Auto agent up to explore the design space more broadly. All three modes draw on the same pool of specialized sub-agents, which split the work of planning, implementation, self-debugging, testing and hardware profiling. The team tested MaxKernel on JaxBench, a suite of 50 diverse TPU kernel tasks, as well as on real-world workloads pulled from unnamed state-of-the-art open-source models. They report that MaxKernel consistently produces highly optimized kernel implementations that match expert hand-tuned baselines and deliver significant performance across the benchmark, though the abstract does not give specific speedup numbers or percentages for that comparison. The system's code is open-sourced on GitHub under the AI-Hypercomputer organization's accelerator-agents repository.

Key facts

  • MaxKernel implements three paradigms for TPU kernel development: a human-in-the-loop agent, a fully autonomous metric/trace-driven agent, and a graph-based autonomous search that scales the autonomous agent for broader design-space exploration
  • All three paradigms share one pool of specialized sub-agents covering planning, implementation, self-debugging, testing and hardware profiling
  • MaxKernel was evaluated on JaxBench, a suite of 50 diverse TPU kernel tasks, plus real-world workloads from unnamed state-of-the-art open-source models
  • The authors report MaxKernel matches expert hand-tuned baselines and delivers significant performance, without stating specific speedup or accuracy figures
  • The system is open-sourced at github.com/AI-Hypercomputer/accelerator-agents under the MaxKernel directory

Why it matters

Hand-authoring custom kernels for accelerators is a specialist skill that few engineers have, and it is a real bottleneck for squeezing performance out of TPUs. MaxKernel's pitch is that LLM agents, combined with real-time compiler feedback, can close that gap by handling planning, implementation, debugging, testing and profiling automatically, rather than requiring a hardware expert to hand-tune each kernel.

Who it affects

The work is aimed at engineers and teams building on TPUs and the JAX ecosystem, including anyone maintaining performance-critical machine learning workloads who currently relies on manually hand-tuned kernels or on scarce low-level accelerator expertise.

How to use it

MaxKernel's code is open-sourced on GitHub in the AI-Hypercomputer organization's accelerator-agents repository, under the MaxKernel subdirectory. It offers three distinct modes: an interactive human-in-the-loop mode for collaborative, step-by-step kernel design, a fully autonomous mode that runs its own optimization loop, and a graph-based autonomous search mode for exploring a wider design space.

How solid is it

The system was benchmarked on JaxBench, a suite of 50 diverse TPU kernel tasks, and additionally tested on real-world workloads drawn from state-of-the-art open-source models, though those models are not named in the text. The authors state that MaxKernel consistently generates highly optimized implementations that match expert hand-tuned baselines and deliver significant performance across the benchmark, but the abstract does not include specific speedup numbers, percentages, or a breakdown of results.

Risks and caveats

The claims of matching expert baselines and delivering significant performance are qualitative in the source text, with no quantified figures to check them against. The real-world workloads and the open-source models they come from are not identified, and the abstract names no authors, institutions or publication date, so independent verification of the results is limited to what the open-sourced code itself allows.