Skip to content

Multi-node multi-instance vLLM via gym eval submit - #2597

Merged
oyilmaz-nvidia merged 92 commits into
mainfrom
onur/ray-service-multi-gpu
Aug 25, 2026
Merged

Multi-node multi-instance vLLM via gym eval submit#2597
oyilmaz-nvidia merged 92 commits into
mainfrom
onur/ray-service-multi-gpu

Conversation

@oyilmaz-nvidia

@oyilmaz-nvidia oyilmaz-nvidia commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds multi-node vLLM service support to the Slurm orchestration layer (gym eval submit), building on top of the existing single-node multi-instance support (separate PR: onur/multi-instance-vllm-service). A vllm service can now span multiple physical Slurm nodes, either for a single replica's tensor/pipeline-parallel footprint, or for multi-node data-parallel replicas.

What's NOT included in this PR is that multi-node TP with multiple instance which is a rare case. So, in order to use the features in this PR, the model has to fit into a single node.

What's new

  • ray distributed backend — a new distributed_backend option (alongside the existing single-node mp backend) using vLLM's Ray core executor (--distributed-executor-backend ray, not the ray.serve library) to span a service across nodes.
  • Automatic backend selection by node count — if compute.node_pools total more than one node, distributed_backend is automatically forced to ray, overriding anything set/defaulted at the service level. No need to write distributed_backend: {type: ray} yourself.
  • Multi-node data-parallel validationnumber_of_instances must divide evenly across the node count (each node hosts an equal share of replicas).
  • Sbatch script generation (slurm_script.py):
    • injects a Ray head-node-IP prelude (scontrol show hostnames, HEAD_NODE_IP/RAY_HEAD_NODE_IP) when any service uses the ray backend,
    • single-instance multi-node: wraps the vLLM command in ray symmetric-run (falling back to manual ray start --head/--block for older Ray), spanning TP/PP across nodes,
    • multi-instance multi-node: uses vLLM's native multi-node data-parallel pattern — head node serves the OpenAI API, worker nodes run --headless with a --data-parallel-start-rank offset — no Ray involved for that path,
    • adds --nodes=/--ntasks= to each service's srun step on multi-node compute (--nodes=1 --ntasks=1 for the driver).

New example config

  • examples/slurm_vllm_ray_multi_node.yaml — 2-node compute, 8 replicas (TP2) spanning both nodes, backend auto-selected as ray from node count alone.

prokotg added 30 commits July 22, 2026 14:03
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
…duplication back-off

Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
…nt home in indiviudla sruns

Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
…solve configs properly (?)

Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Signed-off-by: Tomasz Grzegorzek <tgrzegorzek@nvidia.com>
Comment thread nemo_gym/orchestration/executors/slurm_script.py Outdated
Comment thread nemo_gym/orchestration/executors/slurm_script.py Outdated
Comment thread nemo_gym/orchestration/executors/slurm_script.py Outdated
Comment thread nemo_gym/orchestration/api.py Outdated

@prokotg prokotg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I left comments in placees where I think some changes are critical. Let me know if I can provide more feedback

oyilmaz-nvidia and others added 2 commits August 24, 2026 18:23
@oyilmaz-nvidia
oyilmaz-nvidia enabled auto-merge (squash) August 24, 2026 22:34
Comment on lines +76 to +77
def render_ray_prelude() -> str:
return _RAY_PRELUDE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function can be removed

return (
f"# service: {name}\n"
f"{env_prefix}srun --overlap --no-container-mount-home{mounts_flag} --container-image={shlex.quote(container)} --output=logs/{name}.log {command} &\n"
f"{env_prefix}srun --overlap --no-container-mount-home{node_flags}{mounts_flag} --container-image={shlex.quote(container)} --output=logs/{name}.log {command} &\n"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be tackled in another PR but we need to check how multi-rank logs are written (we should be able to differentiate logs from instances)

@prokotg prokotg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, thank you! Agreed upon items to remember for the upcoming PRs:

  • Multi-node multi-instnace model handling
  • Partial allocation for service and collision avoidance (multiple services should have separate GPUs)
  • Logging of multi-rank services should be handled

@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 968b57c

@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 3b5da65

@oyilmaz-nvidia
oyilmaz-nvidia merged commit 6a95a1d into main Aug 25, 2026
37 checks passed
@oyilmaz-nvidia
oyilmaz-nvidia deleted the onur/ray-service-multi-gpu branch August 25, 2026 19:45
@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

@prokotg To have a record here, so the following configs are supported for multi node. Assuming each node has 8 GPUs.

  1. nodes: 2, gpus_per_node: 8 and tensor_parallel_size: 8, pipeline_parallel_size: 2, number_of_instances: 1
  2. nodes: 2, gpus_per_node: 8 and tensor_parallel_size: 2, pipeline_parallel_size: 1, number_of_instances: 8

but the following is not supported.

  1. nodes: 4, gpus_per_node: 8 and tensor_parallel_size: 8, pipeline_parallel_size: 2, number_of_instances: 2

And this is due to a bug on the vLLM side.

@prokotg

prokotg commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Thanks @oyilmaz-nvidia could you share more details on the vllm bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants