diff --git a/python/paddle/distributed/fleet/base/topology.py b/python/paddle/distributed/fleet/base/topology.py index 0272fdd086d0d040b6126c64a34374ffcfd11b57..4f5e356614817be0bfede3ecc911bb5e9686da7a 100644 --- a/python/paddle/distributed/fleet/base/topology.py +++ b/python/paddle/distributed/fleet/base/topology.py @@ -187,10 +187,11 @@ class HybridCommunicateGroup: "data" ) - ( - self.sharding_check_group, - self.sharding_check_comm_group, - ) = self._set_check_group("sharding") + if self._sharding_degree > 1: + ( + self.sharding_check_group, + self.sharding_check_comm_group, + ) = self._set_check_group("sharding") # create p2p group self.is_first_stage = self.stage_id == 0