Sgap: Towards Efficient Sparse Tensor Algebra Compilation for GPU

Genghan Zhang, Yuetong Zhao, Yanting Tao, Zhongming Yu, Guohao Dai +4 more
9/7/2022
cs.DCcs.PL

Official code: zhang677/segTACO (3 stars, C++, Apache-2.0, last commit 2022-07-29).

Abstract

Sparse compiler is a promising solution for sparse tensor algebra optimization. In compiler implementation, reduction in sparse-dense hybrid algebra plays a key role in performance.

Show full abstract

Though GPU provides various reduction semantics that can better utilize the parallel computing and memory bandwidth capacity, the central question is: how to elevate the flexible reduction semantics to sparse compilation theory that assumes serial execution. Specifically, we have to tackle two main challenges: (1) there are wasted parallelism by adopting static synchronization granularity (2) static reduction strategy limits optimization space exploration. We propose Sgap: segment group and atomic parallelism to solve these problems. Atomic parallelism captures the flexible reduction semantics to systematically analyze the optimization space of sparse-dense hybrid algebra on GPU. It is a new optimization technique beyond current compiler-based and open-source runtime libraries. Segment group elevates the flexible reduction semantics to suitable levels of abstraction in the sparse compilation theory. It adopts changeable group size and user-defined reduction strategy to solve challenge (1) and (2), respectively. Finally, we use GPU sparse matrix-matrix multiplication (SpMM) on the TACO compiler as a use case to demonstrate the effectiveness of segment group in reduction semantics elevation. We achieve up to 1.2x speedup over the original TACO's SpMM kernels. We also apply new optimization techniques found by atomic parallelism to an open-source state-of-the-art SpMM library dgSPARSE. We achieve 1.6x - 2.3x speedup on the algorithm tuned with atomic parallelism.

View on arXivView PDF

Code Implementations(1)

zhang677/segTACOOfficial100%
Apache-2.0
30C++, FortranJul 29, 20224 years agoApache-2.0

Similar Papers

Cite this paper

@article{zhang2022sgap,
  title  = {Sgap: Towards Efficient Sparse Tensor Algebra Compilation for GPU},
  author = {Genghan Zhang and Yuetong Zhao and Yanting Tao and Zhongming Yu and Guohao Dai and Sitao Huang and Yuan Wen and Pavlos Petoumenos and Yu Wang},
  year   = {2022},
  eprint = {2209.02882},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.02882}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.02882.svg)](https://codeofpaper.com/paper/2209.02882)

Discussion