From 2c8e8e5d304396e481c94f17d52819d81906a0d4 Mon Sep 17 00:00:00 2001 From: Philip Lassen Date: Tue, 1 Oct 2024 18:37:29 -0700 Subject: [PATCH] Remove ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE CMake option (#2960) Signed-off-by: philass --- CMakeLists.txt | 5 ----- src/Dialect/ONNX/Transforms/Decompose.cpp | 7 ------- 2 files changed, 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cc121f643..42609866cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ project(onnx-mlir) option(ONNX_MLIR_BUILD_TESTS "Build ONNX-MLIR test executables. If OFF, just generate build targets." ON) option(ONNX_MLIR_CCACHE_BUILD "Set to ON for a ccache enabled build." OFF) option(ONNX_MLIR_ENABLE_STABLEHLO "Enable StableHLO support." ON) -option(ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE "Enable ONNXConvTransposeOp decomposition." ON) option(ONNX_MLIR_ENABLE_WERROR "Enable warnings as errors." OFF) option(ONNX_MLIR_SUPPRESS_THIRD_PARTY_WARNINGS "Suppress warning in third_party code." ON) option(ONNX_MLIR_ENABLE_JAVA "Set to ON for building the Java runtime, tools, and tests" ON) @@ -208,10 +207,6 @@ if (ONNX_MLIR_ENABLE_STABLEHLO) add_compile_definitions(ONNX_MLIR_ENABLE_STABLEHLO) endif() -if (ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE) - add_compile_definitions(ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE) -endif() - add_subdirectory(utils) add_subdirectory(include) add_subdirectory(src) diff --git a/src/Dialect/ONNX/Transforms/Decompose.cpp b/src/Dialect/ONNX/Transforms/Decompose.cpp index 6ea3fce402..91a4f137f5 100644 --- a/src/Dialect/ONNX/Transforms/Decompose.cpp +++ b/src/Dialect/ONNX/Transforms/Decompose.cpp @@ -332,15 +332,10 @@ bool hasStaticSpatialDims(Value v) { } bool shouldDecomposeConvTransposeOp(Value convTransposeResult) { -#ifdef ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE ONNXConvTransposeOp op = mlir::cast(convTransposeResult.getDefiningOp()); return hasShapeAndRank(convTransposeResult) && hasStaticSpatialDims(op.getX()) && hasStaticSpatialDims(op.getW()); -#else - // Disable the ONNXConvTransposeOp decomposition patterns. - return false; -#endif } // Split on the specified axis. The length of each output is one. @@ -1128,7 +1123,6 @@ void DecomposeONNXToONNXPass::runOnOperation() { op, alpha, rankA, rankB); }); -#ifdef ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE #ifdef ONNX_MLIR_ENABLE_STABLEHLO // ONNXtoStablehlo pass has own rewriting for ConvTranspose Op using // stablehlo ops. To avoid conflict with it, decomposing for ConvTranspose @@ -1141,7 +1135,6 @@ void DecomposeONNXToONNXPass::runOnOperation() { }); #ifdef ONNX_MLIR_ENABLE_STABLEHLO } -#endif #endif RewritePatternSet patterns(context);