@@ -223,7 +223,6 @@ class StageConfigFactory:
223223 This factory is the main entry point for creating stage configurations.
224224 It handles:
225225 - Loading internal Tier-1 pipeline topology files
226- - Auto-detecting model architecture
227226 - Merging CLI overrides (Tier-2) into stage configs
228227 - Supporting both single-stage and multi-stage models
229228 """
@@ -238,28 +237,17 @@ class StageConfigFactory:
238237 "qwen3_tts" : "qwen3_tts.yaml" ,
239238 }
240239
241- # Mapping of model types to architecture classes
242- ARCH_MAPPING : dict [str , str ] = {
243- "qwen3_omni_moe" : "Qwen3OmniMoeForConditionalGeneration" ,
244- "qwen2_5_omni" : "Qwen2_5OmniForConditionalGeneration" ,
245- "bagel" : "BagelForConditionalGeneration" ,
246- "qwen3_tts" : "Qwen3TTSTalkerForConditionalGeneration" ,
247- }
248-
249240 @classmethod
250241 def create_from_model (
251242 cls ,
252243 model : str ,
253244 cli_overrides : dict [str , Any ] | None = None ,
254- stage_id_filter : int | None = None ,
255245 ) -> list [StageConfig ]:
256246 """Load internal topology, merge with CLI overrides.
257247
258248 Args:
259249 model: Model name or path.
260250 cli_overrides: Tier-2 CLI overrides from VllmConfig/OmniDiffusionConfig.
261- stage_id_filter: If specified, only return the stage with this ID
262- (for independent stage launch).
263251
264252 Returns:
265253 List of StageConfig objects with CLI overrides applied.
@@ -279,12 +267,9 @@ def create_from_model(
279267 if errors :
280268 logger .warning (f"Topology validation warnings for { model } : { errors } " )
281269
282- # Apply CLI overrides and filter stages
270+ # Apply CLI overrides
283271 result : list [StageConfig ] = []
284272 for stage in topology .stages :
285- if stage_id_filter is not None and stage .stage_id != stage_id_filter :
286- continue
287-
288273 # Merge global CLI overrides
289274 stage .runtime_overrides = cls ._merge_cli_overrides (stage , cli_overrides )
290275 result .append (stage )
@@ -440,46 +425,6 @@ def _auto_detect_model_type(cls, model: str) -> str | None:
440425 logger .debug (f"Failed to auto-detect model type for { model } : { e } " )
441426 return None
442427
443- @classmethod
444- def _auto_detect_model_arch (cls , model : str ) -> str | None :
445- """Auto-detect model_arch from model directory.
446-
447- Args:
448- model: Model name or path.
449-
450- Returns:
451- Model architecture class name if detected, None otherwise.
452- """
453- model_type = cls ._auto_detect_model_type (model )
454- if model_type is None :
455- return None
456-
457- # Check mapping first
458- if model_type in cls .ARCH_MAPPING :
459- return cls .ARCH_MAPPING [model_type ]
460-
461- # Fallback: generate from model_type
462- # Convert snake_case to PascalCase and add suffix
463- parts = model_type .split ("_" )
464- pascal_case = "" .join (part .capitalize () for part in parts )
465- return f"{ pascal_case } ForConditionalGeneration"
466-
467- # Well-known Tier-2 runtime parameters. Any CLI arg whose name
468- # matches one of these keys is forwarded to every stage by default.
469- # Additional engine-registered args are also accepted (see
470- # _merge_cli_overrides), so this set does NOT need to be exhaustive.
471- RUNTIME_PARAMS : set [str ] = {
472- "gpu_memory_utilization" ,
473- "tensor_parallel_size" ,
474- "devices" ,
475- "enforce_eager" ,
476- "max_num_batched_tokens" ,
477- "trust_remote_code" ,
478- "max_batch_size" ,
479- "distributed_executor_backend" ,
480- "enable_prefix_caching" ,
481- }
482-
483428 # Keys that should never be forwarded as engine overrides (internal /
484429 # orchestrator-only knobs, complex objects, etc.).
485430 _INTERNAL_KEYS : set [str ] = {
@@ -506,8 +451,8 @@ def _merge_cli_overrides(
506451 """Merge CLI overrides into stage runtime config.
507452
508453 All CLI arguments registered by engine config classes (e.g.
509- EngineArgs / OmniDiffusionConfig) are accepted as overrides,
510- not just the well-known ``RUNTIME_PARAMS`` set .
454+ EngineArgs / OmniDiffusionConfig) are accepted as overrides
455+ unless they appear in ``_INTERNAL_KEYS`` .
511456
512457 Handles:
513458 - Global overrides (apply to all stages)
0 commit comments