Update parallel_context.py (#2408)

pull/2413/head
Haofan Wang 2023-01-10 11:27:23 +08:00 committed by GitHub
parent 8327932d2c
commit 7d5640b9db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -375,7 +375,7 @@ class ParallelContext(metaclass=SingletonMeta):
# None will give the default global process group for pytorch dist operations
ranks = list(range(world_size))
cpu_group = dist.new_group(ranks, backend='gloo') if dist.get_backend() != 'gloo' else None
cpu_group = dist.new_group(ranks, backend='gloo') if dist.get_backend() == 'gloo' else None
self._register_dist(rank, world_size, dist.GroupMember.WORLD, cpu_group, ranks, ParallelMode.GLOBAL)
self.add_global_rank(ParallelMode.GLOBAL, rank)