From f8888a07a367f25b11ba2981cb5cdac9d1bc6b58 Mon Sep 17 00:00:00 2001 From: WangXi Date: Tue, 22 Dec 2020 16:04:00 +0800 Subject: [PATCH] fleet sync build strategy, test=develop (#29732) (#29745) --- .../framework/distributed_strategy.proto | 3 +++ .../graph_execution_optimizer.py | 19 ++----------------- 2 files changed, 5 insertions(+), 17 deletions(-) mode change 100755 => 100644 paddle/fluid/framework/distributed_strategy.proto diff --git a/paddle/fluid/framework/distributed_strategy.proto b/paddle/fluid/framework/distributed_strategy.proto old mode 100755 new mode 100644 index 914e27d6f1..aa2867debe --- a/paddle/fluid/framework/distributed_strategy.proto +++ b/paddle/fluid/framework/distributed_strategy.proto @@ -85,6 +85,9 @@ message BuildStrategy { optional bool enable_inplace = 7 [ default = false ]; optional bool enable_backward_optimizer_op_deps = 8 [ default = true ]; optional bool cache_runtime_context = 9 [ default = false ]; + optional bool fuse_bn_add_act_ops = 10 [ default = true ]; + optional bool enable_auto_fusion = 11 [ default = false ]; + optional bool enable_addto = 12 [ default = false ]; } message ExecutionStrategy { diff --git a/python/paddle/distributed/fleet/meta_optimizers/graph_execution_optimizer.py b/python/paddle/distributed/fleet/meta_optimizers/graph_execution_optimizer.py index 21a024c7d4..7ee184cfc5 100644 --- a/python/paddle/distributed/fleet/meta_optimizers/graph_execution_optimizer.py +++ b/python/paddle/distributed/fleet/meta_optimizers/graph_execution_optimizer.py @@ -100,23 +100,8 @@ class GraphExecutionOptimizer(MetaOptimizerBase): def _try_to_compile(self, startup_program, main_program, loss): dist_strategy = self.user_defined_strategy - local_build_strategy = paddle.fluid.BuildStrategy() - local_build_strategy.enable_sequential_execution = \ - dist_strategy.build_strategy.enable_sequential_execution - local_build_strategy.fuse_elewise_add_act_ops = \ - dist_strategy.build_strategy.fuse_elewise_add_act_ops - local_build_strategy.fuse_bn_act_ops = \ - dist_strategy.build_strategy.fuse_bn_act_ops - local_build_strategy.enable_auto_fusion = \ - dist_strategy.build_strategy.enable_auto_fusion - local_build_strategy.fuse_relu_depthwise_conv = \ - dist_strategy.build_strategy.fuse_relu_depthwise_conv - local_build_strategy.fuse_broadcast_ops = \ - dist_strategy.build_strategy.fuse_broadcast_ops - local_build_strategy.fuse_all_optimizer_ops = \ - dist_strategy.build_strategy.fuse_all_optimizer_ops - local_build_strategy.enable_inplace = \ - dist_strategy.build_strategy.enable_inplace + local_build_strategy = dist_strategy.build_strategy + local_build_strategy.use_hierarchical_allreduce = \ dist_strategy.use_hierarchical_allreduce local_build_strategy.hierarchical_allreduce_inter_nranks = \ -- GitLab