nemo_automodel.cli.app

View as Markdown

Unified CLI entry-point for NeMo AutoModel.

Usage

::

Recommended — the CLI handles torchrun internally:

automodel <config.yaml> [—nproc-per-node N] [—key.subkey=override …]

Also supported — external torchrun launch:

torchrun —nproc-per-node N -m nemo_automodel.cli.app <config.yaml> [—key.subkey=override …]

Convenience wrapper for development (not installed):

python app.py <config.yaml> [—nproc-per-node N] [—key.subkey=override …]

The YAML config must specify which recipe class to instantiate. All three forms are accepted::

recipe: TrainFinetuneRecipeForNextTokenPrediction # bare class name recipe: nemo_automodel.recipes.llm.train_ft.TrainFin… # fully-qualified recipe: target: nemo_automodel.recipes.llm.train_ft.Trai… # Hydra-style

For SLURM clusters, use sbatch slurm.sub directly (see the reference script at the repo root). Add a skypilot: or nemo_run: section in the YAML for those launchers.

When launched via torchrun, the CLI detects the existing distributed environment and runs the recipe in-process on each worker instead of re-spawning torchrun.

Module Contents

Functions

NameDescription
build_parserBuild the CLI argument parser.
mainCLI for running recipes with NeMo-AutoModel.

Data

logger

API

nemo_automodel.cli.app.build_parser() -> argparse.ArgumentParser

Build the CLI argument parser.

Returns: argparse.ArgumentParser

argparse.ArgumentParser

nemo_automodel.cli.app.main()

CLI for running recipes with NeMo-AutoModel.

Supports interactive (local), SkyPilot, and NeMo-Run launchers. For SLURM, use sbatch slurm.sub directly.

Returns:

Job’s exit code.

nemo_automodel.cli.app.logger = logging.getLogger(__name__)