The Generalized Matrix Chain Algorithm

04/10/2018
by   Henrik Barthels, et al.
0

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 ... 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/05/2019

Automatic Generation of Efficient Linear Algebra Programs

The level of abstraction at which application experts reason about linea...
research
11/21/2019

The Linear Algebra Mapping Problem

We observe a disconnect between the developers and the end users of line...
research
02/20/2022

Benchmarking the Linear Algebra Awareness of TensorFlow and PyTorch

Linear algebra operations, which are ubiquitous in machine learning, for...
research
07/05/2022

FLOPs as a Discriminant for Dense Linear Algebra Algorithms

Expressions that involve matrices and vectors, known as linear algebra e...
research
03/30/2023

The Essential Algorithms for the Matrix Chain

For a given product of n matrices, the matrix chain multiplication probl...
research
09/07/2022

A Test for FLOPs as a Discriminant for Linear Algebra Algorithms

Linear algebra expressions, which play a central role in countless scien...
research
03/12/2020

Optimization of Generalized Jacobian Chain Products without Memory Constraints

The efficient computation of Jacobians represents a fundamental challeng...

Please sign up or login with your details

Forgot password? Click here to reset