The Generalized Matrix Chain Algorithm
Henrik Barthels, Marcin Copik, Paolo Bientinesi

TL;DR
This paper introduces a generalized matrix chain algorithm that automates the optimization of complex linear algebra expressions, significantly improving code efficiency over existing libraries.
Contribution
It extends the classic matrix chain algorithm to handle complex expressions with transposition, inversion, and kernel mapping, automating the optimization process.
Findings
Generated code outperforms other libraries by a factor of about 9.
Automates complex linear algebra expression optimization.
Addresses a manual process in linear algebra code generation.
Abstract
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 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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
