2323import tempfile
2424import time
2525from pathlib import Path
26- from types import SimpleNamespace
2726from typing import Any , Dict , List , Optional
2827
2928import nemo_run as run
3837 kubeflow_executor ,
3938 slurm_executor ,
4039 )
41- from utils .utils import configure_slurm_gpu_tuning , get_exp_name_config , select_config_variant_interactive
40+ from utils .utils import configure_slurm_gpu_tuning , select_config_variant_interactive
4241except (ImportError , ModuleNotFoundError ):
4342 from .argument_parser import NUM_GPUS_PER_NODE_MAP , parse_cli_args
4443 from .utils .executors import (
4746 kubeflow_executor ,
4847 slurm_executor ,
4948 )
50- from .utils .utils import configure_slurm_gpu_tuning , get_exp_name_config , select_config_variant_interactive
49+ from .utils .utils import configure_slurm_gpu_tuning , select_config_variant_interactive
5150
5251try :
5352 import wandb
@@ -79,6 +78,7 @@ def _filter_run_script_args(argv: List[str]) -> List[str]:
7978 * ``--additional_slurm_params`` — Slurm orchestration only.
8079 * ``--enable_vboost`` / ``--lock_gpu_freq`` — applied directly to the
8180 Slurm executor before submission.
81+ * ``--experiment-name`` — selects the NeMo-Run experiment name.
8282 * ``--csp`` — launcher-only; selects the CSP fabric plugin. The rank-local
8383 script forwards unrecognized args to Hydra, which rejects ``--csp``.
8484 * ``--kubeflow_*`` — consumed here to build the Kubeflow TrainJob. Several
@@ -97,6 +97,8 @@ def _is_launcher_only(flag: str) -> bool:
9797 "--additional_slurm_params" ,
9898 "--csp" ,
9999 "--enable_vboost" ,
100+ "--experiment-name" ,
101+ "--experiment_name" ,
100102 "--lock_gpu_freq" ,
101103 ) or flag .startswith ("--kubeflow_" )
102104
@@ -115,6 +117,26 @@ def _is_launcher_only(flag: str) -> bool:
115117 return filtered_args
116118
117119
120+ def _default_experiment_name (
121+ * ,
122+ use_recipes : bool ,
123+ model_recipe_name : str ,
124+ task : str ,
125+ compute_dtype : str ,
126+ num_gpus : int ,
127+ gpu : str ,
128+ config_variant : str | None ,
129+ ) -> str :
130+ """Build a stable experiment name without importing a performance recipe."""
131+ if use_recipes :
132+ return f"{ model_recipe_name } _{ task } _{ num_gpus } gpu_{ gpu } "
133+
134+ fields = [task , model_recipe_name , compute_dtype , f"gpus{ num_gpus } " , gpu ]
135+ if config_variant and config_variant .lower () not in {"v1" , "v2" }:
136+ fields .append (config_variant .lower ())
137+ return "_" .join (fields )
138+
139+
118140def _build_nemorun_script (
119141 * ,
120142 script_path : str ,
@@ -456,18 +478,11 @@ def main(
456478 export_nsys_sqlite : bool ,
457479 pytorch_profiler : bool ,
458480 moe_a2a_overlap : bool ,
459- tp_size : Optional [int ],
460- pp_size : Optional [int ],
461- cp_size : Optional [int ],
462- vp_size : Optional [int ],
463- ep_size : Optional [int ],
464- etp_size : Optional [int ],
465- micro_batch_size : Optional [int ],
466- global_batch_size : Optional [int ],
467481 wandb_key : str ,
468482 wandb_project_name : str ,
469483 wandb_experiment_name : str ,
470484 wandb_entity_name : str ,
485+ experiment_name : Optional [str ],
471486 profiling_start_step : int ,
472487 profiling_stop_step : int ,
473488 record_memory_history : bool ,
@@ -564,35 +579,23 @@ def main(
564579 logger .warning ("--export_nsys_sqlite was set without --enable_nsys; no Nsys SQLite export will be generated." )
565580
566581 script_name = ENTRYPOINT_BOOTSTRAP
567- if use_recipes :
568- exp_name = (
569- wandb_experiment_name
570- if wandb_experiment_name is not None
571- else f"{ model_recipe_name } _{ task } _{ num_gpus } gpu_{ gpu } "
582+ # Keep the historical W&B-name fallback for callers that relied on it, but
583+ # let scheduling use a neutral name. The lightweight default deliberately
584+ # avoids resolving a recipe: effective parallelism, batches, and process
585+ # environment are finalized by bootstrap.py inside the submitted container.
586+ exp_name = (
587+ experiment_name
588+ or wandb_experiment_name
589+ or _default_experiment_name (
590+ use_recipes = use_recipes ,
591+ model_recipe_name = model_recipe_name ,
592+ task = task ,
593+ compute_dtype = compute_dtype ,
594+ num_gpus = num_gpus ,
595+ gpu = gpu ,
596+ config_variant = config_variant ,
572597 )
573-
574- else :
575- if wandb_experiment_name is not None :
576- # CI supplies the complete experiment name. Avoid resolving a perf recipe on the
577- # login node in this path: recipe imports belong in the training container.
578- exp_name = wandb_experiment_name
579- else :
580- # Create a simple namespace with the args needed by get_exp_name_config
581- args_for_config = SimpleNamespace (
582- num_gpus = num_gpus ,
583- tensor_model_parallel_size = tp_size ,
584- pipeline_model_parallel_size = pp_size ,
585- context_parallel_size = cp_size ,
586- virtual_pipeline_model_parallel_size = vp_size ,
587- expert_model_parallel_size = ep_size ,
588- expert_tensor_parallel_size = etp_size ,
589- micro_batch_size = micro_batch_size ,
590- global_batch_size = global_batch_size ,
591- )
592- exp_config = get_exp_name_config (
593- args_for_config , model_family_name , model_recipe_name , gpu , compute_dtype , task , config_variant
594- )
595- exp_name = f"{ task } _{ model_recipe_name } _{ compute_dtype } _{ exp_config } "
598+ )
596599
597600 if pretrained_checkpoint is not None :
598601 custom_mounts .append (f"{ pretrained_checkpoint } :{ pretrained_checkpoint } " )
@@ -1002,18 +1005,11 @@ def main(
10021005 export_nsys_sqlite = args .export_nsys_sqlite ,
10031006 pytorch_profiler = args .pytorch_profiler ,
10041007 moe_a2a_overlap = args .moe_a2a_overlap ,
1005- tp_size = args .tensor_model_parallel_size ,
1006- pp_size = args .pipeline_model_parallel_size ,
1007- cp_size = args .context_parallel_size ,
1008- vp_size = args .virtual_pipeline_model_parallel_size ,
1009- ep_size = args .expert_model_parallel_size ,
1010- etp_size = args .expert_tensor_parallel_size ,
1011- micro_batch_size = args .micro_batch_size ,
1012- global_batch_size = args .global_batch_size ,
10131008 wandb_key = args .wandb_key ,
10141009 wandb_project_name = args .wandb_project_name ,
10151010 wandb_experiment_name = args .wandb_experiment_name ,
10161011 wandb_entity_name = args .wandb_entity_name ,
1012+ experiment_name = args .experiment_name ,
10171013 profiling_start_step = args .profiling_start_step ,
10181014 profiling_stop_step = args .profiling_stop_step ,
10191015 record_memory_history = args .record_memory_history ,
0 commit comments