Skip to content

Commit bad4ea1

Browse files
committed
update by comment
1 parent 1664899 commit bad4ea1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

paddle/fluid/framework/details/multi_devices_graph_pass.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,9 @@ std::unique_ptr<ir::Graph> MultiDevSSAGraphBuilder::ApplyImpl(
458458
use_gpu = nccl_ctxs_ != nullptr;
459459
#endif
460460

461-
if (use_gpu && strategy_.reduce_ == BuildStrategy::ReduceStrategy::kReduce &&
462-
!is_dist_train) {
461+
if ((use_gpu &&
462+
strategy_.reduce_ == BuildStrategy::ReduceStrategy::kReduce) ||
463+
is_dist_train) {
463464
// Insert BCast Ops
464465
for (size_t dev_id = 0; dev_id < bcast_var_name_set.size(); ++dev_id) {
465466
auto &to_bcast_set = bcast_var_name_set[dev_id];

paddle/fluid/framework/details/reduce_op_handle.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ namespace framework {
2727
namespace details {
2828

2929
void ReduceOpHandle::RunImpl() {
30-
if (dev_ctxes_.size() > 0UL) {
31-
platform::RecordEvent record_event(Name(), dev_ctxes_.begin()->second);
32-
} else {
33-
platform::RecordEvent record_event(Name(), nullptr);
34-
}
30+
platform::RecordEvent record_event(Name(), dev_ctxes_.begin()->second);
31+
3532
if (places_.size() == 1) return;
3633
// the input and output may have dummy var.
3734
auto in_var_handles = DynamicCast<VarHandle>(inputs_);

0 commit comments

Comments
 (0)