diff --git a/imperative/python/megengine/distributed/group.py b/imperative/python/megengine/distributed/group.py index 8fc0634d133cbe7185e85e0c85af9806136cb24b..63017507905e758dfff29d0b3c4ace1cc9ffd711 100644 --- a/imperative/python/megengine/distributed/group.py +++ b/imperative/python/megengine/distributed/group.py @@ -94,7 +94,7 @@ class Group: return self.is_single_machine_cache assert _sd is not None, "please call init_process_group first" for rank in self.proc_ranks: - if rank not in _sd.machine_ranks: + if _sd.machine_ranks is None or rank not in _sd.machine_ranks: self.is_single_machine_cache = False return False self.is_single_machine_cache = True