Xe-Forge:面向Intel GPU的多阶段LLM驱动的内核优化
Xe-Forge: Multi-Stage LLM-Powered Kernel Optimization for Intel GPU
AI总结:
提出Xe-Forge,一个多阶段LLM流水线,通过Chain-of-Verification-and-Refinement(CoVeR)代理和硬件验证,自动将Triton内核优化为Intel GPU,实现几何平均1.17倍加速,Flash Attention加速2-13.3倍。
摘要:
将深度学习算法移植到新的硬件加速器上,要求开发人员对其代码库中的每个Triton内核重复应用相同的底层优化——量化、内存访问合并、分块大小调整以及特定架构的变通方法。这种手动、重复的工作是一个主要瓶颈:每个内核都需要针对不同设备间变化的硬件约束进行相同的试错分析,而底层的优化模式却基本一致。我们提出了Xe-Forge,一个多阶段LLM驱动的流水线,为Intel GPU自动化这一过程。给定一个功能正确的Triton内核,该系统应用多达九个优化阶段——从算法重构和算子融合,到块指针现代化、GPU特定调优和开放式探索——每个阶段由一个Chain-of-Verification-and-Refinement(CoVeR)代理驱动,该代理生成候选方案,在真实硬件上验证,并对失败进行迭代。一个精心策划的知识库编码了Intel GPU约束(2的幂次线程束计数、GRF模式、SLM大小),这些约束在LLM训练数据中缺失,使模型保持在架构有效范围内。我们在97个Level-2 KernelBench内核和Intel Arc Pro B70上的Flash Attention上评估了Xe-Forge,实现了相对于PyTorch eager的几何平均1.17倍加速,67%的内核得到改进,九个内核超过5倍(最高82倍),并且在所有测试配置下Flash Attention加速2-13.3倍且无回归——这表明结构化领域知识与硬件在环验证可以系统地消除当前阻碍算法在新加速器上部署的重复移植工作。
英文摘要:
Porting deep learning algorithms to new hardware accelerators requires developers to repeatedly apply the same low-level optimizations -- quantization, memory access coalescing, tile size tuning, and architecture-specific workarounds -- to every Triton kernel in their code-base. This manual, repetitive effort is a major bottleneck: each kernel demands the same cycle of trial-and-error profiling against hardware constraints that vary across devices, yet the underlying optimization patterns remain largely consistent. We present Xe-Forge, a multi-stage LLM-powered pipeline that automates this process for Intel GPU. Given a functionally correct Triton kernel, the system applies up to nine optimization stages -- from algorithmic restructuring and operator fusion through block pointer modernization, GPU-specific tuning, and open-ended discovery -- each driven by a Chain-of-Verification-and-Refinement (CoVeR) agent that generates candidates, validates them on real hardware, and iterates on failures. A curated knowledge base encodes Intel GPU constraints (power-of-two warp counts, GRF modes, SLM sizing) that are absent from LLM training data, keeping the model within architecturally valid bounds. We evaluate Xe-Forge on 97 Level-2 KernelBench kernels and Flash Attention on the Intel Arc Pro B70, achieving a 1.17x geometric mean speedup over PyTorch eager with 67% of kernels improving, nine kernels exceeding 5x (up to 82x), and 2--13.3x speedups on Flash Attention across all tested configurations without regression -- demonstrating that structured domain knowledge with hardware-in-the-loop verification can systematically eliminate the repetitive porting effort that currently gates algorithm deployment on new accelerators.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。