Stanford Scaling Intelligence Lab Improves AMD HIP Kernel Generation with Multi-Agent AI and Reinforcement Learning
Key Takeaways
- ▸Stanford's multi-agent pipeline uses synthetic data generation and eight cooperating agents to create verified HIP kernels, addressing the data scarcity problem that causes LLMs to hallucinate AMD APIs and fail compilation
- ▸The combination of supervised fine-tuning and GRPO-based reinforcement learning on open-source models achieves measurable gains in compilation and correctness on AMD MI350X GPUs
- ▸While functional correctness improved significantly, achieving performance speedup over native PyTorch requires deeper hardware awareness and ROCm profiler-based reward signals
Summary
Researchers at Stanford University's Scaling Intelligence Lab have developed a novel approach to improve HIP kernel generation for AMD GPUs, addressing a critical gap in AI-assisted code generation. While large language models excel at generating NVIDIA CUDA kernels, they struggle with AMD's HIP language due to limited training data and higher error rates. The team created a multi-agent pipeline powered by Google's Gemini-2.5-Flash that generates 500 synthetic PyTorch reference tasks through mutation, composition, and constraint-based generation. The approach employs specialized agents for task generation, PyTorch-to-HIP translation, hardware evaluation, and evolutionary optimization. They trained an open-source model (Qwen2.5-Coder-14B-Instruct) using supervised fine-tuning followed by GRPO-based reinforcement learning on AMD's MI350X GPUs. Results show improvements in compilation and correctness rates across all KernelBench levels, though achieving meaningful performance speedup still requires deeper hardware profiling integration.
- This research highlights a growing asymmetry in AI-assisted kernel generation across GPU ecosystems, with implications for AMD's competitive position in production AI clusters
Editorial Opinion
This research demonstrates both the potential and limits of applying LLMs to hardware-specific code generation. The multi-agent synthetic data approach is ingenious—using evolutionary search and correctness gates to bootstrap training data where none exists. However, the gap between 'compiles and runs correctly' and 'runs fast' is revealing. The team's planned integration of ROCm profiler feedback is crucial; without hardware-specific rewards, LLMs remain shallow optimizers of syntax, not semantics. This work could be transformative for AMD's ecosystem if the profiler feedback loop delivers on its promise.



