From ce733495773361a4d1465152533551c359e099d8 Mon Sep 17 00:00:00 2001 From: Baibaifan <39549453+Baibaifan@users.noreply.github.com> Date: Fri, 6 Aug 2021 13:11:37 +0800 Subject: [PATCH] del wait in sharding for npu (#34637) --- .../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 df775247c8c..1f1960b1700 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 @@ class ShardingOptimizer(MetaOptimizerBase): '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): -- GitLab