File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
paddle/fluid/framework/details Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -458,8 +458,9 @@ std::unique_ptr<ir::Graph> MultiDevSSAGraphBuilder::ApplyImpl(
458
458
use_gpu = nccl_ctxs_ != nullptr ;
459
459
#endif
460
460
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) {
463
464
// Insert BCast Ops
464
465
for (size_t dev_id = 0 ; dev_id < bcast_var_name_set.size (); ++dev_id) {
465
466
auto &to_bcast_set = bcast_var_name_set[dev_id];
Original file line number Diff line number Diff line change @@ -27,11 +27,8 @@ namespace framework {
27
27
namespace details {
28
28
29
29
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
+
35
32
if (places_.size () == 1 ) return ;
36
33
// the input and output may have dummy var.
37
34
auto in_var_handles = DynamicCast<VarHandle>(inputs_);
You can’t perform that action at this time.
0 commit comments