A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 00:45 UTC
[Bugfix] Fix 'ModuleNotFoundError: No module named 'intel_extension_for_pytorch'' for --tensor-parallel-size more than 1 (#12546)
Akash kaothalkar committed
Feb 5, 2025 at 12:41 UTC
022bcc701a948f96e68af678eee686837f393d07
1 file changed
+11
-3
vllm/distributed/parallel_state.py
+11
-3
@@ -329,9 +329,17 @@ class GroupCoordinator:
329
return input_
330
331
if input_.is_cpu:
332
- import intel_extension_for_pytorch as ipex
333
- ipex.distributed.all_reduce(input_, group=self.device_group)
334
- return input_
332
+ try:
333
+ import intel_extension_for_pytorch as ipex
334
+ ipex.distributed.all_reduce(input_, group=self.device_group)
335
+ return input_
336
+ except ImportError:
337
+ """
338
+ Intel IPEX not found. Falling back to PyTorch native
339
+ all_reduce for CPU
340
+ """
341
+ torch.distributed.all_reduce(input_, group=self.device_group)
342
+ return input_
343
344
if self.tpu_communicator is not None and \
345
not self.tpu_communicator.disabled: