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.
- Input and Decomposition: Users provide operations in Einstein (
einsum) notation. Deinsum decomposes these into a sequence of binary operations to minimize arithmetic complexity. - 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.
- Optimal Scheduling: Based on these bounds, Deinsum automatically partitions the iteration space and determines the optimal distribution of data across MPI ranks.
- 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 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