[all-commits] [llvm/llvm-project] 6bb7d2: [mlir][Linalg] Add a first vectorization pattern f...

Nicolas Vasilache via All-commits all-commits at lists.llvm.org
Wed Oct 20 07:03:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bb7d2474fe4d3a68e2d1efefaa0bc8a244737bb
      https://github.com/llvm/llvm-project/commit/6bb7d2474fe4d3a68e2d1efefaa0bc8a244737bb
  Author: Nicolas Vasilache <nicolas.vasilache at gmail.com>
  Date:   2021-10-20 (Wed, 20 Oct 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
    M mlir/lib/Dialect/Vector/VectorTransforms.cpp
    A mlir/test/Dialect/Linalg/vectorize-convolution.mlir
    M mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp

  Log Message:
  -----------
  [mlir][Linalg] Add a first vectorization pattern for conv1d in NWCxWCF format.

This revision uses the newly refactored StructuredGenerator to create a simple vectorization for conv1d_nwc_wcf.

Note that the pattern is not specific to the op and is technically not even specific to the ConvolutionOpInterface (modulo minor details related to dilations and strides).

The overall design follows the same ideas as the lowering of vector::ContractionOp -> vector::OuterProduct: it seeks to be minimally complex, composable and extensible while avoiding inference analysis. Instead, we metaprogram the maps/indexings we expect and we match against them.

This is just a first stab and still needs to be evaluated for performance.
Other tradeoffs are possible that should be explored.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111894




More information about the All-commits mailing list