Einsum Trees: An Abstraction for Optimizing the Execution of Tensor Expressions
Einsum is a declarative language for tensor expressions that specifies an output tensor in terms of several input tensors. However, it does not specify how to compute the output tensor from the input tensors. A typical computational backend for the einsum language comprises two parts: First, a contraction path algorithm that breaks down an einsum expression into a sequence of binary tensor contractions. Second, the execution of the binary contractions. For efficient binary contractions, the data layout of the tensors must be optimized. So far, the computation of contraction paths and the optimization of the data layout for single, that is, local, binary tensor contractions have been studied in isolation. For optimizing the overall execution times of einsum expressions, we introduce Einsum Tree IR, an intermediate representation for globally optimizing the data layout for a given contraction path. We illustrate the effectiveness of the approach on a state-of-the-art Arm server processor, an x86 server processor, and an x86 desktop system.
Authors
- Julien Klaus (ORCID: https://orcid.org/0000-0002-1498-2653)
- Alexander Heinecke
- Joachim Giesen (ORCID: https://orcid.org/0000-0001-6598-6833)
- Mark Blacher (ORCID: https://orcid.org/0009-0007-2009-7996)
- Michael Y. Engel
- Alexander Breuer (ORCID: https://orcid.org/0000-0001-8145-3877)
- Stefan Remke
Institutions
- Intel (United States) (US)
- Friedrich Schiller University Jena (DE)
Publication Details
- Published
- 2025-03-27
- DOI
- https://doi.org/10.1145/3676641.3716254
- Primary Topic
- Tensor decomposition and applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00