Skip to content

Commit

Permalink
[DRR] replace cc_test_old with cc_test (PaddlePaddle#58268)
Browse files Browse the repository at this point in the history
* replace cc_test_old with cc_test_old

* set source_source_files_properties

* set pattern_rewrite_test use cc_test_old

* replace cc_test_old by paddle_test for drr tests

* fix bug

* edit patternRewrite

* delete note

---------

Co-authored-by: zyfncg <zhangyunfei07@baidu.com>
  • Loading branch information
gongshaotian and zyfncg authored Oct 25, 2023
1 parent 9b17a41 commit 0f4bc90
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 34 deletions.
3 changes: 3 additions & 0 deletions paddle/fluid/framework/executor_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,9 @@ std::unique_ptr<::pir::Program> ConstructBackwardIrProgram(
if (FLAGS_new_ir_apply_inplace_pass) {
::pir::PassManager pm(::pir::IrContext::Instance(), 3);
pm.AddPass(::pir::CreateInplacePass());
if (VLOG_IS_ON(6)) {
pm.EnableIRPrinting();
}
pm.Run(res.get());
}

Expand Down
2 changes: 2 additions & 0 deletions paddle/fluid/pybind/pir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ using pir::Value;
using pybind11::return_value_policy;

USE_PASS(dead_code_elimination_pass);
USE_PASS(attention_fuse_pass);
USE_PASS(fused_gemm_epilogue_pass);
USE_PASS(fused_dropout_add_pass);
USE_PASS(inplace_pass);

Expand Down
48 changes: 14 additions & 34 deletions test/cpp/pir/pattern_rewrite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,25 @@ endif()
cc_test_old(pattern_rewrite_test SRCS pattern_rewrite_test.cc DEPS
${PATTERN_REWRITE_TEST_DEPS})

cc_test_old(
cc_test(
drr_test
SRCS
drr_test.cc
DEPS
drr
gtest
pd_op_dialect
pir)
cc_test_old(
SRCS drr_test.cc
DEPS drr)

cc_test(
drr_same_type_binding_test
SRCS
drr_same_type_binding_test.cc
DEPS
drr
gtest
pd_op_dialect
pir)
SRCS drr_same_type_binding_test.cc
DEPS drr gtest pd_op_dialect pir)

cc_test_old(
cc_test(
drr_fuse_linear_test
SRCS
drr_fuse_linear_test.cc
DEPS
fusion_passes
drr
gtest
pd_op_dialect
pir)
cc_test_old(
SRCS drr_fuse_linear_test.cc
DEPS fusion_passes drr gtest pd_op_dialect pir)

cc_test(
drr_attention_fuse_test
SRCS
drr_attention_fuse_test.cc
DEPS
fusion_passes
drr
gtest
pd_op_dialect
pir)
SRCS drr_attention_fuse_test.cc
DEPS fusion_passes drr gtest pd_op_dialect pir)

set_tests_properties(
pattern_rewrite_test PROPERTIES ENVIRONMENT
Expand Down

0 comments on commit 0f4bc90

Please sign in to comment.