Distributed-memory tensor completion for generalized loss functions in python using new sparse tensor kernels

Navjot Singh, Zecheng Zhang, Xiaoxiao Wu, Naijing Zhang, Siyuan Zhang, Edgar Solomonik

TL;DR

This paper introduces a new Python-based framework for distributed-memory tensor completion, enabling efficient handling of sparse tensors and generalized loss functions. It presents novel algorithms and optimized kernels, including a "Tensor Times Tensor Product" (TTTP) operation, that significantly improve scalability and performance for large-scale tensor completion tasks.

What Problem Does This Paper Address?

Tensor completion, a generalization of matrix completion, is crucial for tasks like recommendation systems and data analysis. However, applying it to real-world datasets often involves extremely large and sparse tensors, posing significant computational challenges. Existing methods struggle with:

  • Scalability: Handling massive tensors across distributed memory systems.
  • Generalized Loss Functions: Most prior work focused on least-squares loss, limiting applicability to data that doesn't follow a normal distribution.
  • Efficiency of Sparse Operations: Standard tensor contraction methods become inefficient for very sparse data.

This paper aims to bridge this gap by providing a high-level, yet performant, Python framework for distributed-memory tensor completion that supports a wider range of loss functions and efficiently handles hypersparse tensors.

Methods

The authors introduce several key methodological contributions:

  • New Algorithms for Generalized Loss Functions: They extend standard tensor completion algorithms like Alternating Minimization (ALS), Coordinate Descent (CD), and introduce a quasi-Newton (Gauss-Newton) method to handle generalized loss functions.
  • Hypersparse Matrix Formats: To address the inefficiency of standard sparse formats for extremely sparse tensors, they introduce and leverage a "doubly compressed CSR" (CCSR) format. This allows for more memory-efficient storage and faster contractions.
  • Tensor Times Tensor Product (TTTP) Kernel: A novel kernel is presented for efficiently computing contractions involving sparse tensors and multiple dense matrices. This is crucial for many tensor completion algorithms and is implemented using an "all-at-once" approach for better performance.
  • Python Interface to Cyclops: The developed kernels and algorithms are integrated into a high-level Python interface built on top of the Cyclops tensor library. This allows users to leverage distributed-memory parallelism and advanced sparse tensor operations without explicit low-level programming.
  • Implicit Hessian for Quasi-Newton: For the second-order quasi-Newton method, they use an implicit form of the Hessian, enabling efficient matrix-vector products via conjugate gradient, thus avoiding the prohibitive cost of explicitly forming and inverting the Hessian.

Datasets

  • Synthetic Tensor: A synthetic tensor with 10 billion non-zeros and low density was used for benchmarking.
  • Netflix Dataset: A real-world dataset used for evaluating tensor completion performance.

Key Insights and Ideas

  • Hypersparsity is Key for Extreme Sparsity: For tensors with very low densities, specialized hypersparse representations are not just beneficial but necessary for achieving scalability, outperforming standard sparse formats.
  • "All-at-Once" TTTP Outperforms Pairwise: The novel TTTP kernel, implemented in an "all-at-once" manner, significantly outperforms traditional pairwise tensor contraction approaches, especially for larger ranks.
  • Generalized Loss Functions are Crucial: Extending tensor completion beyond least-squares loss opens up applications to a wider range of data distributions, and the proposed framework handles this effectively.
  • High-Level Abstraction Enables Productivity: The Python interface built on Cyclops allows researchers to implement complex distributed tensor algorithms concisely, abstracting away the complexities of parallelism and data distribution.
  • Second-Order Methods Offer Accuracy: While computationally more intensive per iteration, second-order methods like quasi-Newton demonstrate superior accuracy and faster convergence for certain problems, especially when exact solutions are desired.

Key Results

  • Scalability: The proposed hypersparse representation and TTTP kernel demonstrate good scalability on the Stampede2 supercomputer, handling tensors with billions of non-zeros.
  • Performance: The new kernels, particularly TTTP, show significant speedups compared to pairwise contraction methods. The hypersparse TTM and MTTKRP kernels also achieve competitive performance.
  • Accuracy: The generalized tensor completion algorithms, especially the second-order methods, achieve higher accuracy than SGD for certain problems.
  • Efficiency: The Python interface allows for concise implementation of complex algorithms, achieving performance competitive with state-of-the-art libraries. For example, their ALS implementation is only slightly slower than SPLATT but offers lower memory footprint.

Limitations and Future Work

  • Nonnegativity Constraints: The current framework does not explicitly incorporate nonnegativity constraints for certain loss functions (e.g., those requiring positive factors). The authors suggest projected Newton's methods or barrier formulations as potential solutions.
  • Optimal Threaded Implementations: While the hypersparse representation offers memory scaling, further optimization of threaded implementations for specific tensor formats like CSF could improve performance.
  • SGD Fine-Tuning: The SGD implementation was outperformed by other algorithms, suggesting that further fine-tuning of learning and sampling rates, or exploring adaptive strategies, could improve its performance.
  • Generalizing Loss Functions: While the framework supports generalized loss functions, the interpretation of factors might change when constraints are removed. Future work could explore how to best incorporate these constraints.

Summary updated

BibTeX
@article{singh2022distributed,
  author = {Navjot Singh and Zecheng Zhang and Xiaoxiao Wu and Naijing Zhang and Siyuan Zhang and Edgar Solomonik},
  title = {{Distributed-memory tensor completion for generalized loss functions in python using new sparse tensor kernels}},
  journal = {J. Parallel Distributed Comput.},
  year = {2022},
  url = {https://openreview.net/forum?id=IzEiB6Dk263},
}
Figure