Skip to main content
QUICK REVIEW

[Paper Review] Implementing Strassen's Algorithm with CUTLASS on NVIDIA Volta GPUs

Jianyu Huang, Chenhan D. Yu|arXiv (Cornell University)|Aug 24, 2018
Parallel Computing and Optimization TechniquesComputer Science21 references9 citations
TL;DR

This paper presents a novel, memory-efficient implementation of Strassen's algorithm on NVIDIA Volta GPUs using CUTLASS, avoiding extra workspace by reusing shared memory and register files from GEMM kernels. It achieves up to 1.11× speedup over cublasSgemm with a break-even point as low as 1,536 for 1-level Strassen and 1.19× with 7,680 for 2-level Strassen, leveraging fused operations, task-based parallelism, and a predictive performance model.

ABSTRACT

Conventional GPU implementations of Strassen's algorithm (Strassen) typically rely on the existing high-performance matrix multiplication (GEMM), trading space for time. As a result, such approaches can only achieve practical speedup for relatively large, "squarish" matrices due to the extra memory overhead, and their usages are limited due to the considerable workspace. We present novel Strassen primitives for GPUs that can be composed to generate a family of Strassen algorithms. Our algorithms utilize both the memory and thread hierarchies on GPUs, reusing shared memory and register files inherited from GEMM, fusing additional operations, and avoiding extra workspace. We further exploit intra- and inter-kernel parallelism by batching, streaming, and employing atomic operations. We also develop a performance model for NVIDIA Volta GPUs to select the appropriate blocking parameters and predict the performance for GEMM and Strassen. Overall, our 1-level Strassen can achieve up to 1.11x speedup with a crossover point as small as 1,536 compared to cublasSgemm on a NVIDIA Tesla V100 GPU. With additional workspace, our 2-level Strassen can achieve 1.19x speedup with a crossover point at 7,680.

Motivation & Objective

  • To overcome the practical limitations of Strassen's algorithm on GPUs, such as high memory overhead and limited problem size due to workspace requirements.
  • To enable Strassen's algorithm to outperform conventional GEMM for smaller and non-square matrices by eliminating extra global and shared memory usage.
  • To exploit both intra- and inter-kernel parallelism on GPUs through batching, streaming, and atomic operations without increasing kernel launch overhead.
  • To develop an accurate performance model for Volta GPUs to guide optimal blocking parameter selection and predict runtime performance.
  • To demonstrate that Strassen can be efficiently implemented on modern GPUs with minimal memory footprint and high arithmetic intensity, even at small problem sizes.

Proposed method

  • Designing new GPU Strassen kernels that fuse memory and arithmetic operations directly into the GEMM pipeline, reusing existing shared memory and register files to eliminate additional workspace.
  • Optimizing register usage through kernel specialization and operation fusion, reducing register pressure while maintaining high occupancy.
  • Exploiting intra-kernel parallelism across thread blocks, warps, and threads, and inter-kernel parallelism via batching and streaming to overlap computation and memory bandwidth.
  • Using atomic operations to manage concurrent updates in the Strassen computation graph, enabling scalable task-based parallelism.
  • Developing a performance model for Volta GPUs based on arithmetic intensity, memory operations, and register usage to predict performance and select optimal block sizes.
  • Implementing 1-level and 2-level Strassen variants with careful memory access patterns and operand prefetching to minimize latency and maximize overlap.

Experimental results

Research questions

  • RQ1Can Strassen's algorithm be implemented on GPUs without requiring additional global or shared memory workspace beyond standard GEMM?
  • RQ2What is the minimum matrix size at which Strassen outperforms cublasSgemm on modern Volta GPUs when no extra memory is used?
  • RQ3How can intra- and inter-kernel parallelism be effectively exploited in Strassen to maintain high occupancy and hide memory latency?
  • RQ4To what extent can a performance model based on arithmetic intensity and memory operations accurately predict Strassen performance on Volta GPUs?
  • RQ5How does the choice of blocking parameters affect the performance of Strassen relative to GEMM, and how can they be optimized?

Key findings

  • The 1-level Strassen implementation achieves a break-even point of 1,536 on a Tesla V100 GPU, outperforming cublasSgemm for matrices as small as 1,536×1,536.
  • The 2-level Strassen implementation achieves a break-even point of 7,680, with a peak speedup of 1.19× over cublasSgemm, significantly lower than the 13,312 required by prior state-of-the-art methods.
  • The proposed implementation consumes no additional global or shared memory compared to standard GEMM, eliminating workspace-related memory bottlenecks.
  • The performance model accurately predicts runtime performance and guides optimal blocking parameter selection for both GEMM and Strassen kernels.
  • The implementation achieves high arithmetic intensity by fusing operations and overlapping memory and compute phases, reducing the impact of memory bandwidth limitations.
  • The approach demonstrates practical viability of Strassen on GPUs for small and non-square matrices, where previous implementations were not competitive due to memory and performance overhead.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.