[Mlir-commits] [mlir] [MLIR] Allowing unsupported conv2d op to fail gracefully from vectorization (PR #130181)

Zhuoran Yin llvmlistbot at llvm.org
Fri Mar 7 10:56:45 PST 2025


================
@@ -3929,9 +3957,11 @@ static FailureOr<Operation *> vectorizeConvolution(
   if (!inputVecSizes.empty()) {
     // Only use the input vector size corresponding to the channel dim. Other
     // vector dims will be inferred from the Ops.
-    assert((isa<linalg::DepthwiseConv1DNwcWcOp>(*op) ||
-            isa<linalg::DepthwiseConv1DNcwCwOp>(*op)) &&
-           "Not a 1D depthwise conv!");
----------------
jerryyin wrote:

Pre-condition check aside, anything unexpected coming into this `vectorizeConvolution()` will fail the series of the `generate.*()` call above and crash here. I don't think we necessarily want to crash a pass if an unexpected op get invoked? I just don't think assertion is the best error handling mechanism. Please let me know what I'm missing here.

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


More information about the Mlir-commits mailing list