NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SpDISTAL: Compiling Distributed Sparse Tensor Computations

Rohan Yadav, Alex Aiken, Fredrik Kjolstad · DOI

Introduction

Sparse tensor algebra is essential for modern scientific computing and machine learning, yet implementing these computations efficiently on distributed systems remains a significant challenge. Developers typically choose between hand-optimized libraries, which are performant but rigid, and interpreted frameworks, which are flexible but suffer from high overhead. SpDISTAL bridges this gap as a new compiler that generates high-performance code for arbitrary sparse tensor expressions on distributed CPU and GPU clusters.

System Architecture

SpDISTAL builds upon the TACO sparse compiler and the DISTAL distributed dense compiler. It decouples the mathematical specification from the data layout and execution strategy, allowing for both flexibility and "bare-metal" performance.

Overview of the SpDISTAL compiler architecture and its core contributions.

The compiler pipeline takes Tensor Index Notation (TIN), format descriptors, and scheduling commands to produce low-level intermediate representation (IR) targeting the Legion runtime. A major contribution is the integration of sparse data structure partitioning into the scheduling passes, which automates complex data management tasks.

Programming Model

The core of SpDISTAL is a three-part programming model that separates concerns to simplify distributed sparse computing:

  1. Computation Language: Uses Tensor Index Notation to define the mathematical operation (e.g., matrix multiplication) independently of how data is stored.
  2. Format Language: Describes data storage and distribution. It treats sparse tensors as coordinate trees, enabling complex partitioning strategies.
  3. Scheduling Language: Specifies execution details like parallelization, tiling, and hardware offloading.
Sparse matrix formats (CSR and CSC) represented as coordinate trees.

A key innovation is the support for non-zero partitions, which distribute data based on the actual number of non-zero elements rather than just geometric dimensions. This ensures better load balancing in highly irregular datasets, which is vital for distributed performance.

Implementation and Evaluation

SpDISTAL leverages the Legion runtime's dependent partitioning to automate data movement. By using "image" and "preimage" operations, the system calculates necessary data transfers for irregular sparse structures automatically. This allows the compiler to handle complex distributions that would be error-prone to code manually in MPI.

Evaluation on real-world datasets (SuiteSparse, FROSTT, Freebase) shows that SpDISTAL:

  • Outperforms Interpreted Frameworks: It beat the Cyclops Tensor Framework (CTF) by 19x to 299x on standard kernels like SpMV and SpTTV.
  • Competes with Hand-optimized Libraries: It achieved median speedups of 1.8x on SpMV and 2.0x on SpMM over PETSc.
  • Excels at Kernel Fusion: By fusing multiple operations into a single pass, SpDISTAL performed triple-matrix additions (SpAdd3) up to 38.5x faster than libraries that require multiple separate passes.

Conclusion

SpDISTAL demonstrates that a compiler-based approach can provide the flexibility of general-purpose frameworks without sacrificing the performance of specialized libraries. While challenges remain in handling completely unknown output sparsity patterns, the system shows excellent strong and weak scaling on up to 64 nodes (256 GPUs).

Summary updated

BibTeX
@inproceedings{yadav2022spdistal,
  author = {Rohan Yadav and Alex Aiken and Fredrik Kjolstad},
  title = {{SpDISTAL: Compiling Distributed Sparse Tensor Computations}},
  booktitle = {SC},
  year = {2022},
  doi = {10.1109/sc41404.2022.00064},
}
Figure