Skip to content

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

Jul 2026 · arXiv.org · Vol abs/2607.23089 · 0 citations · 23 references
Computer Science

TL;DR

This work forms kernel optimization as a progressive cross-layer diagnosis problem that links runtime symptoms to IR structure and compiler behavior before rewriting source, and presents a compiler-grounded and hierarchical optimization framework for Triton kernels.

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.

View source

Similar papers

Preprint Aug 2026

Effect of Abstractions and Prompting Strategies on LLM-Guided High-Performance Optimizations

It is demonstrated that LLMs provided with specific optimization goals achieve better measured performance and validity rates when generating C code compared to creating computation pipelines and optimization schedules with established frameworks, suggesting that future development should explore alternative approaches...

Jiří Klepl, Matyáš Brabec, Martin Kruliš · 0 citations
Preprint Aug 2026

LLM4LLM: Bridging Kernel Benchmarks and Real Deployment via Closed-Loop Agentic Optimization

LLM4LLM is introduced, a deployment-aware closed-loop optimization framework that starts from a target inference script, extracts phase-aware optimization tasks, searches with an experience-guided episodic agent, and accepts patches through in-model validation.

Hui Zeng, Pengfei Yang, Yanxin Chen et al. · 0 citations
Preprint Jul 2026

Triton for MTIA: Bridging the Programming Model Gaps for Custom AI Accelerators

This work presents the first production-scale application of Triton on a custom ML accelerator, MTIA-2i, developed by Meta, and develops a new compiler backend that targets it, introduces enhancements to TorchInductor code generation, and proposes minimal language extensions that expose MTIA-specific architectural feat...

Haishan Zhu, Domi Yan, Michael Levesque-Dion et al. · 0 citations
Preprint Aug 2026

Accelerating C/C++ Pointer Analysis via Compiler-Based Offline Simplifications

This paper explores a new perspective: applying semantic-preserving compiler optimizations directly to intermediate representation (IR) before pointer analysis, which is modular, analysis-agnostic, and easily integrates with existing tools.

Zi-Nan Gu, Pei-Sen Yao, Kui Ren · 0 citations
Preprint Aug 2026

CHISEL-ing Back Source Code with AI-enabled Iterative Recovery

This work presents CHISEL, a test suite-free framework to iteratively recover source code from Ghidra-derived pseudo-C, and systematically evaluates CHISEL for compilation and semantic recovery, feedback oracle soundness, and iteration overhead on 120 ExeBench functions compiled for the x86-64 architecture.

Varun Kohli, N. Raghava, B. Sikdar et al. · 1 citation
Jul 2026

KernelGenBench: A Multi-Source and Multi-Chip Benchmark for LLM-based Kernel Generation

Large language models (LLMs) have significantly increased the demand for efficient accelerator kernels, but kernel development remains a highly specialized and labor-intensive task. The recent rise of LLMs and agentic frameworks offers a promising pathway toward automatic kernel generation. However, despite rapid progr...

Pei-Yu Zang, Jian-Hang Tao, Jia-Ling Zhang et al. · 1 citation

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.