nemo_automodel.components.launcher.nemo_run.launcher

View as Markdown

Module Contents

Classes

NameDescription
NemoRunLauncherLaunch a recipe via NeMo-Run’s executor API.

Data

_CONFIG_FILENAME

_REMOTE_CONFIG_PATH

logger

API

class nemo_automodel.components.launcher.nemo_run.launcher.NemoRunLauncher()

Bases: 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.

nemo_automodel.components.launcher.nemo_run.launcher.NemoRunLauncher._configure_torchrun(
executor: typing.Any,
devices: int
) -> None
staticmethod

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.

nemo_automodel.components.launcher.nemo_run.launcher.NemoRunLauncher._resolve_executor(
nr_config: nemo_automodel.components.launcher.nemo_run.config.NemoRunConfig
) -> typing.Any

Load a named executor or build a local one.

nemo_automodel.components.launcher.nemo_run.launcher.NemoRunLauncher._setup_packager(
executor: typing.Any,
config_path: str
) -> None
staticmethod

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.

nemo_automodel.components.launcher.nemo_run.launcher.NemoRunLauncher.launch(
config: typing.Dict[str, typing.Any],
config_path: pathlib.Path,
recipe_target: str,
launcher_config: typing.Dict[str, typing.Any],
extra_args: typing.Optional[typing.List[str]] = None
) -> int
nemo_automodel.components.launcher.nemo_run.launcher._CONFIG_FILENAME = 'automodel_config.yaml'
nemo_automodel.components.launcher.nemo_run.launcher._REMOTE_CONFIG_PATH = f'/nemo_run/code/{_CONFIG_FILENAME}'
nemo_automodel.components.launcher.nemo_run.launcher.logger = logging.getLogger(__name__)