Skip to navigation

nemo_gym.orchestration.executors.utils

View as MarkdownOpen in Claude

Module Contents

Functions

NameDescription
flatten_export_argsFlatten export settings into shell-quoted +key.path=value tokens that Hydra reads back unchanged.
flatten_run_argsFlatten a nested run config dict into shell-quoted ++key.path=value Hydra override tokens.
render_target_argsThe shell-quoted TARGET, --agent, --sandbox and output root of a task run, which go ahead of its

Data

_EXPORT_SETTING_NAME

API

nemo_gym.orchestration.executors.utils.flatten_export_args(
settings: dict[str, typing.Any],
prefix: str = ''
) -> list[str]

Flatten export settings into shell-quoted +key.path=value tokens that Hydra reads back unchanged.

Unlike flatten_run_args, which shell-quotes scalars and flat lists as they are, each value is encoded for Hydra first, so a string keeps its type and its characters, and numbers, booleans and null keep theirs. The shell quotes are gone by the time Hydra parses the argument, which is why shell quoting alone is not enough.

nemo_gym.orchestration.executors.utils.flatten_run_args(
run: dict[str, typing.Any],
prefix: str = ''
) -> list[str]

Flatten a nested run config dict into shell-quoted ++key.path=value Hydra override tokens.

nemo_gym.orchestration.executors.utils.render_target_args(
target: str | None,
agent: str | None,
sandbox: str | None,
output_root: str
) -> list[str]

The shell-quoted TARGET, --agent, --sandbox and output root of a task run, which go ahead of its Hydra overrides.

output_root is where the run keeps the rows and run config it prepares. The driver works in a fresh checkout on every allocation, so the default (relative to the working directory) would name the rows by a different absolute path each time and a continuation would no longer match the run it resumes; the caller passes a folder in the benchmark’s job directory instead.

Empty without a target, so a benchmark that sets none renders exactly as before.

nemo_gym.orchestration.executors.utils._EXPORT_SETTING_NAME = re.compile('[A-Za-z_][A-Za-z0-9_\\-]*')