Abstract
Sparse Matricized Tensor Times Khatri-Rao Product (spMTTKRP) is the bottleneck kernel of sparse tensor decomposition. In this work, we propose a GPU-based algorithm design to address the key challenges in accelerating spMTTKRP computation, including (1) eliminating global atomic operations across GPU thread blocks, (2) avoiding the intermediate values being communicated between GPU thread blocks and GPU global memory, and (3) ensuring a balanced distribution of workloads across GPU thread blocks. Our approach also supports dynamic tensor remapping, enabling the above optimizations in all the modes of the input tensor. Our approach achieves a geometric mean speedup of 1.5x, 2.0x, and 21.7x in total execution time across widely used datasets compared with the state-of-the-art GPU implementations. Our work is the only GPU implementation that can support tensors with modes greater than 4 since the state-of-the-art works have implementation constraints for tensors with a large number of modes.
Introduction
Tensor Decomposition (TD) is a critical technique for uncovering latent structures in multi-dimensional data, with applications spanning social network analysis, signal processing, and recommender systems. However, real-world data is predominantly sparse and irregular, making the core computational engine—the Sparse Matricized Tensor Times Khatri-Rao Product (spMTTKRP)—notoriously difficult to optimize on parallel architectures like GPUs.
Existing GPU implementations of spMTTKRP face three primary hurdles: irregular memory access patterns, significant load imbalance across processing cores, and high synchronization overhead. Most current methods rely on global atomic operations to manage concurrent updates to the same memory locations, leading to severe latency. Furthermore, many solutions require multiple static copies of the tensor to handle different dimensions (modes), leading to a "memory explosion" as dimensionality increases.
Technical Innovations
To address these challenges, we introduce a GPU-tailored approach utilizing the FLYCOO (FLy-COOrdinate) tensor format and three key technical innovations.
Hypergraph-Based Partitioning
We represent the sparse tensor as a hypergraph and employ a cyclic partitioning scheme. By carefully partitioning the tensor based on output vertices, we ensure that all computations for a specific output row are contained within a single GPU thread block. This strategy effectively transforms a global synchronization problem into a local one, eliminating the need for expensive global atomic operations.
Dynamic Tensor Remapping
Rather than storing redundant static copies of the tensor for each mode, our algorithm reorders tensor elements dynamically during execution. As the GPU completes computation for one mode, it rearranges the data in the background to prepare for the next. This approach maintains a single tensor copy, significantly reducing the memory footprint and enabling support for high-dimensional tensors (5+ modes).
Optimized GPU Execution Flow
We designed a specialized 2D thread block mapping ($R \times P$) where $R$ represents the decomposition rank and $P$ represents parallel non-zero element processing. This design maximizes L1 cache utilization and minimizes communication with slower global memory. By keeping updates within the thread block, we achieved 2.3x higher L1-cache throughput compared to traditional methods.
Evaluation and Results
The system was evaluated on an NVIDIA RTX 3090 using datasets from the FROSTT repository and various recommender systems, including large-scale tensors like Amazon and high-dimensional ones like Twitch (5 modes).
- Performance: Our approach achieved geometric mean speedups of 1.5x over BLCO, 2.0x over MM-CSF, and 21.7x over ParTI-GPU.
- Efficiency: The design demonstrated 1.2x to 2.0x higher Streaming Multiprocessor (SM) throughput than baselines.
- Scalability: Due to the mode-agnostic FLYCOO format and dynamic remapping, this is the only tested implementation capable of handling high-mode datasets like Twitch and Vast effectively.
Conclusion
By prioritizing data locality and eliminating global synchronization through hypergraph partitioning, our GPU-based spMTTKRP algorithm provides a scalable and highly efficient solution for sparse tensor decomposition. While dynamic remapping introduces some overhead (5-35%), the overall performance gains and memory efficiency represent a significant advancement. Future work will explore adapting this parallel algorithm for heterogeneous platforms combining CPUs, GPUs, and FPGAs to further mitigate preprocessing bottlenecks.
Summary updated