[PATCH] D137037: [Polly] Generalize the optimization of matrix multiplications to the case of tensor contractions

Roman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 30 02:07:08 PDT 2022


gareevroman created this revision.
gareevroman added a reviewer: Meinersbur.
Herald added a reviewer: bollu.
Herald added a subscriber: asbirlea.
Herald added a project: All.
gareevroman requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137037

Files:
  polly/lib/Transform/MatmulOptimizer.cpp
  polly/test/ScheduleOptimizer/mat_mul_pattern_data_layout_2.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts-after-delicm.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_11.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_13.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_3.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_4.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_5.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_6.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_7.ll
  polly/test/ScheduleOptimizer/pattern-matching-based-opts_8.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137037.471821.patch
Type: text/x-patch
Size: 34542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221030/c5c0d1e3/attachment.bin>


More information about the llvm-commits mailing list