nemo_gym.orchestration.executors.script_templates

View as Markdown

Module Contents

Functions

NameDescription
bash_var-
render_driver_entrypointRender the srun entrypoint for the driver step.
render_gym_cmdRender a bash array with each argument on its own line.
render_health_check-
render_ray_prelude-
render_vllm_ray_symmetric_runRender the Ray head/worker bootstrap that wraps a single vLLM instance’s TP/PP command so

Data

_HEALTH_WAIT_MULTI

_RAY_PRELUDE

_VLLM_RAY_SYMMETRIC_RUN

API

nemo_gym.orchestration.executors.script_templates.bash_var(
name: str
) -> str
nemo_gym.orchestration.executors.script_templates.render_driver_entrypoint(
repo: str | None,
ref: str | None,
prepare_cmd: str | None
) -> str

Render the srun entrypoint for the driver step.

When either gym_install or prepare is needed, wraps everything in a single bash -c so prepare and run happen in the same srun step and container.

nemo_gym.orchestration.executors.script_templates.render_gym_cmd(
subcommand: str,
var_name: str,
args: list[str]
) -> str

Render a bash array with each argument on its own line.

nemo_gym.orchestration.executors.script_templates.render_health_check(
name: str,
port: int,
path: str,
timeout: int
) -> str
nemo_gym.orchestration.executors.script_templates.render_ray_prelude() -> str
nemo_gym.orchestration.executors.script_templates.render_vllm_ray_symmetric_run(
inner_cmd: str,
total_nodes: int,
resource_flags: str
) -> str

Render the Ray head/worker bootstrap that wraps a single vLLM instance’s TP/PP command so it spans multiple Slurm nodes.

Uses ray symmetric-run when available (Ray >= 2.50), which starts/joins a Ray cluster across every task and runs the entrypoint only on the elected head node. Containers with an older Ray pin fall back to manually starting head/worker Ray processes, keyed on Slurm’s per-node task rank ($SLURM_NODEID).

nemo_gym.orchestration.executors.script_templates._HEALTH_WAIT_MULTI = '# Wait for {name} (try multiple health endpoints)\necho "Waiting for {name} at ...
nemo_gym.orchestration.executors.script_templates._RAY_PRELUDE = '# Resolve the head node IP for multi-node vLLM services (spanning nodes via Ray...
nemo_gym.orchestration.executors.script_templates._VLLM_RAY_SYMMETRIC_RUN = 'bash -lc \'\n command -v ray >/dev/null 2>&1 || pip install -q "ray[default]...