Manuscript Offprint

arXiv:2608.21157

HIERA: Workload-Aware Planning Across Implementation Spaces for GPU Kernel Optimization

Jinghao Wang, Qiqi Gu, Chenpeng Wu, Jianguo Yao, Haibing Guan, Xijun Li

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 HIERA, a hierarchical search-space planning framework for GPU kernel optimization. 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 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×1.53\times speedup over cuDNN, demonstrating the potentiality of the general framework beyond standard machine-learning workloads.

Introduction

High-performance GPU kernels form a critical foundation of modern deep learning and scientific computing systems (Chen et al. 2018; Zheng et al. 2020). To simplify GPU programming, vendor libraries and framework primitives, such as cuBLAS, cuDNN, and PyTorch operators, provide optimized implementations for common computation patterns (NVIDIA Corporation 2026; Chetlur et al. 2014; Paszke et al. 2019). By encapsulating widely used kernels and established optimization strategies, these abstractions substantially reduce the effort required for GPU kernel development and optimization (Chetlur et al. 2014; Paszke et al. 2019). However, relying exclusively on these abstractions remains insufficient. Rapid hardware evolution makes optimized implementations costly to maintain and retune across architectures (Chetlur et al. 2014; Chen et al. 2018; Zheng et al. 2020), while fixed library primitives cannot adequately

Figure

Figure 1: Comparison of prior methods operating within fixed implementation spaces and our proposed HIERA's workload-aware cross-granularity planning.

cover the growing diversity of specialized workloads, such as complex scientific-computing operators (Tillet, Kung, and Cox 2019; Shi et al. 2023; Zhuang et al. 2024; Holewinski, Pouchet, and Sadayappan 2012). As existing libraries and framework primitives increasingly struggle to meet evolving workload and hardware requirements, GPU kernel development and optimization still rely heavily on manual implementation and tuning. This process demands substantial domain expertise and engineering effort, motivating the development of automated approaches to GPU kernel generation and optimization (Chetlur et al. 2014; Ouyang et al. 2025; Zhang et al. 2025).

Recent LLM-based systems have automated GPU kernel generation through iterative code synthesis and execution-driven refinement (Ouyang et al. 2025; Zhang et al. 2025; Wei et al. 2025; Andrews and Witteveen 2025). Nevertheless, many existing methods optimize within a predetermined implementation space (Zhang et al. 2025; Li et al. 2026; Baronio et al. 2026; Wang et al. 2025a; Saba et al. 2026). As illustrated in Figure 1, methods concentrated in the upper-left region rely primarily on high-level operators or optimized libraries. These approaches generally preserve higher-level semantics and reduce implementation complexity (Chen et al. 2018; Zheng et al. 2020), but may miss optimization opportunities that require custom fusion, shape specialization, or direct control over GPU execution (Shi

Copyright © 2027, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

et al. 2023; Zhuang et al. 2024; Cheng et al. 2026). In contrast, methods in the lower-right region directly explore custom CUDA implementations, providing greater optimization freedom but requiring the model to navigate a large and weakly structured space of interacting low-level decisions (Zhang et al. 2025; Chen et al. 2025; Li et al. 2026; Baronio et al. 2026). Under limited candidate-generation budgets, such exploration can spend substantial resources on implementations that fail compilation or correctness checks, or yield little performance improvement (Ouyang et al. 2025; Zhang et al. 2026; Sarkar 2026; Li, Rathnasuriya, and Yang 2026). More importantly, execution and profiling feedback can guide refinement only within the chosen implementation space; they do not determine whether that space is appropriate for the workload (Zhang et al. 2025; Wei et al. 2025; Andrews and Witteveen 2025). This limitation motivates treating implementation-space selection itself as an explicit part of the optimization process.

To address this gap, we propose HIERA, a hierarchical search-space planning framework for GPU kernel optimization. HIERA treats implementation granularity as an explicit optimization decision: it first selects a workload-appropriate implementation space and then structures refinement within that space using profiling feedback and expert domain knowledge. The main contributions of this work are summarized as follows:

• We identify the limitations of predetermined implementation spaces for efficient LLM-based GPU kernel optimization, and formulate implementation-space selection as an explicit workload-aware planning problem.

• We introduce a contract-augmented task specification that fixes callable interfaces, parameter semantics, compilation rules, and verification behavior. This design focuses candidate generation on performance-critical implementation choices and reduces ambiguity in code generation and evaluation.

• We develop a hierarchical search-space planning mechanism that first selects an appropriate implementation regime spanning custom CUDA kernels, optimized CUDA libraries, and PyTorch operators, and then combines profiling feedback with expert-curated optimization knowledge to guide structured refinement within the selected space.

• We conduct comprehensive comparative, limited-budget, and ablation studies on KernelBench across three workload levels and three base LLMs. The results show that HIERA consistently improves implementation validity, sample efficiency, and optimization performance over existing training-free methods, while confirming the complementary contributions of contract augmentation and hierarchical planning. A stencil case study further demonstrates its feasibility on a specialized scientific-computing operator under the evaluated configuration.

References (25)