[Paper Review] ISM2: Optimizing Irregular-Shaped Matrix-Matrix Multiplication on GPUs
This paper proposes TSM2R and TSM2L, two GPU-optimized algorithms for irregular-shaped tall-and-skinny matrix-matrix multiplication, achieving up to 3.5x speedup and significantly improved memory bandwidth (up to 55% improvement) and compute utilization by reorganizing data access and thread mapping for non-uniform matrix shapes.
Linear algebra operations have been widely used in big data analytics and scientific computations. Many works have been done on optimizing linear algebra operations on GPUs with regular-shaped input. However, few works focus on fully utilizing GPU resources when the input is not regular-shaped. Current optimizations do not consider fully utilizing the memory bandwidth and computing power; therefore, they can only achieve sub-optimal performance. In this paper, we propose two efficient algorithms -- TSM2R and TSM2L -- for two classes of tall-and-skinny matrix-matrix multiplications on GPUs. Both of them focus on optimizing linear algebra operation with at least one of the input matrices is tall-and-skinny. Specifically, TSM2R is designed for a large regular-shaped matrix multiplying a tall-and-skinny matrix, while TSM2L is designed for a tall-and-skinny matrix multiplying a small regular-shaped matrix. We implement our proposed algorithms and test on several modern NVIDIA GPU micro-architectures. Experiments show that, compared to the current state-of-the-art works, (1) TSM2R speeds up the computation by 1.1x~3x and improves the memory bandwidth utilization and computing power utilization by 8%~47.6% and 7%~37.3%, respectively, when the regular-shaped matrix size is relatively large or medium; and (2) TSM2L speeds up the computation by 1.1x~3.5x and improve the memory bandwidth utilization by up to 55% when the regular-shaped matrix size is relatively small.
Motivation & Objective
- Address the underutilization of GPU memory bandwidth and computing power in irregular-shaped matrix-matrix multiplication, especially for tall-and-skinny matrices.
- Optimize performance for two common cases: large regular-shaped matrix × tall-and-skinny matrix (TSM2R), and tall-and-skinny matrix × small regular-shaped matrix (TSM2L).
- Improve resource utilization beyond current state-of-the-art methods that fail to fully exploit GPU capabilities on non-regular inputs.
- Achieve higher performance and efficiency on modern NVIDIA GPU micro-architectures through tailored memory access and thread mapping strategies.
Proposed method
- Design TSM2R to optimize multiplication of a large regular-shaped matrix with a tall-and-skinny matrix by reorganizing memory access patterns to improve coalescing and reduce bank conflicts.
- Implement TSM2L for small regular-shaped matrices multiplied with tall-and-skinny matrices, focusing on minimizing redundant memory transactions and maximizing occupancy.
- Use custom thread-block mapping and shared memory tiling strategies tailored to the irregular shape characteristics of tall-and-skinny matrices.
- Balance workload across GPU warps by dynamically adjusting thread block dimensions based on matrix dimensions and GPU architecture.
- Optimize memory access patterns to enhance memory bandwidth utilization through coalesced and strided access patterns.
- Evaluate and tune the algorithms across multiple NVIDIA GPU micro-architectures to ensure portability and performance portability.
Experimental results
Research questions
- RQ1How can GPU memory bandwidth and compute utilization be maximized in irregular-shaped matrix-matrix multiplication, particularly for tall-and-skinny matrices?
- RQ2What are the performance bottlenecks in existing GPU-optimized kernels when handling non-regular matrix shapes?
- RQ3Can custom memory access and thread mapping strategies significantly improve performance for tall-and-skinny matrix multiplication on modern GPUs?
- RQ4How do the proposed algorithms TSM2R and TSM2L compare to state-of-the-art methods in terms of speedup and resource utilization?
Key findings
- TSM2R achieves 1.1x to 3x speedup over state-of-the-art methods when the regular-shaped matrix is large or medium, with up to 47.6% improvement in memory bandwidth utilization.
- TSM2R improves computing power utilization by 7% to 37.3% across tested GPU architectures.
- TSM2L achieves 1.1x to 3.5x speedup on small regular-shaped matrices, with memory bandwidth utilization improvements of up to 55%.
- The proposed algorithms significantly outperform existing methods by better exploiting GPU memory hierarchy and thread-level parallelism in irregular matrix shapes.
- The performance gains are consistent across multiple modern NVIDIA GPU micro-architectures, demonstrating the robustness of the optimization strategy.
- The results confirm that shape-aware optimization is critical for achieving high performance in irregular matrix operations on GPUs.
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.