@@ -103,7 +103,12 @@ def parse_arguments():
103103 help = 'Launch tritonserver with trtllm-llmapi-launch' ,
104104 default = False ,
105105 )
106-
106+ parser .add_argument (
107+ '--exit_timeout' ,
108+ type = int ,
109+ help = 'Exit timeout in seconds' ,
110+ default = None ,
111+ )
107112 return parser .parse_args ()
108113
109114
@@ -152,9 +157,20 @@ def add_port_config(cmd, grpc_port, http_port, metrics_port):
152157 return cmd
153158
154159
155- def get_cmd (world_size , tritonserver , grpc_port , http_port , metrics_port ,
156- model_repo , log , log_file , tensorrt_llm_model_name , oversubscribe ,
157- multimodal_gpu0_cuda_mem_pool_bytes , no_mpi , trtllm_llmapi_launch ):
160+ def get_cmd (world_size ,
161+ tritonserver ,
162+ grpc_port ,
163+ http_port ,
164+ metrics_port ,
165+ model_repo ,
166+ log ,
167+ log_file ,
168+ tensorrt_llm_model_name ,
169+ oversubscribe ,
170+ multimodal_gpu0_cuda_mem_pool_bytes ,
171+ no_mpi ,
172+ trtllm_llmapi_launch ,
173+ exit_timeout = None ):
158174 if no_mpi :
159175 assert world_size == 1 , "world size must be 1 when using no-mpi"
160176
@@ -172,6 +188,8 @@ def get_cmd(world_size, tritonserver, grpc_port, http_port, metrics_port,
172188 if trtllm_llmapi_launch :
173189 cmd += ['trtllm-llmapi-launch' ]
174190 cmd += [tritonserver , f'--model-repository={ model_repo } ' ]
191+ if exit_timeout :
192+ cmd += [f'--exit-timeout-secs={ exit_timeout } ' ]
175193
176194 # Add port configuration
177195 cmd = add_port_config (cmd , grpc_port , http_port , metrics_port )
@@ -221,7 +239,7 @@ def get_cmd(world_size, tritonserver, grpc_port, http_port, metrics_port,
221239 args .http_port , args .metrics_port , args .model_repo , args .log ,
222240 args .log_file , args .tensorrt_llm_model_name ,
223241 args .oversubscribe , args .multimodal_gpu0_cuda_mem_pool_bytes ,
224- args .no_mpi , args .trtllm_llmapi_launch )
242+ args .no_mpi , args .trtllm_llmapi_launch , args . exit_timeout )
225243 env = os .environ .copy ()
226244 if args .multi_model :
227245 if not args .disable_spawn_processes :
0 commit comments