Automatic Generation of Efficient Sparse Tensor Format Conversion Routines
Not on the map. Why?
Abstract (arXiv)
This paper shows how to generate code that efficiently converts sparse tensors between disparate storage formats (data layouts) such as CSR, DIA, ELL, and many others. We decompose sparse tensor conversion into three logical phases: coordinate remapping, analysis, and assembly. We then develop a language that precisely describes how different formats group together and order a tensor's nonzeros in memory. This lets a compiler emit code that performs complex remappings of nonzeros when converting between formats. We also develop a query language that can extract statistics about sparse tensors, and we show how to emit efficient analysis code that computes such queries. Finally, we define an abstract interface that captures how data structures for storing a tensor can be efficiently assembled given specific statistics about the tensor. Disparate formats can implement this common interface, thus letting a compiler emit optimized sparse tensor conversion code for arbitrary combinations of many formats without hard-coding for any specific combination. Our evaluation shows that the technique generates sparse tensor conversion routines with performance between 1.00 and 2.01× that of hand-optimized versions in SPARSKIT and Intel MKL, two popular sparse linear algebra libraries. And by emitting code that avoids materializing temporaries, which both libraries need for many combinations of source and target formats, our technique outperforms those libraries by 1.78 to 4.01× for CSC/COO to DIA/ELL conversion.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). First posted on arXiv 8 Jan 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 3; 2023: 0; 2024: 1.
4 papers.
- 2022SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learningcited by 47
- 2022TensorIR: An Abstraction for Automatic Tensorized Program Optimizationcited by 38
- 2024UniSparse: An Intermediate Language for General Sparse Format Customizationcited by 4
- 2022ALT: Boosting Deep Learning Performance by Breaking the Wall between Graph and Operator Level Optimizationscited by 0
- 2024UniSparse: An Intermediate Language for General Sparse Format Customization9 Mar 2024
- 2022ALT: Boosting Deep Learning Performance by Breaking the Wall between Graph and Operator Level Optimizations22 Oct 2022
- 2022SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning11 Jul 2022
- 2022TensorIR: An Abstraction for Automatic Tensorized Program Optimization9 Jul 2022