[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:
Michał Ganczarenko
2026-07-20 15:25:56 +08:00
committed by GitHub
co-authored by Kunshang Ji
parent 9459fc6471
commit 37bf988c2f
+4 -7
View File
@@ -400,13 +400,10 @@ class GroupCoordinator:
self.rank = torch.distributed.get_rank()
self.local_rank = local_rank
self.device_index: int
if _WORLD is not None:
self.device_index = _WORLD.device_index
else:
assert local_rank >= 0, (
"local_rank must be provided when creating the world group"
)
self.device_index = local_rank
assert local_rank >= 0, (
"local_rank must be provided when creating the world group"
)
self.device_index = local_rank
self_device_group = None
self_cpu_group = None