Astra: A Multi-Agent System for GPU Kernel Performance Optimization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wei, Anjiang, Sun, Tianran, Seenichamy, Yogesh, Song, Hang, Ouyang, Anne, Mirhoseini, Azalia, Wang, Ke, Aiken, Alex
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912745255862272
author Wei, Anjiang
Sun, Tianran
Seenichamy, Yogesh
Song, Hang
Ouyang, Anne
Mirhoseini, Azalia
Wang, Ke
Aiken, Alex
author_facet Wei, Anjiang
Sun, Tianran
Seenichamy, Yogesh
Song, Hang
Ouyang, Anne
Mirhoseini, Azalia
Wang, Ke
Aiken, Alex
contents GPU kernel optimization has long been a central challenge at the intersection of high-performance computing and machine learning. Efficient kernels are crucial for accelerating large language model (LLM) training and serving, yet attaining high performance typically requires extensive manual tuning. Compiler-based systems reduce some of this burden, but still demand substantial manual design and engineering effort. Recently, researchers have explored using LLMs for GPU kernel generation, though prior work has largely focused on translating high-level PyTorch modules into CUDA code. In this work, we introduce Astra, the first LLM-based multi-agent system for GPU kernel optimization. Unlike previous approaches, Astra starts from existing CUDA implementations extracted from SGLang, a widely deployed framework for serving LLMs, rather than treating PyTorch modules as the specification. Within Astra, specialized LLM agents collaborate through iterative code generation, testing, profiling, and planning to produce kernels that are both correct and high-performance. On kernels from SGLang, Astra achieves an average speedup of 1.32x using zero-shot prompting with OpenAI o4-mini. A detailed case study further demonstrates that LLMs can autonomously apply loop transformations, optimize memory access patterns, exploit CUDA intrinsics, and leverage fast math operations to yield substantial performance gains. Our work highlights multi-agent LLM systems as a promising new paradigm for GPU kernel optimization. Our code is publicly available at https://github.com/Anjiang-Wei/Astra.
format Preprint
id arxiv_https___arxiv_org_abs_2509_07506
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Astra: A Multi-Agent System for GPU Kernel Performance Optimization
Wei, Anjiang
Sun, Tianran
Seenichamy, Yogesh
Song, Hang
Ouyang, Anne
Mirhoseini, Azalia
Wang, Ke
Aiken, Alex
Distributed, Parallel, and Cluster Computing
Artificial Intelligence
Computation and Language
Machine Learning
Software Engineering
GPU kernel optimization has long been a central challenge at the intersection of high-performance computing and machine learning. Efficient kernels are crucial for accelerating large language model (LLM) training and serving, yet attaining high performance typically requires extensive manual tuning. Compiler-based systems reduce some of this burden, but still demand substantial manual design and engineering effort. Recently, researchers have explored using LLMs for GPU kernel generation, though prior work has largely focused on translating high-level PyTorch modules into CUDA code. In this work, we introduce Astra, the first LLM-based multi-agent system for GPU kernel optimization. Unlike previous approaches, Astra starts from existing CUDA implementations extracted from SGLang, a widely deployed framework for serving LLMs, rather than treating PyTorch modules as the specification. Within Astra, specialized LLM agents collaborate through iterative code generation, testing, profiling, and planning to produce kernels that are both correct and high-performance. On kernels from SGLang, Astra achieves an average speedup of 1.32x using zero-shot prompting with OpenAI o4-mini. A detailed case study further demonstrates that LLMs can autonomously apply loop transformations, optimize memory access patterns, exploit CUDA intrinsics, and leverage fast math operations to yield substantial performance gains. Our work highlights multi-agent LLM systems as a promising new paradigm for GPU kernel optimization. Our code is publicly available at https://github.com/Anjiang-Wei/Astra.
title Astra: A Multi-Agent System for GPU Kernel Performance Optimization
topic Distributed, Parallel, and Cluster Computing
Artificial Intelligence
Computation and Language
Machine Learning
Software Engineering
url https://arxiv.org/abs/2509.07506