arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.09114cs.DCcs.LG
收藏

一种面向运行时优化矩阵乘法的机器学习方法

A Machine Learning Approach Towards Runtime Optimisation of Matrix Multiplication

Australian National University(澳大利亚国立大学);Pawsey Supercomputing Research Centre(帕沃西超级计算研究中心)

Yufan Xia, Marco De La Pierre, Amanda S. Barnard, Giuseppe Maria Junior Barca

AI总结:

本文提出利用机器学习优化BLAS例程运行时间的方法,通过实时选择线程数实现多核系统下的矩阵乘法性能提升。

摘要:

通用矩阵乘法(GEMM)是科学计算中的基本算法之一。单线程GEMM实现通过阻塞和自动调优等技术得到了很好的优化。然而,由于现代多核共享内存系统的复杂性,确定最小化多线程GEMM运行时间的线程数具有挑战性。我们提出了一种概念验证方法,用于构建一个架构和数据结构感知的线性代数(ADSALA)软件库,该库利用机器学习优化BLAS例程的运行时间性能。更具体地说,我们的方法使用机器学习模型实时自动选择给定GEMM任务的最优线程数,基于收集的训练数据。在两种不同的HPC节点架构上进行的测试结果表明,与传统GEMM实现相比,当使用内存使用量在100 MB以内的GEMM时,速度提高了25至40个百分点。

英文摘要:

The GEneral Matrix Multiplication (GEMM) is one of the essential algorithms in scientific computing. Single-thread GEMM implementations are well-optimised with techniques like blocking and autotuning. However, due to the complexity of modern multi-core shared memory systems, it is challenging to determine the number of threads that minimises the multi-thread GEMM runtime. We present a proof-of-concept approach to building an Architecture and Data-Structure Aware Linear Algebra (ADSALA) software library that uses machine learning to optimise the runtime performance of BLAS routines. More specifically, our method uses a machine learning model on-the-fly to automatically select the optimal number of threads for a given GEMM task based on the collected training data. Test results on two different HPC node architectures, one based on a two-socket Intel Cascade Lake and the other on a two-socket AMD Zen 3, revealed a 25 to 40 per cent speedup compared to traditional GEMM implementations in BLAS when using GEMM of memory usage within 100 MB.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑