Deinsum: Practically I/O Optimal Multilinear Algebra

Alexandros Nikolaos Ziogas, Grzegorz Kwasniewski, Tal Ben-Nun, Timo Schneider, Torsten Hoefler · DOI

Abstract

In high-performance computing (HPC), the "memory wall" has made data movement (I/O) a more significant bottleneck than raw computation. This is particularly acute in multilinear algebra, where high-dimensional tensor operations are central to fields like climate modeling and machine learning. We present Deinsum, an automated framework that generates communication-optimal distributed schedules for complex tensor operations expressed in Einstein notation. By leveraging the Simple Overlap Access Programs (SOAP) framework to derive tighter I/O lower bounds, Deinsum achieves up to a 19x speedup over the Cyclops Tensor Framework (CTF) on 512 nodes of the Piz Daint supercomputer.

Introduction: The Data Movement Bottleneck

Modern processors can perform trillions of floating-point operations per second, but the speed of moving data between memory and processors has not kept pace. For multilinear algebra, which involves operations on high-dimensional tensors, finding efficient data distribution and "tiling" strategies is a complex combinatorial challenge. Traditional approaches often rely on heuristics or "tensor folding"—flattening tensors into 2D matrices—which frequently leads to suboptimal data movement.

The Deinsum Framework

Deinsum automates the transition from a mathematical formula to high-performance distributed code through a multi-stage pipeline.

The Deinsum technical pipeline, illustrating the flow from einsum input to automated code generation.
  1. Input and Decomposition: Users provide operations in Einstein (einsum) notation. Deinsum decomposes these into a sequence of binary operations to minimize arithmetic complexity.
  2. SOAP Analysis: The framework utilizes the Simple Overlap Access Programs (SOAP) mathematical framework to derive tight I/O lower bounds. This analysis identifies opportunities for data reuse across different computational stages.
  3. Optimal Scheduling: Based on these bounds, Deinsum automatically partitions the iteration space and determines the optimal distribution of data across MPI ranks.
  4. Code Generation: Using the dace (Data-Centric Parallel Programming) framework, Deinsum generates specialized C++/CUDA code, handling complex data redistributions between kernels automatically.

Performance Evaluation and Key Results

The framework was evaluated on the Piz Daint supercomputer (up to 512 Cray XC50 nodes) using standard multilinear algebra benchmarks, including the Matricized Tensor Times Khatri-Rao Product (MTTKRP) and the Tensor Times Matrix chain (TTMc).

Deinsum overview and performance speedup over CTF on 512 Piz Daint nodes.

Deinsum demonstrated significant performance gains over the previous industry standard, the Cyclops Tensor Framework (CTF):

  • Massive Speedups: Speedups ranged from 6.75x to 19x for MTTKRP benchmarks and reached 15.95x for TTMc on 512 nodes.
  • Theoretical Tightness: The authors derived a new theoretical I/O lower bound for MTTKRP that is over 6x tighter than previous results, introducing a tiling scheme that asymptotically reduces communication by a factor of $S^{1/6}$.
  • Scalability: Deinsum exhibited excellent weak scaling, maintaining efficiency as problem sizes and processor counts increased.

Conclusion and Future Directions

Deinsum proves that automated, communication-optimal scheduling can yield order-of-magnitude improvements in tensor computation performance. While currently focused on dense tensors, future work aims to extend these I/O-optimal principles to sparse data structures and further integrate fused kernels to minimize data passes.

Summary updated

BibTeX
@inproceedings{ziogas2022deinsum,
  author = {Alexandros Nikolaos Ziogas and Grzegorz Kwasniewski and Tal Ben-Nun and Timo Schneider and Torsten Hoefler},
  title = {{Deinsum: Practically I/O Optimal Multilinear Algebra}},
  booktitle = {SC},
  year = {2022},
  doi = {10.1109/sc41404.2022.00030},
}
Figure