[Bugfix][CPU] Fix broken AVX2 CPU TP support (#17252)

Signed-off-by: Isotr0py <2037008807@qq.com>
This commit is contained in:
Isotr0py 2025-05-09 16:55:14 +08:00 committed by GitHub
parent 217db4baa6
commit 6e4a93e3f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,8 @@ class CpuCommunicator(DeviceCommunicatorBase):
super().__init__(cpu_group, device, device_group, unique_name)
self.dist_module = torch.distributed
if current_platform.get_cpu_architecture() == CpuArchEnum.X86:
if (current_platform.get_cpu_architecture() == CpuArchEnum.X86) \
and hasattr(torch.ops._C, "init_shm_manager"):
self.dist_module = _CPUSHMDistributed(self)
def all_reduce(self, input_):