[mlir][Linalg] Convolution tiling added to ConvOp vectorization pass
authorJakub Lichman <limo@google.com>
Thu, 17 Sep 2020 09:26:30 +0000 (09:26 +0000)
committerJakub Lichman <limo@google.com>
Thu, 17 Sep 2020 09:39:41 +0000 (09:39 +0000)
commit347d59b16c71194d7a9372dd69d3e41ebeca3113
tree78cd11522fe977c1bacd7c1db51a7112c99b4037
parent9218f9283802b2d1ff33c490761fdb925b1e56d9
[mlir][Linalg] Convolution tiling added to ConvOp vectorization pass

ConvOp vectorization supports now only convolutions of static shapes with dimensions
of size either 3(vectorized) or 1(not) as underlying vectors have to be of static
shape as well. In this commit we add support for convolutions of any size as well as
dynamic shapes by leveraging existing matmul infrastructure for tiling of both input
and kernel to sizes accepted by the previous version of ConvOp vectorization.
In the future this pass can be extended to take "tiling mask" as a user input which
will enable vectorization of user specified dimensions.

Differential Revision: https://reviews.llvm.org/D87676
13 files changed:
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-ncw-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-nwc-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nchw-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nhwc-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ncdhw-call.mlir
mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ndhwc-call.mlir
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
mlir/test/Conversion/LinalgToVector/linalg-to-vector.mlir
mlir/test/lib/Transforms/TestConvVectorization.cpp