File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,9 +210,11 @@ def _parse_world_size(self) -> int:
210210 engine(s).
211211 """
212212 assert self ._is_trtllm_model , "World size cannot be parsed from a model repository that does not contain a TRT LLM model."
213+ engine_path = self ._get_engine_path (self ._trtllm_model_config_path )
214+ engine_config_path = engine_path / "config.json"
215+
216+ # Try to read config.json if it exists, otherwise use defaults
213217 try :
214- engine_path = self ._get_engine_path (self ._trtllm_model_config_path )
215- engine_config_path = engine_path / "config.json"
216218 with open (engine_config_path ) as json_data :
217219 data = json .load (json_data )
218220 # FIXME: Revert handling using 'build_config' as the key when gpt migrates to using unified builder
@@ -226,8 +228,13 @@ def _parse_world_size(self) -> int:
226228 tp = int (config .get ("tensor_parallel" , 1 ))
227229 pp = int (config .get ("pipeline_parallel" , 1 ))
228230 return tp * pp
229- except OSError :
230- raise Exception (f"Unable to open { engine_config_path } " )
231+ except FileNotFoundError :
232+ # If config.json doesn't exist, use default world size
233+ # Default tensor_parallel=1, pipeline_parallel=1, so world_size=1
234+ logger .warning (
235+ f"{ engine_config_path } not found, using default world_size=1"
236+ )
237+ return 1
231238
232239
233240class VLLMUtils :
You can’t perform that action at this time.
0 commit comments