arXiv:2508.20258cs.DCcs.AI2025-08被引 12

让大模型懂硬件,自动优化GPU计算性能

SwizzlePerf: Hardware-Aware LLMs for GPU Kernel Performance Optimization

  • 用大模型结合硬件特性自动设计内存访问优化方案
  • 9个核函数实现最高2.06倍加速,L2缓存命中率提升70%
  • 适合需要极致性能优化的工程师和系统开发者

大型语言模型在GPU内核性能优化中常依赖低效的搜索方法,仅关注运行时表现,缺乏人类工程师实现接近最优利用的关键能力——硬件感知。通过利用工作负载特定的内存访问模式、架构规格、筛选后的性能日志及历史表现反馈,可实现针对底层硬件的软件级优化。SwizzlePerf通过赋予大模型明确的硬件感知能力,自动为去耦合架构上的GPU内核生成空间优化策略。对于一个GEMM内核,SwizzlePerf在5分钟内生成了专家耗时两周才找到的最优分块模式。在10个多样化的机器学习与科学计算内核测试中,该方法成功为9个内核生成分块方案,实现最高2.06倍加速,且L2缓存命中率提升70%。这项工作是构建系统化硬件感知大模型性能工程代理的第一步。

原文摘要 · Abstract (English)

Large language models (LLMs) have shown progress in GPU kernel performance engineering using inefficient search-based methods that optimize around runtime. Any existing approach lacks a key characteristic that human performance engineers rely on for near-optimal utilization -- hardware-awareness. By leveraging the workload's specific memory access patterns, architecture specifications, filtered profiling logs, and reflections on historical performance, we can make software-level optimizations that are tailored to the underlying hardware. SwizzlePerf automatically generates spatial optimizations for GPU kernels on disaggregated architectures by giving LLMs explicit hardware-awareness. For a GEMM kernel, SwizzlePerf takes less than 5 minutes to generate the same hardware-specific optimal swizzling pattern that took expert performance engineers 2 weeks to find. On a suite of 10 diverse ML and Science kernels, SwizzlePerf can generate swizzling patterns for 9 of the kernels that achieve up to a 2.06x speedup and 70% improvement in L2 hit rate. This work is the first of many steps toward systematically creating hardware-aware LLM performance engineering agents.

GPU优化大模型硬件感知性能工程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。