From adec6e14d8408f19bb2a04e889d1ea287cb94311 Mon Sep 17 00:00:00 2001 From: youth123 <2042519524@qq.com> Date: Mon, 2 Aug 2021 20:21:40 +0800 Subject: [PATCH 1/3] revert commit id 34212 --- paddle/fluid/framework/distributed_strategy.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/framework/distributed_strategy.proto b/paddle/fluid/framework/distributed_strategy.proto index b28c884429c17..1de6d26d05b9e 100644 --- a/paddle/fluid/framework/distributed_strategy.proto +++ b/paddle/fluid/framework/distributed_strategy.proto @@ -183,7 +183,7 @@ message DistributedStrategy { optional bool use_hierarchical_allreduce = 15 [ default = false ]; optional int32 hierarchical_allreduce_inter_nranks = 16 [ default = 1 ]; optional bool sync_batch_norm = 17 [ default = false ]; - optional bool fuse_all_reduce_ops = 18 [ default = false ]; + optional bool fuse_all_reduce_ops = 18 [ default = true ]; optional int32 fuse_grad_size_in_MB = 19 [ default = 32 ]; optional float fuse_grad_size_in_TFLOPS = 20 [ default = 50 ]; optional bool cudnn_exhaustive_search = 21 [ default = false ]; From 7b4adb0556f36464085ec53b0962067cecbcc5f2 Mon Sep 17 00:00:00 2001 From: youth123 <2042519524@qq.com> Date: Tue, 3 Aug 2021 20:40:43 +0800 Subject: [PATCH 2/3] fix test_fleet_sharding_meta_optimizer --- .../fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py b/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py index a1cd0df8d7c7e..053e930bafd63 100755 --- a/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py +++ b/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py @@ -366,6 +366,8 @@ def test_sharding_hybrid_dp(self): "gradient_merge_acc_step": 1, "mp_degree": 1 } + + strategy.fuse_all_reduce_ops = True self.optimizer(avg_cost, strategy, train_prog, startup_prog) startup_prog_ops = startup_prog.global_block().ops main_prog_ops = train_prog.global_block().ops From 8f3e53f635b85b0d00cff8502802894e5c3e69d8 Mon Sep 17 00:00:00 2001 From: youth123 <2042519524@qq.com> Date: Wed, 4 Aug 2021 10:12:18 +0800 Subject: [PATCH 3/3] fix bugs --- .../fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py b/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py index 053e930bafd63..f9e28c003f509 100755 --- a/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py +++ b/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py @@ -367,7 +367,7 @@ def test_sharding_hybrid_dp(self): "mp_degree": 1 } - strategy.fuse_all_reduce_ops = True + strategy.fuse_all_reduce_ops = False self.optimizer(avg_cost, strategy, train_prog, startup_prog) startup_prog_ops = startup_prog.global_block().ops main_prog_ops = train_prog.global_block().ops