nemo_automodel.components.launcher.nemo_run.launcher#

Module Contents#

Classes#

NemoRunLauncher

Launch a recipe via NeMo-Run’s executor API.

Data#

API#

nemo_automodel.components.launcher.nemo_run.launcher.logger#

‘getLogger(…)’

nemo_automodel.components.launcher.nemo_run.launcher._CONFIG_FILENAME#

‘automodel_config.yaml’

nemo_automodel.components.launcher.nemo_run.launcher._REMOTE_CONFIG_PATH#

None

class nemo_automodel.components.launcher.nemo_run.launcher.NemoRunLauncher[source]#

Bases: nemo_automodel.components.launcher.base.Launcher

Launch a recipe via NeMo-Run’s executor API.

Supports loading pre-configured executors from $NEMORUN_HOME/executors.py (or a custom path) and submitting jobs as nemo_run.Script objects. Works with any NeMo-Run executor backend (Slurm, Kubernetes, Docker, local).

Uses NeMo-Run’s native Torchrun launcher so that distributed training arguments (rendezvous, node rank, nproc-per-node) are managed automatically. The training config YAML is packaged via PatternPackager so it is available at /nemo_run/code/automodel_config.yaml inside the container.

_resolve_executor(
nr_config: nemo_automodel.components.launcher.nemo_run.config.NemoRunConfig,
) Any[source]#

Load a named executor or build a local one.

static _configure_torchrun(executor: Any, devices: int) None[source]#

Enable the native NeMo-Run Torchrun launcher on executor.

Sets executor.launcher = "torchrun" and torchrun_nproc_per_node so NeMo-Run generates the correct torchrun --nproc-per-node=<N> invocation in the sbatch script.

static _setup_packager(executor: Any, config_path: str) None[source]#

Configure a PatternPackager that ships the config YAML.

The packager tars the config file and NeMo-Run extracts it into {job_dir}/code/, which is mounted at /nemo_run/code/ inside the container.

launch(
config: Dict[str, Any],
config_path: pathlib.Path,
recipe_target: str,
launcher_config: Dict[str, Any],
extra_args: Optional[List[str]] = None,
) int[source]#