Skip to content

Commit 9ea4d0b

Browse files
committed
[GlobalOptimization] Update tests for Conv2D to Img2Col pass
Move test file from Preprocessing to GlobalOptimization and update preprocessing_flags.mlir to remove references to the moved pass. Signed-off-by: Phoebe Chen <phoebe.chen@sifive.com>
1 parent 8beb568 commit 9ea4d0b

7 files changed

Lines changed: 5 additions & 7 deletions

File tree

compiler/src/iree/compiler/GlobalOptimization/test/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ iree_lit_test_suite(
1818
# keep sorted
1919
[
2020
"cleanup_numeric_narrowing.mlir",
21+
"conv2d_to_img2col.mlir",
2122
"data_layout_propagation.mlir",
2223
"demote_contraction_inputs_to_bf16.mlir",
2324
"detach_elementwise_from_named_ops.mlir",

compiler/src/iree/compiler/GlobalOptimization/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ iree_lit_test_suite(
1515
lit
1616
SRCS
1717
"cleanup_numeric_narrowing.mlir"
18+
"conv2d_to_img2col.mlir"
1819
"data_layout_propagation.mlir"
1920
"demote_contraction_inputs_to_bf16.mlir"
2021
"detach_elementwise_from_named_ops.mlir"

compiler/src/iree/compiler/Preprocessing/Common/test/conv2d_to_img2col.mlir renamed to compiler/src/iree/compiler/GlobalOptimization/test/conv2d_to_img2col.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: iree-opt --split-input-file -iree-preprocessing-convert-conv2d-to-img2col %s | FileCheck %s
1+
// RUN: iree-opt --split-input-file --iree-global-opt-convert-conv2d-to-img2col %s | FileCheck %s
22

33
func.func @conv_16433136(%arg0: tensor<1x16x16x4xf32>, %arg1: tensor<3x3x4x16xf32>, %arg2: tensor<1x14x14x16xf32>) -> tensor<1x14x14x16xf32> {
44
%0 = linalg.conv_2d_nhwc_hwcf

compiler/src/iree/compiler/Preprocessing/Common/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ iree_compiler_cc_library(
3838
"ApplyPDLPatterns.cpp",
3939
"AttrBasedPipelinePass.cpp",
4040
"Convert1X1FilterConv2DToMatmul.cpp",
41-
"ConvertConv2DToImg2Col.cpp",
4241
"ConvertConvFilterToChannelsLast.cpp",
4342
"ConvertConvToChannelsLast.cpp",
4443
"FoldAttentionWithTranspose.cpp",

compiler/src/iree/compiler/Preprocessing/Common/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ iree_cc_library(
2929
"ApplyPDLPatterns.cpp"
3030
"AttrBasedPipelinePass.cpp"
3131
"Convert1X1FilterConv2DToMatmul.cpp"
32-
"ConvertConv2DToImg2Col.cpp"
3332
"ConvertConvFilterToChannelsLast.cpp"
3433
"ConvertConvToChannelsLast.cpp"
3534
"FoldAttentionWithTranspose.cpp"

compiler/src/iree/compiler/Preprocessing/Common/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ iree_lit_test_suite(
1616
SRCS
1717
"attr_based_pipeline.mlir"
1818
"conv1x1_to_matmul.mlir"
19-
"conv2d_to_img2col.mlir"
2019
"conv_filter_to_channels_last.mlir"
2120
"conv_to_channels_last.mlir"
2221
"fold_attention_with_transpose.mlir"

tests/compiler_driver/preprocessing_flags.mlir

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// RUN: --iree-hal-target-device=local \
33
// RUN: --iree-hal-local-target-device-backends=llvm-cpu \
44
// RUN: --compile-to=preprocessing \
5-
// RUN: --iree-preprocessing-pass-pipeline="builtin.module(util.func(iree-preprocessing-convert-conv2d-to-img2col,iree-preprocessing-pad-linalg-ops{pad-size=16}))" \
6-
// RUN: --mlir-print-ir-after=iree-preprocessing-convert-conv2d-to-img2col --mlir-print-ir-after=iree-preprocessing-pad-linalg-ops %s 2>&1 \
5+
// RUN: --iree-preprocessing-pass-pipeline="builtin.module(util.func(iree-preprocessing-pad-linalg-ops{pad-size=16}))" \
6+
// RUN: --mlir-print-ir-after=iree-preprocessing-pad-linalg-ops %s 2>&1 \
77
// RUN: | FileCheck %s
88

99
func.func @test(%arg0 : tensor<10x20xf32>, %arg1 : tensor<20x30xf32>, %arg2 : tensor<10x30xf32>) -> tensor<10x30xf32> {
@@ -13,7 +13,6 @@ func.func @test(%arg0 : tensor<10x20xf32>, %arg1 : tensor<20x30xf32>, %arg2 : te
1313
}
1414

1515
// Just check that the pass runs, and that the compilation finishes
16-
// CHECK: ConvertConv2DToImg2ColPass (iree-preprocessing-convert-conv2d-to-img2col)
1716
// CHECK: PadLinalgOpsPass (iree-preprocessing-pad-linalg-ops)
1817
// CHECK-LABEL: module
1918
// CHECK: util.func public @test(

0 commit comments

Comments
 (0)