广义矩阵链算法
The Generalized Matrix Chain Algorithm
摘要:
在本文中,我们提出了一个广义版本的矩阵链算法,以生成有效的代码线性代数问题,人类专家经常投资几天甚至几周的工作。标准的矩阵链问题在于找到矩阵乘积$M := A_1 A_2 \cdots A_n$的括号化,使标量运算的数量最小化。然而,在实际应用中,人们经常会遇到更复杂的表达式,包括转置、求逆和矩阵性质。事实上,这种表达式的计算依赖于一组计算内核,这些内核提供的功能远远超出了简单的矩阵乘积。然后,挑战从寻找最佳括号转移到寻找输入表达式到可用内核的最佳映射。此外,通常的情况是,基于标量操作的最小化的解决方案不会导致在执行时间方面的最优解决方案。在我们的实验中,生成的代码比其他库和语言的平均性能高出约9倍。这项工作的动机来自于这样一个事实,即-尽管编译器的发展取得了很大的进步-将线性代数问题映射到优化内核的任务仍然需要手动完成。为了减轻用户从这一复杂的任务,新的技术,编译线性代数表达式必须开发。
英文摘要:
In this paper, we present a generalized version of the matrix chain algorithm to generate efficient code for linear algebra problems, a task for which human experts often invest days or even weeks of works. The standard matrix chain problem consists in finding the parenthesization of a matrix product $M := A_1 A_2 \cdots A_n$ that minimizes the number of scalar operations. In practical applications, however, one frequently encounters more complicated expressions, involving transposition, inversion, and matrix properties. Indeed, the computation of such expressions relies on a set of computational kernels that offer functionality well beyond the simple matrix product. The challenge then shifts from finding an optimal parenthesization to finding an optimal mapping of the input expression to the available kernels. Furthermore, it is often the case that a solution based on the minimization of scalar operations does not result in the optimal solution in terms of execution time. In our experiments, the generated code outperforms other libraries and languages on average by a factor of about 9. The motivation for this work comes from the fact that---despite great advances in the development of compilers---the task of mapping linear algebra problems to optimized kernels is still to be done manually. In order to relieve the user from this complex task, new techniques for the compilation of linear algebra expressions have to be developed.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。