nemo_automodel.components.launcher.nemo_run.utils#

Module Contents#

Functions#

load_executor_from_file

Load a named executor from a Python file containing an EXECUTOR_MAP.

apply_overrides

Apply arbitrary YAML overrides to an executor via setattr.

submit_nemo_run_job

Submit a job via NeMo-Run’s Experiment API.

Data#

API#

nemo_automodel.components.launcher.nemo_run.utils.logger#

‘getLogger(…)’

nemo_automodel.components.launcher.nemo_run.utils.load_executor_from_file(name: str, executors_file: str) Any[source]#

Load a named executor from a Python file containing an EXECUTOR_MAP.

The file (typically $NEMORUN_HOME/executors.py) must define a module-level EXECUTOR_MAP dictionary whose keys are executor names and whose values are pre-built nemo_run executor instances (or zero-arg callables that return one).

Parameters:
  • name – Key to look up in EXECUTOR_MAP.

  • executors_file – Absolute path to the Python file.

Returns:

The executor object.

Raises:
  • FileNotFoundError – If executors_file does not exist.

  • KeyError – If name is not found in the EXECUTOR_MAP.

nemo_automodel.components.launcher.nemo_run.utils.apply_overrides(executor: Any, overrides: dict) None[source]#

Apply arbitrary YAML overrides to an executor via setattr.

Dict and list values are merged with existing executor attributes (dicts are updated, lists are extended). All other values are set directly.

nemo_automodel.components.launcher.nemo_run.utils.submit_nemo_run_job(
script: Any,
executor: Any,
job_name: str,
detach: bool,
tail_logs: bool,
) int[source]#

Submit a job via NeMo-Run’s Experiment API.

Parameters:
  • script – A nemo_run.Script object.

  • executor – A NeMo-Run executor instance.

  • job_name – Experiment and task name.

  • detach – If True, return immediately after submission.

  • tail_logs – If True, stream logs after submission.

Returns:

0 on successful submission.