使用MKL、cuBLAS和SYCL在CPU和GPU上的矩阵乘法算法的计算与能耗性能评估
Evaluation of computational and energy performance in matrix multiplication algorithms on CPU and GPU using MKL, cuBLAS and SYCL
AI总结:
该研究评估了CPU和GPU上不同矩阵乘法库(MKL、cuBLAS、SYCL)的计算与能耗性能,发现MKL和带张量核心的cuBLAS性能最佳但精度略降,CPU可实现接近GPU的性能但功耗更高。
摘要:
矩阵乘法是用于训练深度神经网络模型的反向传播算法中的基础操作。诸如Intel的MKL或NVIDIA的cuBLAS等库实现了新的、优化的矩阵乘法技术,这些技术提高了性能并降低了计算成本。这些技术也可以在CUDA和SYCL中实现,并使用带有AVX2和AVX512指令的函数,这些函数性能较低但精度更高。该研究使用PAPI和PERF比较了执行时间和功耗,并比较了不同矩阵大小下的精度。比较在第三代和第四代Intel CPU以及NVIDIA V100和A100 GPU等架构上进行。MKL库表现出最佳性能,但精度略有损失,而CPU实现上的OpenMP和SYCL表现出最佳精度但性能有所损失。另一方面,GPU上的结果表明,带有张量核心的cuBLAS具有最佳性能;然而,它在精度上付出了代价。没有这些专用核心的cuBLAS库显示出最小的性能损失和更高的精度。在不同架构上获得的数据表明,CPU可以达到接近GPU的性能,但功耗增加。这些结果取决于某些硬件规格,例如CPU的核心数、时钟频率、处理器代次,以及GPU的PCI总线速度和带宽以及设备架构(计算能力)。
英文摘要:
Matrix multiplication is fundamental in the backpropagation algorithm used to train deep neural network models. Libraries like Intel's MKL or NVIDIA's cuBLAS implemented new and optimized matrix multiplication techniques that increase performance and reduce computational costs. These techniques can also be implemented in CUDA and SYCL and functions with AVX2 and AVX512 instructions, which have lower performance but better precision. The study compares execution times and power consumption using PAPI and PERF and compares accuracy for different matrix sizes. Comparisons were made on architectures such as third and fourth-generation Intel CPUs and NVIDIA V100 and A100 GPUs. The MKL library showed the best performance with a slight loss of precision, while OpenMP and SYCL on the CPU implementation showed the best accuracy but a loss of performance. On the other hand, the results on GPU showed that cuBLAS with tensor cores had the best performance; however, it had a cost in accuracy. The cuBLAS library without these specialized cores shows minimal performance loss and much higher accuracy. The data obtained on different architectures showed that the CPU could achieve performance close to that obtained on the GPU with increased power consumption. These results are conditional on certain hardware specifications, such as the number of cores, clock frequency, processor generation for the CPU, and the speed and bandwidth of the PCI bus and device architecture (compute capability) for the GPU.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。