[XPU][Bugfix] Fix GroupCoordinator device_index (#47295)
Signed-off-by: Michal Ganczarenko <michal.ganczarenko@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
co-authored by
Kunshang Ji
parent
9459fc6471
commit
37bf988c2f
@@ -400,13 +400,10 @@ class GroupCoordinator:
|
|||||||
self.rank = torch.distributed.get_rank()
|
self.rank = torch.distributed.get_rank()
|
||||||
self.local_rank = local_rank
|
self.local_rank = local_rank
|
||||||
self.device_index: int
|
self.device_index: int
|
||||||
if _WORLD is not None:
|
assert local_rank >= 0, (
|
||||||
self.device_index = _WORLD.device_index
|
"local_rank must be provided when creating the world group"
|
||||||
else:
|
)
|
||||||
assert local_rank >= 0, (
|
self.device_index = local_rank
|
||||||
"local_rank must be provided when creating the world group"
|
|
||||||
)
|
|
||||||
self.device_index = local_rank
|
|
||||||
|
|
||||||
self_device_group = None
|
self_device_group = None
|
||||||
self_cpu_group = None
|
self_cpu_group = None
|
||||||
|
|||||||
Reference in New Issue
Block a user