[Paper Review] Implementing Strassen's Algorithm with BLIS
This paper presents a novel, high-performance implementation of Strassen's matrix multiplication algorithm within the BLIS framework, enabling it to outperform classical DGEMM even for small matrices and rank-k updates—common in LAPACK—without requiring external workspace or modifying the standard BLAS interface. The approach leverages optimized memory tiling and recursive submatrix operations to reduce data movement overhead, achieving significant speedups on multi-core and many-core architectures including Intel Xeon Phi.
We dispel with "street wisdom" regarding the practical implementation of Strassen's algorithm for matrix-matrix multiplication (DGEMM). Conventional wisdom: it is only practical for very large matrices. Our implementation is practical for small matrices. Conventional wisdom: the matrices being multiplied should be relatively square. Our implementation is practical for rank-k updates, where k is relatively small (a shape of importance for libraries like LAPACK). Conventional wisdom: it inherently requires substantial workspace. Our implementation requires no workspace beyond buffers already incorporated into conventional high-performance DGEMM implementations. Conventional wisdom: a Strassen DGEMM interface must pass in workspace. Our implementation requires no such workspace and can be plug-compatible with the standard DGEMM interface. Conventional wisdom: it is hard to demonstrate speedup on multi-core architectures. Our implementation demonstrates speedup over conventional DGEMM even on an Intel(R) Xeon Phi(TM) coprocessor utilizing 240 threads. We show how a distributed memory matrix-matrix multiplication also benefits from these advances.
Motivation & Objective
- To challenge and overturn conventional wisdom that Strassen's algorithm is impractical for small matrices and non-square shapes.
- To enable Strassen-based DGEMM to be plug-compatible with standard BLAS interfaces, eliminating the need for explicit workspace arguments.
- To achieve high performance on modern multi-core and many-core systems, including Intel Xeon Phi, without additional memory allocation.
- To extend the benefits of Strassen's algorithm to distributed memory environments through integration with SUMMA-based implementations.
- To demonstrate that Strassen can be efficiently used in high-performance linear algebra libraries like LAPACK, particularly for rank-k updates.
Proposed method
- The authors modify the BLIS framework's micro-kernel and packing routines to support recursive Strassen-style matrix multiplication using submatrix partitioning.
- They employ a recursive, divide-and-conquer approach with 2x2 block decomposition, applying Strassen's seven-multiplication formula to submatrices.
- The ABC Strassen variant is used to minimize temporary storage, requiring only buffers already present in high-performance DGEMM implementations.
- The method integrates seamlessly with existing multi-threading and cache-blocking strategies used in BLIS for conventional DGEMM.
- Performance is optimized by reorganizing data movement between memory levels, reducing the impact of additional arithmetic operations and memory traffic.
- The implementation supports both single-level and multi-level recursion, with performance tuned via a predictive cost model.
Experimental results
Research questions
- RQ1Can Strassen's algorithm be made practical for small matrices and non-square shapes, such as those arising in rank-k updates?
- RQ2Is it possible to implement Strassen's algorithm without requiring additional workspace beyond what is already used in high-performance DGEMM?
- RQ3Can Strassen-based multiplication achieve speedup on multi-core and many-core architectures like Intel Xeon Phi without interface changes?
- RQ4How does the performance of Strassen compare to classical DGEMM across different matrix shapes, including those common in LAPACK and ScaLAPACK?
- RQ5Can Strassen's algorithm be efficiently integrated into distributed memory parallel implementations, such as SUMMA, without sacrificing scalability?
Key findings
- The ABC Strassen implementation outperforms classical DGEMM even for matrices as small as 1600×1600, defying the conventional belief that Strassen is only useful for large matrices.
- For rank-k updates with small inner dimensions (e.g., k=1024), the ABC Strassen algorithm achieves superior performance compared to classical DGEMM, making it ideal for LAPACK-style computations.
- The implementation requires no additional workspace beyond what is already used in high-performance DGEMM, enabling plug-compatible integration with standard BLAS interfaces.
- On an Intel Xeon Phi with 240 threads, the Strassen implementation demonstrates measurable speedup over classical DGEMM, proving its viability on many-core systems.
- In distributed memory settings using SUMMA, the ABC Strassen algorithm achieves the best performance when used as the local gemm kernel, especially for matrices with shapes favorable to rank-k updates.
- The predictive cost model accurately forecasts performance across different matrix sizes and recursion levels, validating the design choices and enabling optimization.
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.