← Latest papers
💻 computer science

Xe-Forge: Multi-Stage LLM-Powered Kernel Optimization for Intel GPU

Xe-Forge is a multi-stage, LLM-powered pipeline that automates the porting and optimization of Triton kernels for Intel GPUs by combining a curated knowledge base of hardware constraints with a Chain-of-Verification-and-Refinement agent to iteratively generate, validate, and refine code, achieving significant speedups over PyTorch eager without manual trial-and-error.

Original authors: Marcin Spoczynski, Daniel Fleischer, Moshe Berchansky, Gabriela Ben-Melech Stan, Shira Guskin, Weilin Xu, Adam Siemieniuk, Alexander Heinecke

Published 2026-05-27
📖 5 min read🧠 Deep dive

Original authors: Marcin Spoczynski, Daniel Fleischer, Moshe Berchansky, Gabriela Ben-Melech Stan, Shira Guskin, Weilin Xu, Adam Siemieniuk, Alexander Heinecke

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 have a very talented, world-class chef (the AI) who knows how to cook almost any dish perfectly. But there's a catch: this chef has never cooked in your specific kitchen before. Your kitchen has unique ovens, strange counter heights, and a very particular way of organizing spices that the chef doesn't know about.

If you ask the chef to cook a meal for your kitchen, they might produce a delicious dish, but it won't be the fastest or most efficient version possible because they are using their "standard" techniques instead of your kitchen's specific shortcuts.

Xe-Forge is a new system designed to fix this problem, specifically for Intel GPUs (the "kitchen") and Triton kernels (the "recipes" used in AI).

Here is how it works, broken down into simple concepts:

1. The Problem: The "Copy-Paste" Bottleneck

In the world of AI, developers constantly write code (kernels) to make computers run faster. When they move this code to a new type of computer chip (like Intel's new GPUs), they have to manually tweak the code over and over again. They have to adjust memory access, change how data is grouped, and fix tiny hardware quirks.

It's like a chef having to re-learn how to chop onions every time they move to a new restaurant, even though the onion is the same. This manual work is slow, boring, and creates a bottleneck that stops new AI features from being used.

2. The Solution: Xe-Forge (The "Smart Kitchen Renovation Team")

Xe-Forge is an automated pipeline that takes a recipe that already works (a correct but slow kernel) and automatically rewrites it to be lightning-fast on Intel chips. It doesn't write the recipe from scratch; it takes an existing one and polishes it.

Think of Xe-Forge as a multi-stage renovation team that visits the kitchen and performs nine specific upgrades in a smart order:

  1. Algorithmic Optimization: "Why are we chopping the onion into tiny pieces when a food processor could do it in one go?" (It finds math shortcuts).
  2. Discovery: "Wait, we don't need to cook this step at all; we can skip it entirely." (It finds open-ended ways to remove work).
  3. Dtype Fix: "We are using a giant, heavy pot for a tiny amount of soup. Let's switch to a small, lightweight pan." (It changes data precision to save energy).
  4. Fusion: "Instead of washing the bowl, drying it, and then putting it away, let's just wash and dry it in one motion." (It combines separate steps into one).
  5. Memory Access: "Stop running back and forth to the pantry. Let's organize the spices so you can grab them all at once." (It optimizes how data is fetched).
  6. Block Pointers: "Stop measuring distances with a ruler; use the pre-marked tape measure." (It uses modern, efficient code tools).
  7. Persistent Kernel: "Instead of sending a new worker for every single tile, let's have one team stay and do the whole job." (It reduces setup time).
  8. GPU-Specific Tuning: "This oven runs best at 350 degrees with the fan on high. Let's set that." (It applies Intel-specific rules).
  9. Autotuning: "Let's run a few test batches to find the perfect temperature." (It fine-tunes the settings).

3. The "Brain" and the "Rulebook"

The system uses a Large Language Model (LLM) as its brain, but LLMs are often trained on data from other companies (like NVIDIA) and don't know Intel's specific rules.

To fix this, Xe-Forge uses a Curated Knowledge Base. Think of this as a Rulebook that the chef must follow. It contains specific Intel rules like:

  • "You must use groups of 32 workers, not 24."
  • "The memory blocks must be powers of two."
  • "Don't forget this specific register mode."

Without this rulebook, the AI would guess and likely fail. With it, the AI stays within the "safe zone" of what the hardware can actually do.

4. The "Safety Inspector" (CoVeR Agent)

The system doesn't just guess and hope. It uses a Chain-of-Verification-and-Refinement (CoVeR) agent. This is like a Safety Inspector who checks the work at every step:

  1. Does the code compile? (Can the oven even turn on?)
  2. Is the structure right? (Are the ingredients in the right order?)
  3. Is the result correct? (Does the soup taste the same as the original, just faster?)
  4. Is it actually faster? (Did we save time?)

If the AI makes a mistake, the inspector catches it, tells the AI exactly what went wrong, and the AI tries again. It keeps looping until it finds a version that is both correct and faster.

5. The Results: A Kitchen Transformed

The researchers tested this system on 97 different recipes (kernels) and a complex AI task called Flash Attention (used in large language models) on an Intel Arc Pro B70 GPU.

  • The Average Win: The optimized code was 1.17 times faster on average than the standard unoptimized code.
  • The Big Wins: For 67% of the recipes, it got faster. For 9 specific recipes, it was 5 times to 82 times faster.
    • Analogy: Imagine a recipe that used to take 82 minutes to cook. Xe-Forge found a way to cook it in just 1 minute.
  • Flash Attention: For the complex "Flash Attention" task, the system made it 2 to 13 times faster across all tests, without breaking anything.
  • No Regressions: Crucially, the system never made the code slower in a way that broke the results. If a change didn't help, it kept the original code.

The Bottom Line

Xe-Forge proves that you don't need a super-intelligent AI to solve every problem. Instead, you need a smart, structured process that combines:

  1. A capable AI.
  2. A strict rulebook for the specific hardware.
  3. A rigorous safety inspector to verify every change.

This approach removes the tedious, manual work of porting AI code to new hardware, allowing developers to deploy powerful AI on Intel chips much faster than before.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →