Compilation of Generalized Matrix Chains with Symbolic Sizes
Francisco L\'opez, Lars Karlsson, and Paolo Bientinesi

TL;DR
This paper presents a code generation approach for generalized matrix chains with symbolic sizes, using multi-versioning and theoretical guarantees to optimize performance across all size configurations.
Contribution
It introduces a novel multi-versioning code generator for GMCs with symbolic sizes, ensuring near-optimal performance across all matrix size scenarios.
Findings
Generated code's FLOPs and execution time are within 15% of optimal for 95% of tested chains.
Theoretical results guarantee constant-factor near-optimality for all matrix sizes.
Empirical tuning further improves practical performance.
Abstract
Generalized Matrix Chains (GMCs) are products of matrices where each matrix carries features (e.g., general, symmetric, triangular, positive-definite) and is optionally transposed and/or inverted. GMCs are commonly evaluated via sequences of calls to BLAS and LAPACK kernels. When matrix sizes are known, one can craft a sequence of kernel calls to evaluate a GMC that minimizes some cost, e.g., the number of floating-point operations (FLOPs). Even in these circumstances, high-level languages and libraries, upon which users usually rely, typically perform a suboptimal mapping of the input GMC onto a sequence of kernels. In this work, we go one step beyond and consider matrix sizes to be symbolic (unknown); this changes the nature of the problem since no single sequence of kernel calls is optimal for all possible combinations of matrix sizes. We design and evaluate a code generator for GMCs…
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.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Numerical Methods and Algorithms · Embedded Systems Design Techniques
