Fix warning info of build_strategy (#19805)

* fix warning info
test=develop

* fix bug of all_reduce_deps_pass
test=develop
expand_as_op_1
chengduo 6 years ago committed by GitHub
parent a0e9b7b9a2
commit 8281497030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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_;
}
}

@ -131,7 +131,7 @@ class AllReduceDepsPass : public ir::Pass {
auto right_in_vars =
details::DynamicCast<details::VarHandle>(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();
});

Loading…
Cancel
Save