Unverified Commit 7ea3cd7c authored by Mengqing Cao's avatar Mengqing Cao Committed by GitHub
Browse files

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


Signed-off-by: default avatarMengqingCao <cmq0113@163.com>
parent 214efc2c
...@@ -998,20 +998,15 @@ class ParallelConfig: ...@@ -998,20 +998,15 @@ class ParallelConfig:
raise ValueError(f"worker-use-ray can't be used with " raise ValueError(f"worker-use-ray can't be used with "
f"distributed executor backend " f"distributed executor backend "
f"'{self.distributed_executor_backend}'.") f"'{self.distributed_executor_backend}'.")
ray_only_devices = ["tpu", "hpu"]
if current_platform.is_tpu() and self.world_size > 1: if (current_platform.device_type in ray_only_devices
if self.distributed_executor_backend is None: and self.world_size > 1):
self.distributed_executor_backend = "ray"
if self.distributed_executor_backend != "ray":
raise ValueError(
"TPU backend only supports Ray for distributed inference.")
if current_platform.is_hpu() and self.world_size > 1:
if self.distributed_executor_backend is None: if self.distributed_executor_backend is None:
self.distributed_executor_backend = "ray" self.distributed_executor_backend = "ray"
if self.distributed_executor_backend != "ray": if self.distributed_executor_backend != "ray":
raise ValueError( raise ValueError(
"HPU backend only supports Ray for distributed inference.") f"{current_platform.device_type.upper()} backend only "
"supports Ray for distributed inference.")
if self.distributed_executor_backend is None and self.world_size > 1: if self.distributed_executor_backend is None and self.world_size > 1:
# We use multiprocessing by default if world_size fits on the # We use multiprocessing by default if world_size fits on the
......
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