[Paper Review] Shared Memory Parallelization of MTTKRP for Dense Tensors
This paper presents shared-memory parallel algorithms for the matricized-tensor times Khatri-Rao product (MTTKRP) in dense tensor decompositions, using BLAS-optimized matrix operations without tensor reordering. It achieves up to 7.4× speedup over existing software on fMRI data by combining a novel 1-step MTTKRP algorithm with a parallel Khatri-Rao product implementation, enabling efficient CP decomposition on multicore systems.
The matricized-tensor times Khatri-Rao product (MTTKRP) is the computational bottleneck for algorithms computing CP decompositions of tensors. In this paper, we develop shared-memory parallel algorithms for MTTKRP involving dense tensors. The algorithms cast nearly all of the computation as matrix operations in order to use optimized BLAS subroutines, and they avoid reordering tensor entries in memory. We benchmark sequential and parallel performance of our implementations, demonstrating high sequential performance and efficient parallel scaling. We use our parallel implementation to compute a CP decomposition of a neuroimaging data set and achieve a speedup of up to $7.4 imes$ over existing parallel software.
Motivation & Objective
- Address the performance bottleneck of MTTKRP in CP tensor decomposition for dense tensors on multicore systems.
- Develop parallel algorithms that leverage optimized BLAS subroutines without requiring expensive tensor data reordering.
- Improve the efficiency of CP decomposition for large-scale neuroimaging data, such as fMRI, where current Matlab-based tools are too slow.
- Enable high-performance, scalable computation on shared-memory architectures using only standard BLAS and OpenMP.
- Demonstrate that optimizing MTTKRP kernels leads to significant speedups in full CP-ALS iterations.
Proposed method
- Design a novel 1-step MTTKRP algorithm that expresses the computation as a sequence of BLAS-optimized matrix operations, avoiding tensor reordering.
- Implement a parallel row-wise algorithm for computing the Khatri-Rao product of multiple matrices using OpenMP and multithreaded BLAS.
- Use the 2-step MTTKRP algorithm from Phan et al. (2013) as a baseline for comparison, also parallelized via OpenMP and BLAS.
- Structure both MTTKRP algorithms to maintain a single, fixed tensor memory layout, preserving data locality and eliminating costly reordering.
- Integrate the optimized MTTKRP kernels into a CP-ALS solver for neuroimaging data, using 1-step for outer modes and 2-step for inner modes.
- Benchmark performance on 3D and 4D fMRI tensors across different ranks and thread counts, comparing to sequential and parallel Matlab implementations.
Experimental results
Research questions
- RQ1Can MTTKRP for dense tensors be parallelized efficiently on shared-memory systems without data reordering, while still leveraging highly optimized BLAS routines?
- RQ2How do the 1-step and 2-step MTTKRP algorithms compare in terms of sequential and parallel performance across varying tensor dimensions and ranks?
- RQ3What is the impact of optimizing MTTKRP on the overall performance of CP-ALS for real-world neuroimaging data?
- RQ4How does the computational cost of the Khatri-Rao product affect the overall MTTKRP performance, especially in small modes?
- RQ5Can further optimization, such as avoiding repeated KRP computation across modes, yield additional performance gains in CP-ALS?
Key findings
- The proposed 1-step MTTKRP algorithm achieves up to 12× speedup over a baseline implementation using 12 threads, with significant gains in both sequential and parallel performance.
- The 2-step MTTKRP algorithm consistently outperforms the baseline, with parallel speedups of up to 8× on 12 cores for the same tensor sizes.
- For fMRI data, the full CP-ALS implementation using the optimized MTTKRP kernels achieves a 7.4× speedup over existing parallel software, particularly for larger ranks.
- The Khatri-Rao product computation is a major performance bottleneck, consuming up to half the time in the 1-step algorithm despite involving only 1/30th the number of floating-point operations.
- Sequential performance of the C implementation is up to 2× faster than Matlab’s Tensor Toolbox when using a single core, indicating strong kernel-level optimization.
- Residual error computation in CP-ALS has become a new performance bottleneck as MTTKRP optimization improves, suggesting future optimization should target these components as well.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.