Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Revert "[Add Pass] CommonSubexpressionElimination (#1116)" (#1164)
Browse files Browse the repository at this point in the history
This reverts commit b9d799b.
  • Loading branch information
CtfGo authored Jan 30, 2023
1 parent c83f3ab commit 31cdf07
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 516 deletions.
16 changes: 6 additions & 10 deletions cinn/frontend/optimize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ DECLARE_bool(cinn_use_fill_constant_folding);
DECLARE_bool(cinn_use_op_fusion);
DECLARE_bool(cinn_use_cudnn_conv);
DECLARE_bool(cinn_use_cublas_gemm);
DECLARE_bool(cinn_use_common_subexpression_elimination);
DECLARE_bool(cinn_check_fusion_accuracy_pass);

namespace cinn {
Expand Down Expand Up @@ -61,26 +60,22 @@ OptimizeOptions DefaultTrainingOptimizeOptions() {
options.graph_passes = {};
#ifdef CINN_WITH_CUDA
if (FLAGS_cinn_use_cublas_gemm) {
options.graph_passes.emplace_back("MatmulToCublasCustomCallPass");
options.graph_passes.push_back("MatmulToCublasCustomCallPass");
}
options.graph_passes.push_back("GaussianRandomToCustomCallPass");
options.graph_passes.push_back("UniformRandomToCustomCallPass");
#ifdef CINN_WITH_CUDNN
if (FLAGS_cinn_use_cudnn_conv) {
options.graph_passes.emplace_back("ConvToCudnnCustomCallPass");
options.graph_passes.push_back("ConvToCudnnCustomCallPass");
}
#endif
#endif

if (FLAGS_cinn_use_op_fusion) {
options.graph_passes.emplace_back("OpFusionPass");
options.graph_passes.emplace_back("FusionMergePass");
options.graph_passes.push_back("OpFusionPass");
options.graph_passes.push_back("FusionMergePass");
} else {
options.graph_passes.emplace_back("BuildNonFusedGroupsPass");
}

if (FLAGS_cinn_use_common_subexpression_elimination) {
options.graph_passes.emplace_back("CommonSubexpressionEliminationPass");
options.graph_passes.push_back("BuildNonFusedGroupsPass");
}

// WARNING: the pass must be the last pass !!!
Expand All @@ -89,6 +84,7 @@ OptimizeOptions DefaultTrainingOptimizeOptions() {
// error and exited.
options.graph_passes.emplace_back("CheckFusionAccuracyPass");
}

return options;
}

Expand Down
2 changes: 0 additions & 2 deletions cinn/hlir/pass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ gather_srcs(cinnapi_src SRCS
dot_merger.cc
check_fusion_accuracy_pass.cc
custom_call_pass.cc
common_subexpression_elimination.cc
)

#cc_test(test_opfusion SRCS opfusion_test.cc DEPS cinncore)
Expand All @@ -28,4 +27,3 @@ if (NOT WITH_CUDA)
#cc_test(test_alterlayout SRCS alterlayout_test.cc DEPS cinncore)
endif()
cc_test(test_dot_merger SRCS test_dot_merger.cc DEPS cinncore)
cc_test(test_common_subexpression_elimination SRCS common_subexpression_elimination_test.cc DEPS cinncore)
305 changes: 0 additions & 305 deletions cinn/hlir/pass/common_subexpression_elimination.cc

This file was deleted.

Loading

0 comments on commit 31cdf07

Please sign in to comment.