Skip to content

feat(generation): add heterogeneous vLLM server groups for NeMo Gym - #3520

Open
aoshen02 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
aoshen02:feat/multi-server-group
Open

aoshen02 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
aoshen02:feat/multi-server-group

Conversation

@aoshen02

@aoshen02 aoshen02 commented Aug 6, 2026 •

Copy link
Copy Markdown

Summary

Adds optional heterogeneous vLLM server groups for NeMo Gym. Each named group gets a disjoint GPU budget and may override only vllm_cfg and vllm_kwargs; the existing GRPO/Gym lifecycle and refit path remain unchanged.

Without policy.generation.server_groups, the default path is unchanged and no multi-group code runs. With groups enabled, their HTTP endpoints are flattened into the existing NeMo Gym policy_base_url list.

Configuration

Example:

policy:
  generation:
    colocated:
      enabled: false
      resources: {gpus_per_node: 6, num_nodes: 1}
    server_groups:
      - name: low_latency
        gpus: 2
        overrides:
          vllm_cfg: {tensor_parallel_size: 1}
          vllm_kwargs: {max_num_seqs: 16}
      - name: high_throughput
        gpus: 4
        overrides:
          vllm_cfg: {tensor_parallel_size: 4}
          vllm_kwargs: {max_num_seqs: 512}

All groups inherit the common model, context length, HTTP-server, and refit settings. Groups join one NCCL broadcast world using disjoint rank ranges, so one refit updates every group.

Reproduction

  1. Check out this PR in a NeMo RL v0.7.0 Enroot/container environment and mount the repository into the container:
git clone https://github.com/NVIDIA-NeMo/RL.git
cd RL
git fetch origin pull/3520/head:pr-3520
git checkout pr-3520
  1. From inside the container, submit the driver through the cluster's normal Ray/Slurm launcher. The driver command is:
export VLLM_ALLOW_INSECURE_SERIALIZATION=1
python -u examples/nemo_gym/run_grpo_nemo_gym.py \
  --config examples/nemo_gym/grpo_workplace_assistant_nemotron_nano_v2_9b.yaml \
  policy.model_name=Qwen/Qwen3-0.6B \
  cluster.gpus_per_node=4 \
  cluster.num_nodes=3 \
  policy.generation.colocated.resources.gpus_per_node=4 \
  policy.generation.colocated.resources.num_nodes=2 \
  'policy.generation.server_groups=[{name:low_latency,gpus:4,overrides:{vllm_cfg:{tensor_parallel_size:1},vllm_kwargs:{max_num_seqs:16}}},{name:high_throughput,gpus:4,overrides:{vllm_cfg:{tensor_parallel_size:4},vllm_kwargs:{max_num_seqs:512}}}]'

This uses Qwen/Qwen3-0.6B, the official Workplace Assistant dataset, two GRPO steps, four training GPUs, and eight inference GPUs across three GB200 nodes. The effective groups are low_latency (TP=1, four replicas) and high_throughput (TP=4, one replica), for five HTTP endpoints.

Validation

Job 12674 completed with exit code 0.

  • Both server-group Ray inference clusters initialized.
  • Five vLLM HTTP endpoints were reserved; all five /tokenize probes passed.
  • The TP=1 and TP=4 engines both initialized, and the step 1 → step 2 NCCL refit completed successfully.
  • Refit timings were 0.89 s and 0.85 s.
  • A non-fatal aiohttp event-loop warning was printed during final teardown after successful completion.

Raw validation artifacts: GitHub Gist

Scope

v1 supports GRPO + NeMo Gym, the vLLM backend, non-colocated inference, the default NCCL refit transport, no cluster.segment_size, and groups that each fit within one node. Same-node port contention is handled by the existing bind-retry behavior.

Checks

  • Config merge, override rejection, URL concatenation, and per-group rank offsets were verified with local ad-hoc tests.
  • [email protected] check/format: clean.
  • [email protected]: 0 errors.
  • Duplicate check: no open PR implementing heterogeneous vLLM server groups was found.

AI-assisted (Claude); every changed line was reviewed by the submitter.

@aoshen02
aoshen02 requested review from a team as code owners August 6, 2026 09:57
@copy-pr-bot

copy-pr-bot Bot commented Aug 6, 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.

@aoshen02

aoshen02 commented Aug 6, 2026

Copy link
Copy Markdown
Author

/ok to test 879688d

@aoshen02

aoshen02 commented Aug 6, 2026

Copy link
Copy Markdown
Author

/ok to test e99ee59

Adds policy.generation.server_groups: N named VllmGeneration replica
groups of one policy (e.g. low-latency + high-throughput) on disjoint
GPUs, each with its own vllm_cfg/vllm_kwargs overrides and
RayVirtualCluster. MultiVllmGeneration fans lifecycle calls out to the
groups; refit joins every group into the single train+inference NCCL
broadcast world via per-group rank_offset, so one broadcast updates all
groups. NeMo Gym receives the flat concatenation of all group URLs.

v1 scope: GRPO + NeMo Gym, non-colocated, default NCCL refit (asserted
in setup). Unset server_groups leaves all existing paths unchanged.

Co-authored-by: Claude Fable 5 <[email protected]>
Signed-off-by: aoshen02 <[email protected]>
@aoshen02
aoshen02 force-pushed the feat/multi-server-group branch from e99ee59 to decfb20 Compare August 6, 2026 10:14
@aoshen02

aoshen02 commented Aug 6, 2026

Copy link
Copy Markdown
Author

/ok to test decfb20

This branch has not been deployed

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

Labels

community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants