Compilation of Modular and General Sparse Workspaces
Open Access
- 20 June 2024
- journal article
- abstracts
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 8 (PLDI) , 1213-1238
Abstract
Recent years have seen considerable work on compiling sparse tensor algebra expressions. This paper addresses a shortcoming in that work, namely how to generate efficient code (in time and space) that scatters values into a sparse result tensor. We address this shortcoming through a compiler design that generates code that uses sparse intermediate tensors (sparse workspaces) as efficient adapters between compute code that scatters and result tensors that do not support random insertion. Our compiler automatically detects sparse scattering behavior in tensor expressions and inserts necessary intermediate workspace tensors. We present an algorithm template for workspace insertion that is the backbone of our code generation algorithm. Our algorithm template is modular by design, supporting sparse workspaces that span multiple user-defined implementations. Our evaluation shows that sparse workspaces can be up to 27.12 × faster than the dense workspaces of prior work. On the other hand, dense workspaces can be up to 7.58 × faster than the sparse workspaces generated by our compiler in other situations, which motivates our compiler design that supports both. Our compiler produces sequential code that is competitive with hand-optimized linear and tensor algebra libraries on the expressions they support, but that generalizes to any other expression. Sparse workspaces are also more memory efficient than dense workspaces as they compress away zeros. This compression can asymptotically decrease memory usage, enabling tensor computations on data that would otherwise run out of memory.Keywords
All Related Versions
This publication has 74 references indexed in Scilit:
- Distributed-memory tensor completion for generalized loss functions in python using new sparse tensor kernelsJournal of Parallel and Distributed Computing, 2022
- The Sparse Polyhedral Framework: Composing Compiler-Generated Inspector-Executor CodeProceedings of the IEEE, 2018
- OuterSPACE: An Outer Product Based Sparse Matrix Multiplication Accelerator2018
- Constrained Tensor Factorization with Accelerated AO-ADMM2017
- The Gamma Matrix to Summarize Dense and Sparse Data Sets for Big Data AnalyticsIEEE Transactions on Knowledge and Data Engineering, 2016
- HaTen2: Billion-scale tensor decompositions2015
- Scalable Tensor Decompositions for Multi-aspect Data Mining2008
- On the representation and multiplication of hypersparse matrices2008 IEEE International Symposium on Parallel and Distributed Processing, 2008
- FFTW: an adaptive software architecture for the FFT2002
- Less than full‐text indexing using a non‐boolean searching modelJournal of the American Society for Information Science, 1984