用大模型自动优化Intel GPU上的深度学习内核,提升性能并减少人工调优。
Xe-Forge: Multi-Stage LLM-Powered Kernel Optimization for Intel GPU
- 分多阶段使用大模型生成并验证优化方案,结合硬件实测反馈迭代改进。
- 在97个基准内核上实现1.17倍平均加速,67%的内核性能提升,部分超5倍。
- 适合需要快速部署算法到Intel GPU的新手或追求极致性能的研发人员。
将深度学习算法移植到新型硬件加速器需反复进行低层优化——量化、内存访问合并、分块大小调优及架构特有绕行。此类手动重复工作是主要瓶颈:每个内核都需经历试错式性能测试以适配不同设备,但优化模式基本一致。本文提出Xe-Forge,一个面向Intel GPU的多阶段大模型驱动优化流水线。给定功能正确的Triton内核,系统通过最多九个优化阶段(从算法重构、操作融合到块指针现代化、GPU特定调优及开放式探索)完成自动化优化,每个阶段由链式验证与精炼(CoVeR)代理执行:生成候选方案、在真实硬件上验证、失败则迭代修正。一个精心构建的知识库编码了Intel GPU约束(如2的幂次线程组数、GRF模式、SLM大小),这些信息未包含在大模型训练数据中,确保生成结果符合架构规范。我们在97个Level-2 KernelBench内核和Flash Attention上评估Xe-Forge,于Intel Arc Pro B70上实现相比PyTorch eager的1.17倍几何均值加速,67%的内核性能提升,9个内核超过5倍加速(最高达82倍),所有测试配置下Flash Attention提速2–13.3倍且无退化现象,证明结合结构化领域知识与硬件在环验证,可系统性消除当前制约新加速器算法部署的重复移植负担。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。