批量克罗内克积用于NVIDIA GPU上的二维矩阵和三维数组
Batched Kronecker product for 2-D matrices and 3-D arrays on NVIDIA GPUs
AI总结:
本文提出一种在NVIDIA GPU上高效计算批量克罗内克积的方法,适用于相同克罗内克积矩阵但批量运算中操作数变化的场景,通过优化内存使用和计算速度提升性能。
摘要:
我们描述了一种在NVIDIA GPU上执行克罗内克积操作的接口和实现,用于并行处理多个小的二维矩阵和三维数组。该方法适用于克罗内克积组件矩阵相同但批量运算中操作数变化的情况。任何批量GEMM实现,例如我们的实现或cuBLAS中的实现,都可以用于在GPU上执行批量克罗内克积。然而,本文提出的专用实现速度更快且内存使用更少。部分原因是基于简单GEMM的方法需要额外的主存复制。我们专注于矩阵大小小于或等于16的情况,因为这些是有限元中的典型多项式次数,但实现可以轻松扩展到其他大小。在NVIDIA Tesla K20c上使用CUDA 5.0时,处理大小为10和16的矩阵分别获得143和285 GFlop/s的单精度实数性能。三维数组克罗内克积的相应速度分别为126和268 GFlop/s。双精度可通过C++模板机制轻松支持。
英文摘要:
We describe an interface and an implementation for performing Kronecker product actions on NVIDIA GPUs for multiple small 2-D matrices and 3-D arrays processed in parallel as a batch. This method is suited to cases where the Kronecker product component matrices are identical but the operands in a matrix-free application vary in the batch. Any batched GEMM (General Matrix Multiply) implementation, for example ours [1] or the one in cuBLAS, can also be used for performing batched Kronecker products on GPUs. However, the specialized implementation presented here is faster and uses less memory. Partly this is because a simple GEMM based approach would require extra copies to and from main memory. We focus on matrix sizes less than or equal to 16, since these are the typical polynomial degrees in Finite Elements, but the implementation can be easily extended for other sizes. We obtain 143 and 285 GFlop/s for single precision real when processing matrices of size 10 and 16, respectively on NVIDIA Tesla K20c using CUDA 5.0. The corresponding speeds for 3-D array Kronecker products are 126 and 268 GFlop/s, respectively. Double precision is easily supported using the C++ template mechanism.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。