Skip to content

Commit

Permalink
Remove ONNX_MLIR_DECOMP_ONNX_CONVTRANSPOSE CMake option (onnx#2960)
Browse files Browse the repository at this point in the history
Signed-off-by: philass <plassen@groq.com>
  • Loading branch information
philass authored Oct 2, 2024
1 parent f8e2466 commit 2c8e8e5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
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

0 comments on commit 2c8e8e5

Please sign in to comment.