HIERA:针对GPU内核优化的跨实现空间工作负载感知规划
文章背景与核心概要
现代深度学习和科学计算极大地依赖于高性能GPU内核。然而,快速演进的GPU硬件与日益多样化的工作负载,使得自动化GPU内核生成与优化面临严峻挑战。现有的基于大语言模型(LLM)的优化技术通常局限于固定的实现空间,这导致它们在优化灵活性或搜索效率上往往鱼与熊掌不可兼得。
为了解决这一局限性,本文提出了 HIERA——一个用于GPU内核优化的分层搜索空间规划框架。HIERA 通过结合契约增强的任务规范、运行时性能剖析(Profiling)反馈以及领域专家知识,能够在 PyTorch 算子、CUDA 库以及自定义 CUDA 内核等多个实现空间中动态选择最合适的方案,从而指导迭代改进。实验表明,HIERA 在实现有效性、样本效率和优化性能方面均超越了现有的免训练(training-free)方法,且在无需任何模型训练的情况下,能够媲美基于训练的 CUDA-L1 方法。此外,它在科学计算的专用模板算子上取得了比 cuDNN 快 \(1.53\times\) 的加速效果,展现出其超越标准机器学习工作负载的广泛应用潜力。
📌 执行摘要 (Executive Summary)
Modern deep learning and scientific computing rely heavily on high-performance GPU kernels. However, rapidly evolving GPU hardware and increasingly diverse workloads make automated GPU kernel generation and optimization a critical challenge.
现代深度学习和科学计算极大地依赖于高性能GPU内核。然而,快速演进的GPU硬件与日益多样化的工作负载,使得自动化GPU内核生成与优化成为一个关键挑战。
Existing Large Language Model (LLM)-based optimization techniques are typically restricted to fixed implementation spaces, which compromises either optimization flexibility or search efficiency. To address this limitation, this paper introduces HIERA, a hierarchical search-space planning framework for GPU kernel optimization.
现有的基于大语言模型(LLM)的优化技术通常被限制在固定的实现空间中,这损害了优化灵活性或搜索效率。为了解决这一局限性,本文介绍了 HIERA,这是一个用于GPU内核优化的分层搜索空间规划框架。
Key Takeaways of HIERA:
* Flexible Implementation Spaces: Dynamically selects the most suitable implementation space across PyTorch operators, CUDA libraries, and custom CUDA kernels.
* Structured Refinement: Combines contract-augmented task specifications, runtime profiling feedback, and expert domain knowledge to guide iterative improvements.
* Superior Efficiency & Validity: Outperforms existing training-free methods in implementation validity, sample efficiency, and optimization performance, while matching the training-based CUDA-L1 method without requiring any model training.
* Scientific Computing Impact: Achieves a \(1.53\times\) speedup over cuDNN on a specialized stencil operator, highlighting its applicability beyond standard machine learning workloads.
HIERA 的核心要点: * 灵活的实现空间: 在 PyTorch 算子、CUDA 库和自定义 CUDA 内核之间动态选择最合适的实现空间。 * 结构化精炼: 结合了契约增强的任务规范、运行时性能剖析反馈以及专家领域知识,以指导迭代改进。 * 卓越的效率与有效性: 在实现有效性、样本效率和优化性能方面优于现有的免训练方法,同时在无需任何模型训练的情况下,性能可媲美基于训练的
CUDA-L1方法。 * 科学计算影响力: 在科学计算的专用模板(stencil)算子上取得了比 cuDNN 快 \(1.53\times\) 的加速效果,突显了其超越标准机器学习工作负载的适用性。
🧭 摘要 (Abstract)
High-performance GPU kernels underpin modern deep learning and scientific computing. As workloads become increasingly diverse and GPU hardware evolves rapidly, developing efficient methods for automated GPU kernel generation and optimization has become increasingly important. Existing LLM-based methods typically optimize within a fixed implementation space, limiting either optimization flexibility or search efficiency. We propose \(\text{HIERA}\), a hierarchical search-space planning framework for GPU kernel optimization. \(\text{HIERA}\) constructs contract-augmented task specifications, selects an appropriate implementation space across PyTorch operators, CUDA libraries, and custom CUDA kernels, and uses profiling feedback and expert knowledge to guide structured iterative refinement. Experiments on KernelBench across multiple various workload levels and base LLMs show that \(\text{HIERA}\) delivers stronger overall implementation validity, sample efficiency, and optimization performance than existing training-free methods, while remaining competitive with the training-based CUDA-L1 without additional model training. A case study on a specialized stencil operator from scientific computing further achieves a \(1.53\times\) speedup over cuDNN, demonstrating the potentiality of the general framework beyond standard machine-learning workloads.
高性能 GPU 内核是现代深度学习和科学计算的基石。随着工作负载日益多样化以及 GPU 硬件的快速演进,开发高效的自动化 GPU 内核生成与优化方法变得愈发重要. 现有的基于 LLM 的方法通常在固定的实现空间内进行优化,从而限制了优化灵活性或搜索效率。为此,我们提出了 \(\text{HIERA}\),这是一个用于 GPU 内核优化的分层搜索空间规划框架。\(\text{HIERA}\) 构建了契约增强的任务规范,能够在 PyTorch 算子、CUDA 库和自定义 CUDA 内核中选择合适的实现空间,并利用性能剖析反馈和专家知识来指导结构化的迭代精炼。在 KernelBench 跨多个不同工作负载级别和基础 LLM 的实验表明,与现有的免训练方法相比,\(\text{HIERA}\) 提供了更强的整体实现有效性、样本效率和优化性能,同时在无需额外模型训练的情况下,依然能够与基于训练的 CUDA-L1 保持竞争力。针对科学计算中专用模板算子的案例研究进一步实现了比 cuDNN 快 \(1.53\times\) 的加速,证明了该通用框架在标准机器学习工作负载之外的潜力。
📋 元数据与附加链接 (Metadata & Additional Links)
- Primary Subject: Distributed, Parallel, and Cluster Computing (
cs.DC) - Secondary Subjects: Artificial Intelligence (
cs.AI) - DOI: 10.48550/arXiv.2608.21157
- Full-Text & Resources:
- View PDF
- HTML Version (Experimental)
- TeX Source
- External Citations & Tools:
- Google Scholar
- Semantic Scholar
- NASA ADS
- 主要主题: 分布式、并行与集群计算 (
cs.DC)- 次要主题: 人工智能 (
cs.AI)- DOI: 10.48550/arXiv.2608.21157
- 全文与资源:
- 查看 PDF
- HTML 版本(实验性)
- TeX 源码
- 外部引用与工具:
- Google Scholar
- Semantic Scholar
- NASA ADS