[Mlir-commits] [mlir] [mlir][linalg] Enable masked vectorisation for depthwise convolutions (PR #81625)

Andrzej Warzyński llvmlistbot at llvm.org
Fri Mar 8 07:43:59 PST 2024


================
@@ -3371,7 +3465,17 @@ vectorizeConvolution(RewriterBase &rewriter, LinalgOp op,
   res = e.generateNcwPooling();
   if (succeeded(res))
     return res;
-  return e.generateDilatedConv(flatten1DDepthwiseConv);
+
+  uint64_t vecChDimSize = ShapedType::kDynamic;
+  bool vecChDimScalableFlag = false;
+  if (!inputVecSizes.empty()) {
+    // Only use the input vector size corresponding to the channel dim. Other
+    // vector dims will be inferred from the Ops.
+    vecChDimSize = inputVecSizes[2];
+    vecChDimScalableFlag = inputScalableVecDims[2];
----------------
banach-space wrote:

I've double check and at this point we hit either:
* `depthwise_conv_1d_nwc_wc`, or
* `depthwise_conv_1d_ncw_cw`.

The latter is not vectorised atm and I'll add a case to vectorization-unsupported.mlir to document that. I will also add an assert and update this code to work for both types of convs (even though NCW is not really supported further down). Thanks for the suggestion! 👍🏻 

https://github.com/llvm/llvm-project/pull/81625


More information about the Mlir-commits mailing list