From 8281497030516a730af1e629a7c575aba9214cbf Mon Sep 17 00:00:00 2001 From: chengduo <30176695+chengduoZH@users.noreply.github.com> Date: Mon, 16 Sep 2019 22:41:30 +0800 Subject: [PATCH] Fix warning info of build_strategy (#19805) * fix warning info test=develop * fix bug of all_reduce_deps_pass test=develop --- paddle/fluid/framework/details/build_strategy.cc | 6 ++++-- .../ir/multi_devices_graph_pass/all_reduce_deps_pass.cc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/details/build_strategy.cc b/paddle/fluid/framework/details/build_strategy.cc index e4b0aa21a0..1f5fd015b1 100644 --- a/paddle/fluid/framework/details/build_strategy.cc +++ b/paddle/fluid/framework/details/build_strategy.cc @@ -110,7 +110,8 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder { "mode."; strategy_.fuse_all_optimizer_ops_ = false; LOG_IF(WARNING, strategy_.fuse_all_reduce_ops_ == true) - << "fuse_all_optimizer_ops only work in Reducer mode."; + << "fuse_all_optimizer_ops only works under AllReduce " + "mode."; strategy_.fuse_all_reduce_ops_ = false; } if (strategy_.reduce_ == BuildStrategy::ReduceStrategy::kAllReduce) { @@ -132,7 +133,8 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder { } if (strategy_.fuse_all_reduce_ops_ == true) { LOG_IF(WARNING, strategy_.async_mode_) - << "fuse_all_optimizer_ops only work in Reducer mode."; + << "Currently, fuse_all_reduce_ops doesn't work under " + "async mode."; strategy_.fuse_all_reduce_ops_ = !strategy_.async_mode_; } } diff --git a/paddle/fluid/framework/ir/multi_devices_graph_pass/all_reduce_deps_pass.cc b/paddle/fluid/framework/ir/multi_devices_graph_pass/all_reduce_deps_pass.cc index 1019c4f842..fccc36bae1 100644 --- a/paddle/fluid/framework/ir/multi_devices_graph_pass/all_reduce_deps_pass.cc +++ b/paddle/fluid/framework/ir/multi_devices_graph_pass/all_reduce_deps_pass.cc @@ -131,7 +131,7 @@ class AllReduceDepsPass : public ir::Pass { auto right_in_vars = details::DynamicCast(right->Inputs()); PADDLE_ENFORCE_GT(left_in_vars.size(), 0); - PADDLE_ENFORCE_EQ(left_in_vars.size(), right_in_vars.size()); + PADDLE_ENFORCE_GT(right_in_vars.size(), 0); return left_in_vars[0]->Name() > right_in_vars[0]->Name(); }); -- GitLab