Lune

PLDI2024顶会

Compilation of Modular and General Sparse Workspaces

Genghan Zhang, Olivia Hsu, Fredrik Kjolstad

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning 引用了 A sparse iteration space transformation framework for sparse tensor algebra
  • FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming Dataflow 引用了 A sparse iteration space transformation framework for sparse tensor algebra
  • FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming Dataflow 引用了 PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation
  • FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming Dataflow 引用了 SparseTIR: Composable Abstractions for Sparse Compilation in Deep Learning
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. FuseFlow: A Fusion-Centric Compilation Framework for Sparse Deep Learning on Streaming DataflowRubens Lacouture, Nathan Zhang, Ritvik Sharma, Marco Siracusa 等ASPLOS 2026 · 1 次引用
  2. Morphing-based Compression for Data-centric ML PipelinesSebastian Baunsgaard, Matthias BoehmVLDB 2026

它引用的 Paper18

  1. PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph CompilationJason Ansel, Edward Z. Yang, Horace He, Natalia Gimelshein 等ASPLOS 2024 · 693 次引用
  2. SparseTIR: Composable Abstractions for Sparse Compilation in Deep LearningZihao Ye, Ruihang Lai, Junru Shao, Tianqi Chen 等ASPLOS 2023 · 86 次引用
  3. TileSpGEMM: a tiled algorithm for parallel sparse general matrix-matrix multiplication on GPUsYuyao Niu, Zhengyang Lu, Haonan Ji, Shuhui Song 等PPoPP 2022 · 66 次引用
  4. Exocompilation for productive programming of hardware acceleratorsYuka Ikarashi, Gilbert Louis Bernstein, Alex Reinking, Hasan Genc 等PLDI 2022 · 56 次引用
  5. A sparse iteration space transformation framework for sparse tensor algebraRyan Senanayake, Changwan Hong, Ziheng Wang, Amalee Wilson 等OOPSLA 2020 · 51 次引用

相关 Paper

  1. Compiler Support for Sparse Tensor ConvolutionsPeiming Liu, Alexander J. Root, Anlun Xu, Yinying Li 等OOPSLA 2024 · 5 次引用
  2. SpDISTAL: Compiling Distributed Sparse Tensor ComputationsRohan Yadav, Alex Aiken, Fredrik KjolstadSC 2022 · 7 次引用
  3. Compilation of sparse array programming modelsRawn Henry, Olivia Hsu, Rohan Yadav, Stephen Chou 等OOPSLA 2021 · 26 次引用
  4. Compressed and Parallelized Structured Tensor AlgebraMahdi Ghorbani, Emilien Bauer, Tobias Grosser, Amir ShaikhhaOOPSLA 2025 · 1 次引用
  5. Compilation of dynamic sparse tensor algebraStephen Chou, Saman P. AmarasingheOOPSLA 2022 · 8 次引用
黄昏的海面,两侧是细线勾勒的悬崖