nemo_automodel.components.launcher.interactive#
Module Contents#
Classes#
Launch a recipe locally on the current node using torchrun or in-process. |
Functions#
Return the repository root. If CWD looks like an editable checkout,
prepend it to |
|
Import and return the recipe class from a dotted path. |
|
Convert a dotted recipe target into an absolute filesystem path. |
Data#
API#
- nemo_automodel.components.launcher.interactive.logger#
‘getLogger(…)’
- nemo_automodel.components.launcher.interactive._get_repo_root() pathlib.Path[source]#
Return the repository root. If CWD looks like an editable checkout, prepend it to
PYTHONPATHso the local source takes precedence.
- nemo_automodel.components.launcher.interactive.resolve_recipe_cls(target_str: str)[source]#
Import and return the recipe class from a dotted path.
" pip install nemo-automodel # CPU/basic
“ “ pip install nemo-automodel[all] # with CUDA & all extras
“
- nemo_automodel.components.launcher.interactive._recipe_module_path(
- recipe_target: str,
- repo_root: pathlib.Path,
Convert a dotted recipe target into an absolute filesystem path.
- nemo_automodel.components.launcher.interactive._INSTALL_MSG = <Multiline-String>#
- class nemo_automodel.components.launcher.interactive.InteractiveLauncher[source]#
Bases:
nemo_automodel.components.launcher.base.LauncherLaunch a recipe locally on the current node using torchrun or in-process.
- static _is_torchrun_worker() bool[source]#
Return True when this process was already spawned by torchrun.
torchrun (
torch.distributed.run) sets bothLOCAL_RANKandTORCHELASTIC_RUN_IDin the environment of every worker it spawns. We check for both to avoid false positives from environments (e.g. SLURM) that may setLOCAL_RANKwithout 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.