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

线性代数式的矩阵链算法

The Matrix Chain Algorithm to Compile Linear Algebra Expressions

Henrik Barthels, Paolo Bientinesi

摘要:

矩阵链问题在于找到矩阵乘积$M := A_1 A_2 \cdots A_n$的括号化,使标量运算的数量最小化。然而,在实际应用中,人们经常会遇到更复杂的场景,其中表达式涉及转置、求逆、具有给定属性的矩阵和序列。这种表达式的计算利用了一组计算内核,这些内核提供的功能远远超出了简单的矩阵乘积。然后,挑战从寻找最佳括号转移到寻找输入表达式到可用内核的最佳映射。此外,通常的情况是,基于标量操作的最小化的解决方案不会导致在执行时间方面的最优解决方案,和/或可能在数值上不稳定。在本文中,我们介绍了一些推广的矩阵链问题-包括内核,属性,序列和成本函数-并提出相应的算法解决方案。这项工作的动机来自于这样一个事实,尽管编译器的发展取得了很大的进步,但将线性代数问题映射到优化内核的任务仍然需要手动完成。为了减轻用户从这一复杂的任务,新的技术,编译线性代数表达式必须开发。

英文摘要:

The 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 scenarios, where expressions involve transposition, inversion, matrices with given properties, and sequences. The computation of such expressions makes use of 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, and/or might be numerically unstable. In this paper, we introduce a number of generalizations of the matrix chain problem--including kernels, properties, sequences, and cost functions--and present corresponding algorithmic solutions. 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分析而来,可能存在错误,请以论文正文为准。

↑