[Mlir-commits] [mlir] [mlir][linalg] Fix inferConvolutionDimsImpl (depthwise convs) (PR #90057)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Apr 25 09:50:32 PDT 2024


================
@@ -1062,6 +1062,28 @@ module attributes { transform.target_tag = "start_here" } {
     return %result : tensor<10x18x15xf64>
   }
 
+  func.func @convolution_depthwise(%input: tensor<1x10x196x48xf32>, %filter: tensor<1x4x48xf32>) -> tensor<1x10x191x48xf32> {
+    %cst = arith.constant 0.0 : f32 
+    %empty = tensor.empty() : tensor<1x10x191x48xf32>
+    %fill = linalg.fill ins(%cst : f32) outs(%empty : tensor<1x10x191x48xf32>) -> tensor<1x10x191x48xf32>
+    // expected-remark @below {{convolution}}
+    // expected-remark @below {{batch dims 0}}
+    // expected-remark @below {{output image dims 1 : i64, 2 : i64}}
+    // expected-remark @below {{output channel dims 3}}
+    // expected-remark @below {{filter loop dims 4 : i64, 5 : i64}}
+    // expected-remark @below {{input channel dims}}
+    // expected-remark @below {{depth dims 3}}
----------------
banach-space wrote:

Thanks for pointing this out - now I see what's happening here. IIUC, "channel" is only used for non-depthwise convolutions. For depthwise convs (HWC), this logic uses the term "depth" instead. Now, "depth" is: 
* a parallel dim
* identical for all inputs.

It looks like this PR is breaking rather than fixing things :joy: Let me update and rephrase.

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


More information about the Mlir-commits mailing list