Lune

OOPSLA2024Top-tier venue

Compilation of Shape Operators on Sparse Arrays

Alexander J. Root, Bobby Yan, Peiming Liu, Christophe Gyurgyik, Aart J. C. Bik, Fredrik Kjolstad

Abstract

We show how to build a compiler for a sparse array language that supports shape operators such as reshaping or concatenating arrays, in addition to compute operators. Existing sparse array programming systems implement generic shape operators for only some sparse data structures, reduce shape operators on other data structures to those, and do not support fusion. Our system compiles sparse array expressions to code that efficiently iterates over reshaped views of irregular sparse data structures, without needing to materialize temporary storage for intermediates. Our evaluation shows that our approach generates sparse array code competitive with popular sparse array libraries: our generated shape operators achieve geometric mean speed-ups of 1.66×–15.3× when compared to hand-written kernels in scipy.sparse and 1.67×–651× when compared to generic implementations in pydata/sparse . For operators that require data structure conversions in these libraries, our generated code achieves geometric mean speed-ups of 7.29×–13.0× when compared to scipy.sparse and 21.3×–511× when compared to pydata/sparse . Finally, our evaluation demonstrates that fusing shape and compute operators improves the performance of several expressions by geometric mean speed-ups of 1.22×–2.23×.

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.

3 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
  • Indexed Streams: A Formal Intermediate Representation for Fused Contraction Programs cites Compilation of sparse array programming models
  • Indexed Streams: A Formal Intermediate Representation for Fused Contraction Programs cites Verified tensor-program optimization via high-level scheduling rewrites
  • SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning cites Compilation of sparse array programming models
  • A Compiler for Fused Relational Operations on Multisets cites Indexed Streams: A Formal Intermediate Representation for Fused Contraction Programs
  • A Compiler for Fused Relational Operations on Multisets cites Compilation of sparse array programming models
  • FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming Dataflow cites Indexed Streams: A Formal Intermediate Representation for Fused Contraction Programs
  • FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming Dataflow cites Compilation of sparse array programming models
  • FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming Dataflow cites SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming DataflowRubens Lacouture, Nathan Zhang, Ritvik Sharma, Marco Siracusa et al.ASPLOS 2026 · 1 citation
  2. Bonsai: Compiling Queries to Pruned Tree TraversalsAlexander J. Root, Christophe Gyurgyik, Purvi Goel, Kayvon Fatahalian et al.PLDI 2026
  3. A Compiler for Fused Relational Operations on MultisetsJames Dong, Fredrik KjolstadPLDI 2026

Builds on5

  1. SparseTIR: Composable Abstractions for Sparse Compilation in Deep LearningZihao Ye, Ruihang Lai, Junru Shao, Tianqi Chen et al.ASPLOS 2023 · 86 citations
  2. Compilation of sparse array programming modelsRawn Henry, Olivia Hsu, Rohan Yadav, Stephen Chou et al.OOPSLA 2021 · 26 citations
  3. Verified tensor-program optimization via high-level scheduling rewritesAmanda Liu, Gilbert Louis Bernstein, Adam Chlipala, Jonathan Ragan-KelleyPOPL 2022 · 25 citations
  4. Indexed Streams: A Formal Intermediate Representation for Fused Contraction ProgramsScott Kovach, Praneeth Kolichala, Tiancheng Gu, Fredrik KjolstadPLDI 2023 · 11 citations
  5. Architecting a Query Compiler for Spatial WorkloadsRuby Y. Tahboub, Tiark RompfSIGMOD 2020 · 9 citations

Related papers

  1. Mosaic: An Interoperable Compiler for Tensor AlgebraManya Bansal, Olivia Hsu, Kunle Olukotun, Fredrik KjolstadPLDI 2023 · 16 citations
  2. Compilation of Modular and General Sparse WorkspacesGenghan Zhang, Olivia Hsu, Fredrik KjolstadPLDI 2024 · 6 citations
  3. SpDISTAL: Compiling Distributed Sparse Tensor ComputationsRohan Yadav, Alex Aiken, Fredrik KjolstadSC 2022 · 7 citations
  4. Compiler Support for Sparse Tensor ConvolutionsPeiming Liu, Alexander J. Root, Anlun Xu, Yinying Li et al.OOPSLA 2024 · 5 citations
  5. Legate Sparse: Distributed Sparse Computing in PythonRohan Yadav, Wonchan Lee, Melih Elibol, Manolis Papadakis et al.SC 2023 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines