This is an archive of the discontinued LLVM Phabricator instance.

[Polly] Generalize the optimization of matrix multiplications to the case of tensor contractions
Needs ReviewPublic

Authored by gareevroman on Oct 30 2022, 2:07 AM.



The pattern matching optimization of Polly detects and optimizes dense general matrix-matrix multiplication. The generated code is close to high performance implementations of matrix-matrix multiplications, which are contained in manually tuned libraries [1]. The described pattern matching optimization is a particular case of tensor contraction optimization, which was introduced in [2].
This patch applies the approach presented in [1] to optimize tensor contractions, which are logically represented as matrix multiplications.
[1] - Low T.M., Igual F.D., Smith T.M., Quintana-Orti E.S. Analytical Modeling Is Enough for High-Performance BLIS ACM Transactions on Mathemat­ical Software. 2016. Vol. 43, no. 2. P. 12:1—12:18. DOI: 10.1145/2925987.
[2] - Gareev R., Grosser T., Kruse M. High-Performance Generalized Tensor Op­erations: A Compiler-Oriented Approach
ACM Transactions on Architec­ture and Code Optimization (TACO). 2018. Vol. 15, no. 3. P. 34:1–34:27. DOI: 10.1145/3235029.

Diff Detail

Event Timeline

gareevroman created this revision.Oct 30 2022, 2:07 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: asbirlea. · View Herald Transcript
gareevroman requested review of this revision.Oct 30 2022, 2:07 AM