diff --git a/vllm/executor/uniproc_executor.py b/vllm/executor/uniproc_executor.py index e5464cafaecb..94db232240d5 100644 --- a/vllm/executor/uniproc_executor.py +++ b/vllm/executor/uniproc_executor.py @@ -28,6 +28,11 @@ def _init_executor(self) -> None: distributed_init_method = get_distributed_init_method( get_ip(), get_open_port()) local_rank = 0 + # set local rank as the device index if specified + device_info = self.vllm_config.device_config.device.__str__().split( + ":") + if len(device_info) > 1: + local_rank = int(device_info[1]) rank = 0 kwargs = dict( vllm_config=self.vllm_config,