Distributed-Memory Randomized Algorithms for Sparse Tensor CP Decomposition

Vivek Bharadwaj, Osman Asif Malik, Riley Murray, Aydin Buluç, James Demmel

TL;DR

This paper introduces the first distributed-memory parallel implementations of randomized algorithms for sparse tensor CP decomposition, achieving significant speedups (up to 11x) over state-of-the-art methods. By cleverly adapting sampling techniques and communication schedules, they enable faster and more scalable analysis of massive, sparse tensor datasets.

What Problem Does This Paper Address?

Analyzing large, multi-dimensional datasets often involves representing them as tensors. The Candecomp/PARAFAC (CP) decomposition is a powerful technique for uncovering underlying patterns in these tensors, analogous to Singular Value Decomposition (SVD) for matrices. However, when dealing with "sparse" tensors (where most entries are zero) that have billions of non-zero elements, computing CP decomposition becomes computationally prohibitive. Existing high-performance libraries for distributed-memory systems are often not optimized for the unique communication patterns of randomized algorithms, which, while computationally cheaper, can suffer from communication bottlenecks. This paper aims to bridge this gap by developing and evaluating distributed-memory randomized algorithms that are both fast and scalable for these massive sparse tensors.

Methods

The core contribution lies in the distributed-memory parallelization of two randomized CP decomposition algorithms: CP-ARLS-LEV and STS-CP. The key innovations include:

  • Novel Distributed-Memory Sampling: They developed new communication-avoiding algorithms for selecting samples from the Khatri-Rao product, a crucial step in randomized tensor decomposition. These methods ensure efficient sampling even when data is distributed across many processors.
  • Communication-Optimized MTTKRP Schedule: The authors devised an "accumulator-stationary" schedule for the Matricized Tensor-Times-Khatri Rao Product (MTTKRP) operation. This schedule avoids expensive "Reduce-scatter" collectives, making communication costs scale with the number of random samples rather than the full tensor size.
  • Optimized Local Storage: They adapted a compressed sparse column (CSC) format for local tensor storage, allowing efficient random access for sampling. A subsequent "sparse transpose" operation converts this to a compressed sparse row (CSR) format, enabling efficient parallel sparse-dense matrix multiplication without data races.

Datasets

The paper evaluates their algorithms on several large, sparse tensor datasets:

  • Uber: Used for verifying accuracy due to its smaller size.
  • Amazon: A large tensor with billions of non-zero entries.
  • Patents: Another large tensor with billions of non-zero entries.
  • Reddit: A massive tensor with billions of non-zero entries, used extensively for performance evaluation.

These datasets are sourced from the Formidable Repository of Open Sparse Tensors and Tools (FROSTT).

Key Insights and Ideas

  • Randomization Pays Off for Massive Tensors: While randomized algorithms have been studied for shared-memory systems, their distributed-memory counterparts were lacking. This work demonstrates that randomization can indeed provide significant speedups on distributed systems for extremely large tensors.
  • Communication is Key: The paper highlights that simply parallelizing existing randomized algorithms isn't enough. Careful optimization of communication patterns, particularly for sampling and the MTTKRP, is crucial for achieving scalability.
  • Tailoring Schedules to Randomization: Standard communication schedules optimized for deterministic algorithms can be inefficient for randomized ones. The "accumulator-stationary" schedule is a prime example of adapting techniques to the specific needs of randomized methods.
  • Data Structure Matters: The choice of local data storage format can significantly impact performance, especially for randomized access patterns required by sampling. The CSC-to-CSR conversion is a clever way to balance sampling efficiency with parallel computation.

Key Results

  • Significant Speedup: The proposed distributed algorithms (d-STS-CP and d-CP-ARLS-LEV) achieved up to an 11x speedup over SPLATT, a state-of-the-art distributed CP decomposition package, on the Reddit tensor.
  • Scalability: The algorithms demonstrated good scaling, with d-STS-CP maintaining at least a 2x speedup over SPLATT even at 16 nodes (2048 CPU cores) on the Amazon and Reddit tensors.
  • Accuracy: The randomized algorithms produced decompositions with fits comparable to non-randomized ALS, with accuracy gaps widening at higher ranks. The paper shows that increasing the sample count can further improve accuracy, often with diminishing returns beyond a certain point.
  • Faster Convergence: For the Reddit tensor, d-STS-CP achieved a comparable rank-100 decomposition in under two minutes, whereas SPLATT took significantly longer.

Limitations and Future Work

  • Irregular Communication in STS-CP: The paper acknowledges that the "d-STS-CP" algorithm still has an irregular communication pattern, which could be further improved.
  • Deployment on Larger Tensors: The authors suggest deploying their algorithms on even larger real-world tensors beyond those available in FROSTT.
  • Exploring Other Randomized Techniques: While this paper focuses on leverage score sampling, future work could explore other randomized sketching techniques for tensor decomposition.
  • Hypergraph Partitioning: The paper mentions that hypergraph partitioning could potentially improve load balancing for highly structured sparse tensors, but it was deemed too computationally expensive for their use case. This could be an area for future research if partitioning overhead can be reduced.

Summary updated

BibTeX
@inproceedings{bharadwaj2022distributed,
  author = {Vivek Bharadwaj and Osman Asif Malik and Riley Murray and Aydin Buluç and James Demmel},
  title = {{Distributed-Memory Randomized Algorithms for Sparse Tensor CP Decomposition}},
  booktitle = {SPAA},
  year = {2022},
}
Figure