From d176b7d8e49b8edd5df793c8392419030d0d05fd Mon Sep 17 00:00:00 2001 From: Baibaifan Date: Thu, 5 Aug 2021 07:43:38 +0000 Subject: [PATCH] del wait in sharding for npu --- .../distributed/fleet/meta_optimizers/sharding_optimizer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/paddle/distributed/fleet/meta_optimizers/sharding_optimizer.py b/python/paddle/distributed/fleet/meta_optimizers/sharding_optimizer.py index df775247c8c9e..1f1960b17007f 100755 --- a/python/paddle/distributed/fleet/meta_optimizers/sharding_optimizer.py +++ b/python/paddle/distributed/fleet/meta_optimizers/sharding_optimizer.py @@ -379,8 +379,9 @@ def minimize_impl(self, 'w') as f: f.writelines(str(main_block.program)) - # GPU and NPU need to wait server ready - self._wait() + # GPU need to wait server ready, GPU and NPU is Layered connection + if not core.is_compiled_with_npu(): + self._wait() return optimize_ops, params_grads def _init_pair_comm(self, pair, ring_id):