Skip to content

Commit 7328eb1

Browse files
MengqingCaokwang1012
authored andcommitted
[executor] init local_rank as device index (vllm-project#13027)
Signed-off-by: Mengqing Cao <[email protected]>
1 parent 0fc7035 commit 7328eb1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vllm/executor/uniproc_executor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ def _init_executor(self) -> None:
2828
distributed_init_method = get_distributed_init_method(
2929
get_ip(), get_open_port())
3030
local_rank = 0
31+
# set local rank as the device index if specified
32+
device_info = self.vllm_config.device_config.device.__str__().split(
33+
":")
34+
if len(device_info) > 1:
35+
local_rank = int(device_info[1])
3136
rank = 0
3237
kwargs = dict(
3338
vllm_config=self.vllm_config,

0 commit comments

Comments
 (0)