Optimization of reduction kernel based on Triton compiler

With the rapid development of deep learning models, the development of high-performance operators has become increasingly important and complex. The Triton compiler offers a more convenient and efficient solution for GPU operator development, striking a balance between flexibility and performance. Reduction operators, as fundamental components of deep learning models, play a critical role in enhancing the stability and performance of both training and inference. However, the current thread-level handling of reduction operators in the Triton compiler does not fully exploit the multilayered memory hierarchy and memory access resources of GPU. To address this issue, we propose optimizations for the code generation process of reduction operators in the Triton compiler. Specifically, we utilize Warp Shuffle instructions to optimize intra-warp processing for non-contiguous axis reduction and adopt a data-packing strategy to enhance the downgrading process of FP16 data types. These strategies effectively reduce shared memory usage during reduction and improve the parallel efficiency of computational units. Additionally, we address the warp divergence caused by masking in loops by employing a redundant masking tail-loop optimization technique, which reduces the overhead of mask loading and improves memory access efficiency. Experimental results on reduction operators with varying data scales demonstrate that the Warp Shuffle-based optimization achieves bandwidth improvements of 6.2%–32.9% for FP32 and FP16 data types. Furthermore, the packing optimization yields an average bandwidth improvement of 5.1% for FP16 data types, while the redundant masking tail-loop optimization achieves an average bandwidth improvement of 6.6%.

Authors

Institutions

Publication Details

Published
2025-05-09
DOI
https://doi.org/10.1117/12.3066920
Citations
1
Primary Topic
Advanced Algorithms and Applications
Type
article
Field-Weighted Citation Impact
1.21
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Optimization of reduction kernel based on Triton compiler

Lin Han, Zhanqiang Fang, Wei Gao, Yingying Li et al.
1 citations
Advanced Algorithms and Applications
1.21
article

Optimization of reduction kernel based on Triton compiler

Lin Han, Zhanqiang Fang, Wei Gao, Yingying Li, Jing Li
article en
1 citations

Abstract

With the rapid development of deep learning models, the development of high-performance operators has become increasingly important and complex. The Triton compiler offers a more convenient and efficient solution for GPU operator development, striking a balance between flexibility and performance. Reduction operators, as fundamental components of deep learning models, play a critical role in enhancing the stability and performance of both training and inference. However, the current thread-level handling of reduction operators in the Triton compiler does not fully exploit the multilayered memory hierarchy and memory access resources of GPU. To address this issue, we propose optimizations for the code generation process of reduction operators in the Triton compiler. Specifically, we utilize Warp Shuffle instructions to optimize intra-warp processing for non-contiguous axis reduction and adopt a data-packing strategy to enhance the downgrading process of FP16 data types. These strategies effectively reduce shared memory usage during reduction and improve the parallel efficiency of computational units. Additionally, we address the warp divergence caused by masking in loops by employing a redundant masking tail-loop optimization technique, which reduces the overhead of mask loading and improves memory access efficiency. Experimental results on reduction operators with varying data scales demonstrate that the Warp Shuffle-based optimization achieves bandwidth improvements of 6.2%–32.9% for FP32 and FP16 data types. Furthermore, the packing optimization yields an average bandwidth improvement of 5.1% for FP16 data types, while the redundant masking tail-loop optimization achieves an average bandwidth improvement of 6.6%.

PLA Information Engineering University (CN), Zhengzhou University (CN), National Supercomputing Center in Wuxi (CN)
Affordable and clean energy
Openalex Percentile: Top 22%
Advanced Algorithms and Applications
1.21
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Optimization of reduction kernel based on Triton compiler — Lin Han, Zhanqiang Fang, et al. · (2025) | TGRS Research Map | TGRS