🤖 AI Summary
Automatically generating GPU kernels that are both correct and high-performing remains a significant challenge, as existing large language models often struggle to balance these competing objectives. This work proposes a diagnostic-driven evolutionary optimization framework that iteratively refines kernels through collaborative multi-expert initialization, multi-island evolutionary search, and structured diagnostic feedback. To enhance robustness and knowledge transfer, the approach incorporates anti-cheating mechanisms and a centralized experience repository for accumulating and reusing optimization insights. Evaluated on KernelBench, the method substantially outperforms strong baselines, achieving 100% correctness on Level 2 tasks while significantly improving performance.
📝 Abstract
Generating high-performance GPU kernels remains challenging due to the need for both correctness and hardware-aware optimization. While large language models (LLMs) show promise in code generation, they often fail to produce kernels that are both correct and efficient. We propose Kernel Foundry, a diagnosis-driven evolutionary framework for automatic GPU kernel optimization. Our method combines expert-guided, retrieval-augmented initialization with a multi-island evolutionary search, where candidate kernels are iteratively refined using structured diagnostic feedback. A centralized experience library accumulates reusable optimization knowledge to guide subsequent evolution, while explicit mechanisms prevent cheating behaviors that bypass kernel-level computation. Experiments on KernelBench show that our method consistently improves both correctness and performance over strong baselines, achieving up to 100% correctness on Level~2.