Skip to content

Commit b150df1

Browse files
MengqingCaolulmer
authored andcommitted
[executor] init local_rank as device index (vllm-project#13027)
Signed-off-by: Mengqing Cao <[email protected]> Signed-off-by: Louis Ulmer <[email protected]>
1 parent 64cfd97 commit b150df1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vllm/executor/uniproc_executor.py

+5
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)