Skip to content

Add Ray Serve gateway for multi-instance vLLM spanning multiple nodes per instance - #3214

Merged
oyilmaz-nvidia merged 17 commits into
mainfrom
onur/ray-service-multi-node-no-rr
Sep 14, 2026
Merged

oyilmaz-nvidia merged 17 commits into
mainfrom
onur/ray-service-multi-node-no-rr

Conversation

@oyilmaz-nvidia

@oyilmaz-nvidia oyilmaz-nvidia commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Ray Serve–based gateway (nemo_gym/orchestration/ray_serve_gateway.py) that manages both instance creation and request routing for multi-instance vLLM deployments in gym eval submit, replacing vLLM's own --data-parallel-size/multi-node DP mechanism for topologies it can't express.
  • Lifts the previous restriction that forbade an individual vLLM instance's own tensor/pipeline-parallel footprint from spanning multiple Slurm nodes when number_of_instances > 1 — each instance now gets its own vllm serve --distributed-executor-backend ray process, explicitly pinned to a distinct slice of nodes via Ray actor node-affinity, so instances can themselves span nodes (e.g. TP8×PP2 across 2 nodes/instance, 2 instances, 4 nodes total).
  • Selection is automatic: the gateway kicks in whenever the topology requires it (an instance's footprint exceeds one node's GPU count), or opt-in via a new use_ray_serve: true field on VllmServiceConfig for topologies that would otherwise work fine with vLLM's own DP.
  • Fetches the gateway script from driver.gym_install's repo/ref directly into the vLLM service's own container (git clone + run as a standalone script — no nemo_gym package install there, to avoid clobbering vLLM's pinned torch/ray), auto-installing git if the image doesn't bundle it.
  • Verified end-to-end on the real cluster: both a single-node-per-instance topology and the target TP8×PP2/2-instance/4-node topology start cleanly and reach full vLLM readiness with zero errors.

oyilmaz-nvidia and others added 10 commits September 3, 2026 13:34
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
@oyilmaz-nvidia oyilmaz-nvidia changed the title Onur/ray service multi node no rr Add Ray Serve gateway for multi-instance vLLM spanning multiple nodes per instance Sep 13, 2026
@oyilmaz-nvidia oyilmaz-nvidia added area:orchestration Job submission, deployment, services, and lifecycle management feature New capabilities, enhancements, or enablement work waiting-on-customer Waiting on the original author to respond labels Sep 13, 2026
@oyilmaz-nvidia
oyilmaz-nvidia marked this pull request as ready for review September 13, 2026 16:41
…i-node-no-rr

# Conflicts:
#	nemo_gym/orchestration/api.py
#	nemo_gym/orchestration/executors/script_templates.py
#	tests/unit_tests/test_slurm_script.py
@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 11e412d

Signed-off-by: Onur Yilmaz <oyilmaz@nvidia.com>
@oyilmaz-nvidia
oyilmaz-nvidia enabled auto-merge (squash) September 14, 2026 15:46
@oyilmaz-nvidia

Copy link
Copy Markdown
Contributor Author

/ok to test 3db55fc

@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 record, we had detailed discussion when reviewing #3168

@oyilmaz-nvidia
oyilmaz-nvidia merged commit d6b3b13 into main Sep 14, 2026
38 checks passed
@oyilmaz-nvidia
oyilmaz-nvidia deleted the onur/ray-service-multi-node-no-rr branch September 14, 2026 16:09
ananthsub pushed a commit to ananthsub/Gym that referenced this pull request Sep 29, 2026
…Mo#3749)

## Background

Addresses the flaky port-uniqueness test introduced in NVIDIA-NeMo#3214 and
reported by [nightly
CI](https://github.com/NVIDIA-NeMo/Gym/actions/runs/36477218352). A
separate issue is unnecessary for this focused test correction.

## What changed

Replace the uniqueness and subsequent-rebind assertions with
parameterized, deterministic socket-contract coverage.

## Details

Assert IPv4/TCP socket creation, binding to port 0, returning the
assigned port, and context-manager cleanup. Once the temporary socket
closes, neither uniqueness nor later availability is guaranteed.

Production behavior and compatibility are unchanged. Documentation and
model rollouts: N/A, test-only change.

## Tested

- `git diff --check` passed.
- `scripts/ci/core_unit_tests.sh`: blocked before tests by missing
offline setuptools build dependencies.
- `scripts/ci/lint.sh`: blocked during pre-commit environment
installation by unreachable PyPI.
- GitHub CI validation is pending, as requested.

Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>

This branch was previously deployed

1 inactive deployment
public — 3db55fcf Deployed Sep 14, 2026 by copy-pr-bot[bot] via release / finalize / notify #2865
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:orchestration Job submission, deployment, services, and lifecycle management feature New capabilities, enhancements, or enablement work waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants