探索Cerebras CS-3上的稀疏矩阵乘法内核
Exploring Sparse Matrix Multiplication Kernels on the Cerebras CS-3
AI总结:
本文研究了Cerebras CS-3在稀疏线性代数内核中的性能,针对稀疏-密集矩阵乘法和采样密集-密集矩阵乘法进行了优化,结果显示在高稀疏度下CS-3性能优于CPU,但稀疏度超过99%时性能下降。
摘要:
近年来,新型AI加速器作为GPU的替代方案在AI模型训练和推理任务中展现出潜力。Cerebras CS-3在大模型训练和分子动力学模拟等科学应用中表现出强性能。尽管CS-3已广泛用于密集计算任务,但其在稀疏任务中的潜力尚未被充分探索。应用稀疏线性代数内核(如GNN、线性求解器和推荐系统)可能在数据流加速器如CS-3上获得良好性能。本文探讨了CS-3上的两种关键稀疏线性代数内核:稀疏-密集矩阵乘法(SpMM)和采样密集-密集矩阵乘法(SDDMM)。我们提出了低层CS-3内核设计,并优化设计以提高I/O性能、内存占用和大矩阵的可扩展性。评估分析了内存占用和SpMM/SDDMM相对于CPU的速度提升。评估表明,对于90%稀疏矩阵的SpMM,CS-3比CPU快100倍,随着稀疏矩阵维度增加性能提升。对于90%稀疏矩阵的SDDMM,CS-3比CPU快20倍。此外,发现当稀疏度增加到超过99%时,CS-3性能下降,使其在SpMM中比CPU慢。
英文摘要:
In recent years, novel AI accelerators have emerged as promising alternatives to GPUs for AI model training and inference. One such accelerator, the Cerebras CS-3, has demonstrated strong performance on machine learning as well as scientific applications, such as molecular dynamics and seismic simulations. While the benefits of Cerebras systems for dense workloads have been well demonstrated, their potential for sparse workloads is not yet understood, particularly for large matrices that cannot fit on the device when represented in dense format. Yet, many applications, such as linear solvers and graph neural networks, rely on large sparse matrices. In this work, we make a step toward a better understanding of the use of CS-3 platforms for sparse operations. To this end, we explore two key sparse linear algebra kernels, sparse-dense matrix multiplication (SpMM) and sampled dense-dense matrix multiplication (SDDMM), on the Cerebras CS-3. We propose low-level CS-3 designs for these operations and optimize them to improve I/O performance, memory footprint, and scalability to large matrices. We evaluate speedup relative to the CPU. The results show that our CS-3 kernels can outperform the CPU by up to 100$\times$ for SpMM on 90\% sparse matrices, with performance improving as matrix dimensionality increases. SDDMM on the CS-3 can outperform the CPU by up to 20$\times$ on 90\% sparse matrices. However, as sparsity increases beyond 99\%, our kernels suffer performance degradation, approaching the performance of state-of-the-art CPU libraries or even underperforming them.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。