Abstract
GEAK (Generating Efficient AI-centric GPU Kernels) is an agentic framework designed to automate the creation of high-performance Triton kernels for AMD GPUs. By employing a multi-agent reasoning loop consisting of Generator, Evaluator, Reflector, and Optimizer agents, GEAK achieves significant improvements in both functional correctness and execution speed. Evaluation on the new ROCm Triton Benchmark and a revised TritonBench suite demonstrates that GEAK achieves up to 63.33% execution accuracy and average speedups of up to 2.59x over reference kernels, significantly outperforming direct prompting of frontier Large Language Models (LLMs).
Introduction
As deep learning models grow in complexity, the demand for hardware-optimized GPU kernels has skyrocketed. However, writing these kernels manually is a "black art" that requires rare expert knowledge of low-level hardware architectures. While LLMs have become proficient at general-purpose coding, they struggle with performance-critical, low-level Domain Specific Languages (DSLs) like Triton. This is especially true for non-CUDA platforms like AMD’s Instinct™ MI300X, where LLMs often lack sufficient training data. Furthermore, existing benchmarks for AI-generated code often focus only on functional correctness, ignoring whether the generated code actually runs efficiently.
The GEAK Framework
GEAK is a modular, agent-based system that treats kernel generation as an iterative engineering process rather than a single-shot completion task. The framework leverages inference-time compute scaling through two axes: sequential scaling (iterative refinement) and parallel scaling (multiple independent attempts).
The Multi-Agent Pipeline
- Generator: Produces the initial Triton code based on a task description and hardware specifications.
- Evaluator: A cascaded tester that first checks for compilation and functional correctness, then profiles the kernel for latency and memory efficiency.
- Reflector: If the code fails, this agent analyzes the error trace to suggest specific fixes.
- Optimizer: If the code is correct but slow, this agent identifies bottlenecks and formulates strategies to improve hardware utilization. Ablation studies show the Optimizer is critical, boosting execution accuracy to 40.76% and achieving a 1.45x speedup compared to versions without it.
Evaluation Benchmarks
The authors introduced two benchmark suites to rigorously test AI-generated Triton kernels:
- TritonBench-revised: A modified version of TritonBench-G containing 184 kernels, updated for AMD GPU compatibility and stricter testing to prevent "false passes."
- ROCm Triton Benchmark: A new suite of 30 real-world kernels sampled from high-profile open-source projects like vLLM, PyTorch, and xformers, including thorough unit tests for edge cases and numerical precision.
Results and Performance
GEAK demonstrates substantial gains over baseline LLM performance. On the ROCm Triton Benchmark, GEAK achieved a 63.33% execution accuracy, whereas direct prompting of frontier models like GPT-4 or Gemini 2.5 Pro resulted in less than 15% accuracy.
On the TritonBench-revised set, GEAK-generated kernels demonstrated an average speedup of up to 2.59x over reference kernels on AMD MI300X hardware. In specific cases, such as a "Flip" kernel, GEAK outperformed expert-written code by 2.26x by optimizing memory access patterns that human experts had overlooked. The system also showed log-linear scaling, where both correctness and performance improved predictably with the number of parallel runs.
Conclusion and Future Work
GEAK proves that an agentic approach with a dedicated optimization loop can bridge the gap between AI-generated code and expert-level performance in specialized domains like GPU programming. While the system is currently dependent on the reasoning capabilities of the underlying LLM, future work aims to integrate automated test case generation to further improve coverage and catch subtle numerical errors that standard unit tests might miss.
Summary updated