nemo_automodel.cli.app#

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#

build_parser

Build the CLI argument parser.

main

CLI for running recipes with NeMo-AutoModel.

Data#

API#

nemo_automodel.cli.app.logger#

‘getLogger(…)’

nemo_automodel.cli.app.build_parser() argparse.ArgumentParser[source]#

Build the CLI argument parser.

Returns:

argparse.ArgumentParser

nemo_automodel.cli.app.main()[source]#

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.

Return type:

int