AutoSparse: A Source-to-Source Format and Schedule Auto- Tuning Framework for Sparse Tensor Program
Sparse tensor computation plays a crucial role in modern deep learning workloads, and its expensive computational cost leads to a strong demand for high-performance oper-ators. However, developing high-performance sparse operators is exceptionally challenging and tedious. Existing vendor operator libraries fail to keep pace with the evolving trends in new algorithms. Sparse tensor compilers simplify the development and optimization of operator, but existing work either requires significant engineering effort for tuning or suffers from limitations in search space and search strategies, which creates unavoidable cost and efficiency issues. In this paper, we propose AutoSparse, a source-to-source auto-tuning framework that targets sparse for-mat and schedule for sparse tensor program. Firstly, AutoSparse designs a sparse tensor DSL based on dynamic computational graph at the front-end, and proposes a sparse tensor program computational pattern extraction and automatic design space generation scheme based on it. Second, AutoSparse's back-end designs an adaptive exploration strategy based on reinforcement learning and heuristic algorithm to find the optimal format and schedule configuration in a large-scale design space. Compared to prior work, developers using AutoSparse do not need to specify tuning design space relied on any compilation or hardware knowledge. We use the SuiteS parse dataset to compare with four state-of-the-art baselines, namely, the high-performance operator library MKL, the manually-based optimisation scheme ASpT, the auto-tuning-based framework TVM-S and WACO. The results demonstrate that AutoSparse achieves average speedups of 1.92- <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$2.48 \times. 1.19-6.34 \times$</tex>. and <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$1.47-2.23\times$</tex> for the SpMV, SpMM, and SDDMM operators, respectively. We will open-source AutoSparse at https://github.com/Qu-Xiangjun/AutoSparse.
Authors
- Wenqi Lou (ORCID: https://orcid.org/0000-0002-2240-6672)
- Xiaoyan Qu (ORCID: https://orcid.org/0000-0001-5407-8493)
- Xuehai Zhou (ORCID: https://orcid.org/0000-0002-8360-3143)
- Chao Wang (ORCID: https://orcid.org/0000-0001-8453-0495)
- Lei Gong (ORCID: https://orcid.org/0000-0001-6017-8490)
- Xianglan Chen (ORCID: https://orcid.org/0009-0007-7845-3068)
- Qianyu Cheng (ORCID: https://orcid.org/0000-0001-8321-6920)
Institutions
- University of Science and Technology of China (CN)
Publication Details
- Published
- 2024-11-18
- DOI
- https://doi.org/10.1109/iccd63220.2024.00083
- Primary Topic
- Tensor decomposition and applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00