From a93529db926dfabbc9354888efc2917bd2330d62 Mon Sep 17 00:00:00 2001 From: Hsiangkai Wang Date: Thu, 27 Jun 2024 10:04:50 +0100 Subject: fix failed test --- mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp | 6 +++++- mlir/test/Dialect/Linalg/transform-winograd-conv2d.mlir | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp index e0f2d00..6f03d71 100644 --- a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp +++ b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp @@ -3497,10 +3497,14 @@ DiagnosedSilenceableFailure transform::WinogradConv2DOp::applyToOne( return true; }) .Default([&](Operation *op) { - op->emitError("not supported"); return false; }); + if (!supported) { + return emitSilenceableError() + << "this operation is not supported to convert to Winograd Conv2D"; + } + if (supported && failed(maybeTransformed)) { return emitSilenceableError() << "apply Winograd Conv2D failed"; } diff --git a/mlir/test/Dialect/Linalg/transform-winograd-conv2d.mlir b/mlir/test/Dialect/Linalg/transform-winograd-conv2d.mlir index 0a2dcc0..c10e0cc 100644 --- a/mlir/test/Dialect/Linalg/transform-winograd-conv2d.mlir +++ b/mlir/test/Dialect/Linalg/transform-winograd-conv2d.mlir @@ -46,7 +46,6 @@ module attributes {transform.with_named_sequence} { // ----- func.func @conv2d_unsupported(%arg0: tensor<2x10x10x5xf32>, %arg1: tensor<3x3x5x2xf32>, %arg2: tensor<1xf32>, %arg3: tensor<2x8x8x2xf32>) -> tensor<2x8x8x2xf32> { - // expected-error @+1 {{not supported}} %0 = linalg.conv_2d_nhwc_hwcf {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<2x10x10x5xf32>, tensor<3x3x5x2xf32>) outs(%arg3 : tensor<2x8x8x2xf32>) -> tensor<2x8x8x2xf32> return %0 : tensor<2x8x8x2xf32> } @@ -54,6 +53,7 @@ func.func @conv2d_unsupported(%arg0: tensor<2x10x10x5xf32>, %arg1: tensor<3x3x5x module attributes {transform.with_named_sequence} { transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) { %0 = transform.structured.match ops{["linalg.conv_2d_nhwc_hwcf"]} in %arg1 : (!transform.any_op) -> !transform.any_op + // expected-error @+1 {{this operation is not supported to convert to Winograd Conv2D}} %1 = transform.structured.winograd_conv2d %0 { m = 4, r = 3 } : (!transform.any_op) -> (!transform.any_op) transform.yield } -- cgit v1.1