Compiler-Grounded Hierarchical Diagnosis for LLM-Based Triton Kernel Optimization

πŸ“… 2026-07-25
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
This work addresses the limitations of existing large language model–driven kernel optimization approaches, which rely on superficial signals such as compiler feedback and struggle to diagnose root causes of compiler failures on emerging accelerators like NPUs. The authors propose a cross-layer progressive diagnosis framework that formulates optimization as an interpretable process: tracing runtime performance symptoms back to structural properties of intermediate representations and compiler behaviors, and performing source-code rewriting only when justified by empirical evidence. Integrating lightweight pattern classification, performance profiling, IR attribution, and compiler analysis, the method enables precise optimizations within Triton. Evaluated on 37 benchmarks on the Ascend 950 accelerator, it achieves a geometric mean speedup of 4.35Γ— and a median speedup of 2.73Γ—, with 22 benchmarks exceeding 2Γ— and 13 surpassing 5Γ— acceleration.
πŸ“ Abstract
Recent advances in large language models (LLMs) have enabled automated kernel generation and optimization, but most existing approaches rely on surface signals such as compilation feedback and profiling metrics. These signals reveal that a kernel is slow, but not why the backend compiler fails to realize a profitable optimization, especially on emerging accelerators such as NPUs. We therefore formulate kernel optimization as a progressive cross-layer diagnosis problem that links runtime symptoms to IR structure and compiler behavior before rewriting source. Based on this insight, we present our system, a compiler-grounded and hierarchical optimization framework for Triton kernels. the system escalates from lightweight pattern triage and profiling diagnosis to IR attribution and compiler-grounded analysis only when deeper evidence is needed, then proposes evidence-backed source-level rewrites. We implement the system on Triton for Ascend NPUs and evaluate it on 37 successfully converted entries from a standardized NPUKernelBench-derived Ascend 950 benchmark. Across these entries, the system attains a geometric-mean speedup of 4.35$\times$ and a median speedup of 2.73$\times$ from the initial to optimized Triton kernel; 22/37 exceed 2$\times$ and 13/37 exceed 5$\times$. The complete distribution ranges from near-baseline entries to large wins, motivating transparent reporting of the current system's scope and limitations.
Problem

Research questions and friction points this paper is trying to address.

LLM-based kernel optimization
compiler diagnosis
Triton kernels
NPU acceleration
cross-layer analysis
Innovation

Methods, ideas, or system contributions that make the work stand out.

compiler-grounded diagnosis
hierarchical optimization
Triton kernel
LLM-based code generation
cross-layer analysis
D
Dongjie Chen
Huawei Technologies Co., Ltd.
Ping Zhao
Ping Zhao
Hefei University of Technology
Mechanism and RoboticsRehabilitation RoboticsMotion SynthesisComputational Kinematics
B
Bohua Zhan
Huawei Technologies Co., Ltd.
Y
Yulong Wang
Huawei Technologies Co., Ltd.
S
Shushu Chen
Huawei Technologies Co., Ltd.
L
Liangjun Feng
Huawei Technologies Co., Ltd.
H
Hao Zhou
Huawei Technologies Co., Ltd.
M
Min Shen
Huawei Technologies Co., Ltd.
L
Linmu Wang
Huawei Technologies Co., Ltd.
W
Weijia Sheng
Huawei Technologies Co., Ltd.
X
Xiangyu Wei
Huawei Technologies Co., Ltd.
W
Weijie Ding
Huawei Technologies Co., Ltd.
J
Jianhui Huang
Huawei Technologies Co., Ltd.
Yaoqing Gao
Yaoqing Gao
Chief Compiler Architect
Compiler optimization