From c00303ec55d9b9aac46d71df330f98b6601b8e74 Mon Sep 17 00:00:00 2001 From: sneaxiy <32832641+sneaxiy@users.noreply.github.com> Date: Mon, 24 Jan 2022 21:56:09 +0800 Subject: [PATCH] fix test allreduce tests (#39166) --- paddle/fluid/framework/ir/graph_helper.cc | 8 ++++---- .../tests/unittests/distributed_passes/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/framework/ir/graph_helper.cc b/paddle/fluid/framework/ir/graph_helper.cc index b2ab6bed36c..83bed2a97ba 100644 --- a/paddle/fluid/framework/ir/graph_helper.cc +++ b/paddle/fluid/framework/ir/graph_helper.cc @@ -603,9 +603,9 @@ static std::vector> GetOpDependencies( for (const auto *op_desc : block_ops) { size_t op_idx = op_id_to_idx.size(); PADDLE_ENFORCE_EQ( - op_id_to_idx.emplace(op_desc->Id(), op_idx).second, true, + op_id_to_idx.emplace(op_desc->OriginalId(), op_idx).second, true, platform::errors::InvalidArgument( - "There should not be duplicate op id: %d", op_desc->Id())); + "There should not be duplicate op id: %d", op_desc->OriginalId())); } std::vector> dep_matrix(op_num); @@ -624,9 +624,9 @@ static std::vector> GetOpDependencies( for (const auto &pair : all_preceding_ops) { const auto *cur_op_node = pair.first; - size_t op_idx_1 = get_op_idx_by_id(cur_op_node->Op()->Id()); + size_t op_idx_1 = get_op_idx_by_id(cur_op_node->Op()->OriginalId()); for (const auto *preceding_op_node : pair.second) { - size_t op_idx_2 = get_op_idx_by_id(preceding_op_node->Op()->Id()); + size_t op_idx_2 = get_op_idx_by_id(preceding_op_node->Op()->OriginalId()); dep_matrix[op_idx_1][op_idx_2] = ir::Node::Dep::kAfter; dep_matrix[op_idx_2][op_idx_1] = ir::Node::Dep::kBefore; } diff --git a/python/paddle/fluid/tests/unittests/distributed_passes/CMakeLists.txt b/python/paddle/fluid/tests/unittests/distributed_passes/CMakeLists.txt index 48a9f7204aa..b3ba7c80b32 100755 --- a/python/paddle/fluid/tests/unittests/distributed_passes/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/distributed_passes/CMakeLists.txt @@ -4,6 +4,6 @@ string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") foreach(TEST_OP ${TEST_OPS}) py_test_modules(${TEST_OP} MODULES ${TEST_OP}) list(APPEND DIST_TEST_OPS ${TEST_OP}) - set_tests_properties(${TEST_OP} PROPERTIES TIMEOUT 90) + set_tests_properties(${TEST_OP} PROPERTIES TIMEOUT 120) set_tests_properties(${TEST_OP} PROPERTIES LABELS "RUN_TYPE=DIST") endforeach(TEST_OP) -- GitLab