Unverified Commit 022bcc70 authored by Akash kaothalkar's avatar Akash kaothalkar Committed by GitHub
Browse files

[Bugfix] Fix 'ModuleNotFoundError: No module named...

[Bugfix] Fix 'ModuleNotFoundError: No module named 'intel_extension_for_pytorch'' for --tensor-parallel-size more than 1  (#12546)
parent c53dc466
...@@ -329,9 +329,17 @@ class GroupCoordinator: ...@@ -329,9 +329,17 @@ class GroupCoordinator:
return input_ return input_
if input_.is_cpu: if input_.is_cpu:
import intel_extension_for_pytorch as ipex try:
ipex.distributed.all_reduce(input_, group=self.device_group) import intel_extension_for_pytorch as ipex
return input_ ipex.distributed.all_reduce(input_, group=self.device_group)
return input_
except ImportError:
"""
Intel IPEX not found. Falling back to PyTorch native
all_reduce for CPU
"""
torch.distributed.all_reduce(input_, group=self.device_group)
return input_
if self.tpu_communicator is not None and \ if self.tpu_communicator is not None and \
not self.tpu_communicator.disabled: not self.tpu_communicator.disabled:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment