General matrix-matrix multiplications (GEMM ) in vendor-supplied BLAS libraries are best optimized for square matrices but often show bad performance for tall & skinny matrices, which are much taller than wide. Nvidia 's current CUBLAS implementation delivers only a fraction of the potential performance (as given by the roofline model ) in this case. We describe the challenges and key properties of an implementation that can achieve perfect performance. We further evaluate different approaches of parallelization and thread distribution, and devise a flexible, configurable mapping scheme. A code generation approach enables a simultaneously flexible and specialized implementation with autotuning. This results in perfect performance for a large range of matrix sizes in the domain of interest , and at least 2/3 of maximum performance for the rest on an Nvidia Volta GPGPU.
General matrix-matrix multiplications with double-precision real and complex entries (DGEMM and ZGEMM ) in vendor-supplied BLAS libraries are best optimized for square matrices but often show bad performance for tall & skinny matrices, which are much taller than wide. NVIDIA 's current CUBLAS implementation delivers only a fraction of the potential performance as indicated by the roofline model in this case. We describe the challenges and key characteristics of an implementation that can achieve close to optimal performance. We further evaluate different strategies of parallelization and thread distribution, and devise a flexible, configurable mapping scheme. To ensure flexibility and allow for highly tailored implementations we use code generation combined with autotuning. For a large range of matrix sizes in the domain of interest we achieve at least 2/3 of the roofline performance and often substantially outperform state-of-the art CUBLAS results on an NVIDIA Volta GPGPU.
R
(GEMM
with double-precision real and complex entries (DGEMM and ZGEMM
R
Nvidia
NVIDIA
R
(as given
as indicated
D
)
R
properties
characteristics
R
perfect
close to optimal
R
approaches
strategies
R
A code generation approach enables a simultaneously flexible and specialized implementation
To ensure flexibility and allow for highly tailored implementations we use code generation combined
R
This results in perfect performance for
For
R
, and
we achieve
R
maximum performance for the rest on an Nvidia
the roofline performance and often substantially outperform state-of-the art CUBLAS results on an NVIDIA