EGG: An Expert-Guided Agent Framework for Kernel Generation
Abstract
Lay Summary
Running modern AI models efficiently requires highly optimized GPU programs, but writing and tuning these programs usually takes substantial expert engineering time. This paper presents EGG, a system that uses AI agents to help create faster GPU programs automatically. EGG guides the agents with a step-by-step workflow inspired by how human experts optimize code: first choosing a better overall computation strategy, then tuning how the work is mapped and executed on the target hardware. The system also uses separate helper agents to write code, inspect performance, and fix errors, making the optimization process more stable. Across standard benchmark tasks and real workloads, EGG consistently generates correct programs and achieves substantial speedups over common PyTorch implementations on average. The broader goal is to reduce the manual effort needed to build efficient software for machine learning systems as models and hardware continue to evolve.