Sgap:面向GPU的高效稀疏张量代数编译
Sgap: Towards Efficient Sparse Tensor Algebra Compilation for GPU
摘要:
稀疏编译器是稀疏张量代数优化的一种很有前途的解决方案。在编译器实现中,稀疏-稠密混合代数的约简对性能起着关键作用。虽然GPU提供了各种可以更好地利用并行计算和内存带宽容量的约简语义,但核心问题是:如何将灵活的约简语义提升到假设串行执行的稀疏编译理论。具体而言,我们必须解决两个主要挑战:(1)采用静态同步粒度会浪费并行性(2)静态归约策略限制优化空间探索。我们提出了Sgap:段组和原子并行来解决这些问题。原子并行捕捉灵活的约简语义,系统地分析稀疏-密集混合代数在GPU上的优化空间。它是一种超越当前基于编译器和开源运行时库的新优化技术。段组将灵活的约简语义提升到稀疏编译理论中合适的抽象层次。该算法采用可变群规模和自定义约简策略分别解决问题(1)和(2)。最后,我们在TACO编译器上使用GPU稀疏矩阵-矩阵乘法(SpMM)作为用例来证明段组在约简语义提升中的有效性。我们实现了1.2倍的加速比原来的TACO的SpMM内核。我们还将原子并行发现的新优化技术应用于开源的最先进的SpMM库dgSPARSE。我们实现了1.6x - 2.3x的加速与原子并行调整的算法。
英文摘要:
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. 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。