Lune

OOPSLA2022Top-tier venue

Compilation of dynamic sparse tensor algebra

Stephen Chou, Saman P. Amarasinghe

Abstract

Many applications, from social network graph analytics to control flow analysis, compute on sparse data that evolves over the course of program execution. Such data can be represented as dynamic sparse tensors and efficiently stored in formats (data layouts) that utilize pointer-based data structures like block linked lists, binary search trees, B-trees, and C-trees among others. These specialized formats support fast in-place modification and are thus better suited than traditional, array-based data structures like CSR for storing dynamic sparse tensors. However, different dynamic sparse tensor formats have distinct benefits and drawbacks, and performing different computations on tensors that are stored in different formats can require vastly dissimilar code that are not straightforward to correctly implement and optimize. This paper shows how a compiler can generate efficient code to compute tensor algebra operations on dynamic sparse tensors that may be stored in a wide range of disparate formats. We propose a language for precisely specifying recursive, pointer-based data structures, and we show how this language can express many different dynamic data structures, including all the ones named above as well as many more. We then describe how, given high-level specifications of such dynamic data structures, a compiler can emit code to efficiently access and compute on dynamic sparse tensors that are stored in the aforementioned data structures. We evaluate our technique and find it generates efficient dynamic sparse tensor algebra kernels that have performance comparable to, if not better than, state-of-the-art libraries and frameworks such as PAM, Aspen, STINGER, and Terrace. At the same time, our technique supports a wider range of tensor algebra operations---such as those that simultaneously compute with static and dynamic sparse tensors---than Aspen, STINGER, and Terrace, while also achieving significantly better performance than PAM for those same operations.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Bonsai: Compiling Queries to Pruned Tree Traversals cites Compilation of sparse array programming models
  • METAL: Caching Multi-level Indexes in Domain-Specific Architectures cites Terrace: A Hierarchical Graph Container for Skewed Dynamic Graphs
  • Compressed and Parallelized Structured Tensor Algebra cites Finch: Sparse and Structured Tensor Programming with Control Flow
  • Compilation of sparse array programming models cites Automatic generation of efficient sparse tensor format conversion routines
  • Finch: Sparse and Structured Tensor Programming with Control Flow cites Compilation of sparse array programming models
  • Mechanised Hypersafety Proofs about Structured Data cites Automatic generation of efficient sparse tensor format conversion routines
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Mechanised Hypersafety Proofs about Structured DataVladimir Gladshtein, Qiyuan Zhao, Willow Ahrens, Saman P. Amarasinghe et al.PLDI 2024 · 10 citations
  2. Finch: Sparse and Structured Tensor Programming with Control FlowWillow Ahrens, Teodoro Fields Collin, Radha Patel, Kyle Deeds et al.OOPSLA 2025 · 6 citations
  3. METAL: Caching Multi-level Indexes in Domain-Specific ArchitecturesAnagha Molakalmur Anil Kumar, Aditya Prasanna, Jonathan Balkind, Arrvindh ShriramanASPLOS 2024 · 1 citation
  4. Compressed and Parallelized Structured Tensor AlgebraMahdi Ghorbani, Emilien Bauer, Tobias Grosser, Amir ShaikhhaOOPSLA 2025 · 1 citation
  5. Bonsai: Compiling Queries to Pruned Tree TraversalsAlexander J. Root, Christophe Gyurgyik, Purvi Goel, Kayvon Fatahalian et al.PLDI 2026

Builds on3

  1. Terrace: A Hierarchical Graph Container for Skewed Dynamic GraphsPrashant Pandey, Brian Wheatman, Helen Xu, Aydin BuluçSIGMOD 2021 · 53 citations
  2. Compilation of sparse array programming modelsRawn Henry, Olivia Hsu, Rohan Yadav, Stephen Chou et al.OOPSLA 2021 · 26 citations
  3. Automatic generation of efficient sparse tensor format conversion routinesStephen Chou, Fredrik Kjolstad, Saman P. AmarasinghePLDI 2020 · 26 citations

Related papers

  1. SpDISTAL: Compiling Distributed Sparse Tensor ComputationsRohan Yadav, Alex Aiken, Fredrik KjolstadSC 2022 · 7 citations
  2. Compilation of Modular and General Sparse WorkspacesGenghan Zhang, Olivia Hsu, Fredrik KjolstadPLDI 2024 · 6 citations
  3. Compiler Support for Sparse Tensor ConvolutionsPeiming Liu, Alexander J. Root, Anlun Xu, Yinying Li et al.OOPSLA 2024 · 5 citations
  4. UniSparse: An Intermediate Language for General Sparse Format CustomizationJie Liu, Zhongyuan Zhao, Zijian Ding, Benjamin Brock et al.OOPSLA 2024 · 7 citations
  5. SparseTIR: Composable Abstractions for Sparse Compilation in Deep LearningZihao Ye, Ruihang Lai, Junru Shao, Tianqi Chen et al.ASPLOS 2023 · 86 citations
Dusk over the sea between two cliffs drawn in fine vertical lines