Skip to content

Commit

Permalink
update by comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Yancey1989 committed Sep 13, 2018
1 parent 1664899 commit bad4ea1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 3 additions & 2 deletions paddle/fluid/framework/details/multi_devices_graph_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,9 @@ std::unique_ptr<ir::Graph> MultiDevSSAGraphBuilder::ApplyImpl(
use_gpu = nccl_ctxs_ != nullptr;
#endif

if (use_gpu && strategy_.reduce_ == BuildStrategy::ReduceStrategy::kReduce &&
!is_dist_train) {
if ((use_gpu &&
strategy_.reduce_ == BuildStrategy::ReduceStrategy::kReduce) ||
is_dist_train) {
// Insert BCast Ops
for (size_t dev_id = 0; dev_id < bcast_var_name_set.size(); ++dev_id) {
auto &to_bcast_set = bcast_var_name_set[dev_id];
Expand Down
7 changes: 2 additions & 5 deletions paddle/fluid/framework/details/reduce_op_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ namespace framework {
namespace details {

void ReduceOpHandle::RunImpl() {
if (dev_ctxes_.size() > 0UL) {
platform::RecordEvent record_event(Name(), dev_ctxes_.begin()->second);
} else {
platform::RecordEvent record_event(Name(), nullptr);
}
platform::RecordEvent record_event(Name(), dev_ctxes_.begin()->second);

if (places_.size() == 1) return;
// the input and output may have dummy var.
auto in_var_handles = DynamicCast<VarHandle>(inputs_);
Expand Down

0 comments on commit bad4ea1

Please sign in to comment.