nemo_automodel.components.launcher.interactive
nemo_automodel.components.launcher.interactive
Module Contents
Classes
Functions
Data
API
Bases: Launcher
Launch a recipe locally on the current node using torchrun or in-process.
Return True when this process was already spawned by torchrun.
torchrun (torch.distributed.run) sets both LOCAL_RANK and
TORCHELASTIC_RUN_ID in the environment of every worker it spawns.
We check for both to avoid false positives from environments (e.g.
SLURM) that may set LOCAL_RANK without an active torchrun session.
When the user launches the CLI via
torchrun --nproc-per-node N -m nemo_automodel.cli.app config.yaml,
each worker must run the recipe in-process instead of re-launching torchrun.
Instantiate and run a recipe in the current process.
Run the recipe on this node, via torchrun or in-process.
Parameters:
Parsed YAML config dict (without the launcher section).
Resolved path to the original YAML file.
Dotted import path of the recipe class.
Number of local processes, or None to auto-detect.
Additional CLI overrides forwarded to the recipe.
Returns: int
Process exit code (0 = success).
What the interactive launcher needs from a resolved recipe.
resolve_recipe_cls can return anything a dotted path points at,
so the launcher only relies on this slice of the surface.
Return the repository root. If CWD looks like an editable checkout,
prepend it to PYTHONPATH so the local source takes precedence.
Convert a dotted recipe target into an absolute filesystem path.
Import and return the recipe factory from a dotted path.
Calling the returned object with the parsed config must produce an
object satisfying _Recipe; that contract lives with the
launcher, not with the config string.