Swift: High Parallelism Program Generation of Tensor Operators for Accelerating Deep Learning Inference
Optimizing deep learning inference, particularly reducing the execution latency of tensor computations at small batch sizes, is crucial for the successful and widespread adoption of deep neural network (DNN) models. However, current deep learning compilers and hand-tuned libraries often fail to achieve high hardware efficiency when executing small-batch workloads. The primary reason is the inherently sequential nature of reductions (e.g., along the hidden dimension in the flattened GEMM for LLM decoding), which is difficult to parallelize and therefore fails to fully utilize available hardware resources. In this article, we propose Swift, a novel search-based approach for efficiently generating high-performance programs for GPUs by maximizing hardware utilization. The key insight is that reduction parallelization can be incorporated into a unified representation alongside the existing tile structure, significantly expanding the search space for high-performance programs. Concretely, by enumerating all possible parallel mappings of loops, we first generate a large search space that contains high-performance programs. Then, to efficiently explore the extended search space, we employ subspace shifting exploration to identify promising regions, effectively prune large portions of the less-promising search space. We conduct experiments on three distinct GPU architectures using a diverse set of benchmarks representative of typical application scenarios. Experimental results demonstrate that Swift achieves an average speedup of 1.19× over the state-of-the-art compiler-based approaches. Moreover, compared with vendor-provided hand-tuned libraries, Swift achieves an average speedup of 2.40×.
Authors
- Yuanbo Wen (ORCID: https://orcid.org/0000-0002-7775-2724)
- Zidong Du (ORCID: https://orcid.org/0000-0002-7603-4210)
- Xiang-Ling Yu
- Wei Li (ORCID: https://orcid.org/0009-0006-0237-1034)
- Jing Li (ORCID: https://orcid.org/0000-0001-6761-7687)
- Di Huang (ORCID: https://orcid.org/0000-0002-2370-0072)
- Jia‐Ming Guo (ORCID: https://orcid.org/0000-0003-3200-5255)
- Qi Guo (ORCID: https://orcid.org/0000-0003-2530-5874)
- Jianxing Xu (ORCID: https://orcid.org/0000-0002-0373-411X)
- Jun Bi (ORCID: https://orcid.org/0000-0001-9956-7039)
- Tianshi Chen (ORCID: https://orcid.org/0000-0002-7601-0753)
Institutions
- University of Science and Technology of China (CN)
- Institute of Computing Technology (CN)
- Cambricon (China)
Publication Details
- Journal
- ACM Transactions on Architecture and Code Optimization
- Published
- 2025-08-25
- DOI
- https://doi.org/10.1145/3762660
- Primary Topic
- Computational Physics and Python Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Science Foundation
- National Natural Science Foundation of China
- Chinese Academy of Sciences
- Youth Innovation Promotion Association