Kernel Instruction Optimization Based on the Triton Compiler
With the continuous growth of model parameter scale and computational density, kernel execution performance has gradually become an important part of overall model inference and training. The programming language Triton, developed by OpenAI, can serve as the backend of Torch Inductor to assist in generating high-performance GPU kernels. Aiming at the problem of low-quality kernels in the Inductor kernel generation process, the Triton compiler can introduce optimization strategies such as redundant instruction elimination. However, when dealing with program features such as complex memory dependencies, repeated loading, and multiple consecutive division operations, there are still issues of insufficient optimization depth and inadequate recognition and mitigation of performance bottlenecks. Therefore, this paper proposes a unified optimization strategy targeting the intermediate representation level based on the Triton compiler. Through the combination of static analysis and equivalence rewriting, it performs fused optimization on instruction redundancy and algebraic computation patterns. Under the premise of preserving semantic consistency, the method restructures data dependency paths and kernel expression forms, effectively reducing redundant memory accesses, decreasing repetitive and inefficient computation overhead, and improving kernel execution efficiency. Experimental results show that the average speedup of redundant instruction optimization reaches 1.47, while the average speedup of algebraic transformation optimization reaches 1.29.
Authors
- Wei Gao (ORCID: https://orcid.org/0000-0003-2257-5684)
- Yangyang Du (ORCID: https://orcid.org/0000-0001-9819-6053)
- Jianan Li (ORCID: https://orcid.org/0000-0002-0532-0412)
- Lin Han (ORCID: https://orcid.org/0000-0001-7666-0150)
Institutions
- Zhengzhou University (CN)
- National Supercomputing Center in Wuxi (CN)
Publication Details
- Published
- 2025-04-25
- DOI
- https://doi.org/10.1109/iccea65460.2025.11102282
- Primary Topic
- Embedded Systems and FPGA Design
- Type
- article
- Field-Weighted Citation Impact
- 0.00