Skip to content

Remove ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE CMake option #2960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions src/Dialect/ONNX/Transforms/Decompose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,10 @@ bool hasStaticSpatialDims(Value v) {
}

bool shouldDecomposeConvTransposeOp(Value convTransposeResult) {
#ifdef ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE
ONNXConvTransposeOp op =
mlir::cast<ONNXConvTransposeOp>(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.
Expand Down Expand Up @@ -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
Expand All @@ -1141,7 +1135,6 @@ void DecomposeONNXToONNXPass::runOnOperation() {
});
#ifdef ONNX_MLIR_ENABLE_STABLEHLO
}
#endif
#endif

RewritePatternSet patterns(context);
Expand Down
Loading