File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 3
3
4
4
if TYPE_CHECKING :
5
5
VLLM_HOST_IP : str = ""
6
+ VLLM_PORT : Optional [int ] = None
6
7
VLLM_USE_MODELSCOPE : bool = False
7
8
VLLM_INSTANCE_ID : Optional [str ] = None
8
9
VLLM_NCCL_SO_PATH : Optional [str ] = None
96
97
'VLLM_HOST_IP' :
97
98
lambda : os .getenv ('VLLM_HOST_IP' , "" ) or os .getenv ("HOST_IP" , "" ),
98
99
100
+ # used in distributed environment to manually set the communication port
101
+ # '0' is used to make mypy happy
102
+ 'VLLM_PORT' :
103
+ lambda : int (os .getenv ('VLLM_PORT' , '0' ))
104
+ if 'VLLM_PORT' in os .environ else None ,
105
+
99
106
# If true, will load models from ModelScope instead of Hugging Face Hub.
100
107
# note that the value is true or false, not numbers
101
108
"VLLM_USE_MODELSCOPE" :
Original file line number Diff line number Diff line change @@ -282,6 +282,9 @@ def get_distributed_init_method(ip: str, port: int) -> str:
282
282
283
283
284
284
def get_open_port () -> int :
285
+ port = envs .VLLM_PORT
286
+ if port is not None :
287
+ return port
285
288
# try ipv4
286
289
try :
287
290
with socket .socket (socket .AF_INET , socket .SOCK_STREAM ) as s :
You can’t perform that action at this time.
0 commit comments