@@ -30,16 +30,6 @@ PD_DECLARE_bool(use_cinn);
3030
3131namespace paddle ::framework::details {
3232
33- static inline bool SeqOnlyAllReduceOps (const BuildStrategy &strategy) {
34- // Should fix the allreduce op order if scheduling
35- // them in multiple threads or processes to avoid hang.
36- // NOTE: ParallelGraph would execute this pass on each graph, so
37- // don't need to append it here.
38- return (!strategy.enable_sequential_execution_ &&
39- strategy.num_trainers_ > 1 ) &&
40- !strategy.enable_parallel_graph_ ;
41- }
42-
4333static inline void ConvertDefaultValue (paddle::optional<bool > *default_value) {
4434 if (*default_value == paddle::none) {
4535 *default_value = true ;
@@ -62,8 +52,6 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder {
6252 }
6353#endif
6454
65- AppendPassWithCheck (strategy_.enable_sequential_execution_ ,
66- " sequential_execution_pass" );
6755 AppendPassWithCheck (strategy_.sync_batch_norm_ , " sync_batch_norm_pass" );
6856
6957 AppendOpFusePasses ();
@@ -225,9 +213,6 @@ class ParallelExecutorPassBuilder : public ir::PassBuilder {
225213 case BuildStrategy::ReduceStrategy::kReduce :
226214 multi_devices_pass = AppendPass (" reduce_mode_multi_devices_pass" ).get ();
227215 break ;
228- case BuildStrategy::ReduceStrategy::kNoReduce :
229- multi_devices_pass = AppendPass (" no_reduce_multi_devices_pass" ).get ();
230- break ;
231216 default :
232217 PADDLE_THROW (
233218 platform::errors::Unimplemented (" Unknown reduce strategy." ));
@@ -350,9 +335,6 @@ ir::Graph *BuildStrategy::Apply(ir::Graph *graph,
350335 } else if (pass->Type () == " coalesce_grad_tensor_pass" ) {
351336 pass->Erase (kNRanks );
352337 pass->Set <size_t >(kNRanks , new size_t (nranks));
353- } else if (pass->Type () == " sequential_execution_pass" ) {
354- LOG (INFO) << " set enable_sequential_execution:"
355- << enable_sequential_execution_;
356338 } else if (pass->Type () == " fuse_relu_depthwise_conv_pass" ) {
357339 if (use_device != p::kCUDA ) {
358340 VLOG (1 ) << " fuse_relu_depthwise_conv_pass is only supported on "
@@ -405,10 +387,8 @@ USE_PASS(fuse_bn_act_pass);
405387USE_PASS (fuse_bn_add_act_pass);
406388USE_PASS (graph_viz_pass);
407389USE_PASS (multi_batch_merge_pass);
408- USE_PASS (no_reduce_multi_devices_pass);
409390USE_PASS (reduce_mode_multi_devices_pass);
410391USE_PASS (all_reduce_mode_multi_devices_pass);
411- USE_PASS (sequential_execution_pass);
412392USE_PASS (modify_op_lock_and_record_event_pass);
413393USE_PASS (lock_free_optimize_pass);
414394USE_PASS (coalesce_grad_tensor_pass);
0 commit comments