GPU Forecasters: Language Models as Selective Surrogates for Kernel Runtime Optimization
This paper proposes using language models as selective, reinforcement-learning-enhanced surrogates to forecast GPU kernel performance, thereby reducing costly on-device evaluations and enabling the discovery of faster kernels within limited measurement budgets.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to find the fastest route through a massive, complex maze. In the world of computer chips (GPUs), this "maze" is a piece of code called a kernel that tells the chip how to do math. Finding the absolute fastest version of this code is crucial for making AI run quickly, but it's incredibly expensive.
The Problem: The "Real-World" Test is Too Slow
Right now, to see if a new piece of code is fast, you have to:
- Write the code.
- Compile it (translate it into machine language).
- Run it on a real, expensive graphics card (GPU).
- Measure how long it took.
This process is like testing a new car design by actually building the car, driving it on a track, and timing it. It takes a long time and costs a lot of money. If you want to test 1,000 different designs, you have to build and drive 1,000 cars. This slows down the search for the best design.
The Solution: The "Virtual" Test Driver
The authors of this paper propose using a smart AI (a Large Language Model or LLM) to act as a predictor or a surrogate. Instead of building and driving every single car, you ask the AI: "Based on the blueprints of this new car design, how fast do you think it will go compared to the old one?"
The AI looks at the code and tries to guess the speed.
- The Catch: The AI isn't perfect. Sometimes it guesses wrong.
- The Fix: The paper teaches the AI to be honest about its uncertainty. It's like a weather forecaster who says, "I'm 90% sure it will rain," versus one who says, "I have no idea, but I'll guess."
How It Works: The "Selective" Strategy
The researchers created a system where the AI acts as a filter:
- Confident Guesses: If the AI is very confident in its prediction (e.g., "This new code will definitely be 2x faster"), the system accepts the guess and skips the expensive real-world test.
- Uncertain Guesses: If the AI is unsure (e.g., "It might be faster, or it might be slower"), the system says, "Okay, we don't trust that guess yet," and sends the code to the real GPU for a physical test.
This is called a Selective Surrogate. It's like a hiring manager who interviews 100 candidates. For the obvious top-tier and bottom-tier candidates, the manager makes a quick decision based on the resume. But for the "maybe" candidates, they schedule a full, expensive in-person interview.
The Training: Teaching the AI to be a Better Coach
The paper shows that they can make this AI predictor even better using Reinforcement Learning (a type of training where the AI gets points for being right and loses points for being overconfident when wrong).
- They taught the AI not just to guess the speed, but to spread its "uncertainty" correctly.
- Result: The AI learned to say, "I'm not sure about this one," more often when it was actually unsure, and to be more confident when it was right. This made the system much more reliable.
The Results: Finding Faster Kernels Faster
When they put this system to work:
- Efficiency: They could look at four times as many code candidates using the same amount of time and money. Instead of testing 100 designs on the real GPU, they could test 100 on the AI and only send the top 25 to the real GPU.
- Performance: Because they could look at more options, they found faster code than systems that only used the real GPU.
- Discovery: The AI was surprisingly good at spotting "breakthrough" moments—times when a small change in code made a huge difference in speed.
In Summary
This paper introduces a "virtual test driver" for computer chips. By using an AI to predict which code designs are likely to be fast, and only physically testing the ones the AI is unsure about, we can search for better software much faster and cheaper. The AI doesn't replace the real test; it acts as a smart gatekeeper, saving the expensive real-world tests for the moments that matter most.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.