arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1912.12924cs.MS
收藏

Linnea:高效线性代数程序的自动生成

Linnea: Automatic Generation of Efficient Linear Algebra Programs

Henrik Barthels, Christos Psarras, Paolo Bientinesi

摘要:

将线性代数计算转换为高效的库调用序列是一项重要的任务,需要线性代数和高性能计算方面的专业知识。几乎所有用于矩阵计算的高级语言和库(例如,Matlab,Eigen)在内部使用优化的内核,例如由BLAS和LAPACK提供的内核;然而,它们的翻译算法通常过于简单,因此导致所述内核的次优使用,从而导致显著的性能损失。为了结合高级语言提供的生产力和低级别内核的性能,我们正在开发Linnea,一个用于线性代数问题的代码生成器。作为输入,Linnea接受线性代数问题的高级描述;作为输出,它返回对高性能内核的有效调用序列。Linnea使用自定义的最佳优先搜索算法,在不到一秒的时间内找到第一个解决方案,并在更多的时间内找到更好的解决方案。在125个测试问题中,Linnea生成的代码几乎总是优于Matlab,Julia,Eigen和Armadillo,加速高达或超过10倍。

英文摘要:

The translation of linear algebra computations into efficient sequences of library calls is a non-trivial task that requires expertise in both linear algebra and high-performance computing. Almost all high-level languages and libraries for matrix computations (e.g., Matlab, Eigen) internally use optimized kernels such as those provided by BLAS and LAPACK; however, their translation algorithms are often too simplistic and thus lead to a suboptimal use of said kernels, resulting in significant performance losses. In order to combine the productivity offered by high-level languages, and the performance of low-level kernels, we are developing Linnea, a code generator for linear algebra problems. As input, Linnea takes a high-level description of a linear algebra problem; as output, it returns an efficient sequence of calls to high-performance kernels. Linnea uses a custom best-first search algorithm to find a first solution in less than a second, and increasingly better solutions when given more time. In 125 test problems, the code generated by Linnea almost always outperforms Matlab, Julia, Eigen and Armadillo, with speedups up to and exceeding 10x.

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

↑