[PATCH] D79927: [MLIR] [Linalg] Add option to use the partial view after promotion.

Pierre Oechsel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 02:05:48 PDT 2020


poechsel created this revision.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: nicolasvasilache.
Herald added a reviewer: aartbik.
Herald added a project: LLVM.
poechsel added a reviewer: ftynse.

For now the promoted buffer is indexed using the `full view`. The full view might be
slightly bigger than the partial view (which is accounting for boundaries).
Unfortunately this does not compose easily with other transformations when multiple buffers
with shapes related to each other are involved.
Take `linalg.matmul A B C` (with A of size MxK, B of size KxN and C of size MxN) and suppose we are:

- Tiling over M by 100
- Promoting A only

This is producing a `linalg.matmul promoted_A B subview_C` where `promoted_A` is a promoted buffer
of `A` of size (100xK) and `subview_C` is a subview of size mxK where m could be smaller than 100 due
to boundaries thus leading to a possible incorrect behavior.

We propose to:

- Add a new parameter to the tiling promotion allowing to enable the use of the full tile buffer.
- By default all promoted buffers will be indexed by the partial view.

Note that this could be considered as a breaking change in comparison to the way the tiling promotion
was working.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79927

Files:
  mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
  mlir/include/mlir/Dialect/Vector/EDSC/Intrinsics.h
  mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
  mlir/test/Dialect/Linalg/promote.mlir
  mlir/test/lib/Transforms/TestLinalgTransforms.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79927.263939.patch
Type: text/x-patch
Size: 8802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200514/3f6ee96d/attachment-0001.bin>


More information about the llvm-commits mailing list