[PATCH] D114336: [Polly] Generalize the pattern matching to the case of tensor contractions.
Roman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 21 06:10:47 PST 2021
gareevroman created this revision.
gareevroman added a reviewer: Meinersbur.
Herald added a reviewer: bollu.
Herald added a subscriber: asbirlea.
gareevroman requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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 generalizes the pattern matching to the case of tensor contractions using the algorithm described in [2]. Following the ideas introduced in [3], it logically represents tensor contraction operands as matrix multiplication operands and uses the approach presented in [1].
Optimization of tensor contractions will be added in the next patch. These modifications can be found in https://github.com/gareevroman/llvm-project.
[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 Mathematical 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 Operations: A Compiler-Oriented Approach // ACM Transactions on Architecture and Code Optimization (TACO). 2018. Vol. 15, no. 3. P. 34:1–34:27. DOI: 10.1145/3235029.
[3] - Matthews D. High-Performance Tensor Contraction without BLAS // SIAM Journal on Scientific Computing. 2018. Vol. 40, no. 1. P. C 1—C 24. DOI: 110.1137/16m108968x.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D114336
Files:
polly/lib/Transform/MatmulOptimizer.cpp
polly/lib/Transform/ScheduleOptimizer.cpp
polly/test/ScheduleOptimizer/pattern-matching-based-opts-after-delicm_2.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_15.ll
polly/test/ScheduleOptimizer/pattern-matching-based-opts_16.ll
polly/test/ScheduleOptimizer/pattern-matching-based-opts_17.ll
polly/test/ScheduleOptimizer/pattern-matching-based-opts_18.ll
polly/test/ScheduleOptimizer/pattern-matching-based-opts_19.ll
polly/test/ScheduleOptimizer/pattern-matching-based-opts_2.ll
polly/test/ScheduleOptimizer/pattern-matching-based-opts_20.ll
polly/test/ScheduleOptimizer/pattern-matching-based-opts_4.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114336.388756.patch
Type: text/x-patch
Size: 56486 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211121/e0ee2cb0/attachment.bin>
More information about the llvm-commits
mailing list