@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 7ea3cd7c3e
Fork 0

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, 07:00 UTC

[Refactor][MISC] del redundant code in ParallelConfig.postinit (#10614)

Signed-off-by: MengqingCao <cmq0113@163.com>

Mengqing Cao committed Nov 25, 2024 at 13:14 UTC 7ea3cd7c3e9fa1db06cdf8ad1973237b061b7d64
1 file changed +5 -10
vllm/config.py
+5 -10
@@ -998,20 +998,15 @@ class ParallelConfig:
998 raise ValueError(f"worker-use-ray can't be used with "
999 f"distributed executor backend "
1000 f"'{self.distributed_executor_backend}'.")
1001 -
1002 - if current_platform.is_tpu() and self.world_size > 1:
1003 - if self.distributed_executor_backend is None:
1004 - self.distributed_executor_backend = "ray"
1005 - if self.distributed_executor_backend != "ray":
1006 - raise ValueError(
1007 - "TPU backend only supports Ray for distributed inference.")
1008 -
1009 - if current_platform.is_hpu() and self.world_size > 1:
1001 + ray_only_devices = ["tpu", "hpu"]
1002 + if (current_platform.device_type in ray_only_devices
1003 + and self.world_size > 1):
1004 if self.distributed_executor_backend is None:
1005 self.distributed_executor_backend = "ray"
1006 if self.distributed_executor_backend != "ray":
1007 raise ValueError(
1014 - "HPU backend only supports Ray for distributed inference.")
1008 + f"{current_platform.device_type.upper()} backend only "
1009 + "supports Ray for distributed inference.")
1010
1011 if self.distributed_executor_backend is None and self.world_size > 1:
1012 # We use multiprocessing by default if world_size fits on the