Accelerating Matrix Multiplication: A Performance Comparison Between Multi-Core CPU and GPU
Accelerating Matrix Multiplication: A Performance Comparison Between Multi-Core CPU and GPU
Matrix multiplication is a foundational operation in scientific computing and machine learning, yet its computational complexity makes it a significant bottleneck for large-scale applications. The shift to parallel architectures, primarily multi-core CPUs and many-core GPUs, is the established solution, and these systems are now ubiquitous from datacenters to consumer laptops. This paper presents a direct, empirical performance analysis of matrix multiplication on a modern, consumer-grade heterogeneous platform. We implemented and benchmarked three versions of the algorithm: a baseline sequential C++ implementation, a parallel version for its multi-core CPU using OpenMP, and a massively parallel version for its discrete GPU using CUDA with shared memory optimizations. The implementations were evaluated with square matrices of varying dimensions, from 128x128 to 4096x4096. Our results show that while the parallel CPU provides a consistent speedup of 12-14x over the sequential version, the GPU's performance scales dramatically with problem size. For a 4096x4096 matrix, the GPU implementation achieved a speedup of approximately 593x over the sequential baseline and 45x over the optimized parallel CPU version. These findings quantitatively demonstrate the profound impact of many-core GPU architectures on accelerating data-parallel workloads, underscoring that significant performance gains are readily accessible even on consumer-level hardware.
Mudabir Qamar Ansari、Mufakir Qamar Ansari
计算技术、计算机技术
Mudabir Qamar Ansari,Mufakir Qamar Ansari.Accelerating Matrix Multiplication: A Performance Comparison Between Multi-Core CPU and GPU[EB/OL].(2025-07-26)[2025-08-10].https://arxiv.org/abs/2507.19723.点此复制
评论