@@ -86,9 +86,11 @@ NUM_TRAIN_GPUS=6 INCLUDE_GPUS=0,1,2,3,4,5 \
8686 bash scripts/train_opsd_vllm.sh configs/opsd_vllm_disjoint.json
8787```
8888
89- vLLM gets dedicated GPUs (` rollout.gpus ` in the config). Training rank 0
90- constructs the ` LLM ` handle; other training ranks receive generated token
91- ids via NCCL broadcast.
89+ vLLM gets dedicated GPUs via the ` ROLLOUT_VISIBLE_DEVICE ` environment
90+ variable (comma-separated CUDA device indices, e.g.
91+ ` ROLLOUT_VISIBLE_DEVICE=6,7 ` ). Training rank 0 spawns the vLLM server as
92+ a subprocess with ` CUDA_VISIBLE_DEVICES ` set to those devices; other
93+ training ranks receive generated token ids via NCCL broadcast.
9294
9395### Smoke tests (5 steps, small models)
9496
@@ -100,7 +102,8 @@ end-to-end before scaling up.
100102cd examples/opsd
101103deepspeed --num_gpus 2 main.py --config configs/smoke_hybrid.json
102104# For vLLM (uses GPUs 0,1 for training and 2,3 for vLLM):
103- NUM_TRAIN_GPUS=2 INCLUDE_GPUS=0,1 deepspeed --num_gpus 2 --include localhost:0,1 \
105+ NUM_TRAIN_GPUS=2 INCLUDE_GPUS=0,1 ROLLOUT_VISIBLE_DEVICE=2,3 \
106+ deepspeed --num_gpus 2 --include localhost:0,1 \
104107 main.py --config configs/smoke_vllm.json
105108```
106109
@@ -133,6 +136,13 @@ python -m pytest tests/ -v
133136See ` configs/opsd_hybrid_engine.json ` and ` configs/opsd_vllm_disjoint.json `
134137for fully-populated examples.
135138
139+ ** GPU placement for vLLM rollout:** The GPUs available to the vLLM server
140+ are controlled by the ` ROLLOUT_VISIBLE_DEVICE ` environment variable
141+ (comma-separated CUDA device indices, e.g. ` ROLLOUT_VISIBLE_DEVICE=6,7 ` ),
142+ not by a field in the JSON config. This keeps the vLLM device assignment
143+ decoupled from the DeepSpeed launcher's own ` CUDA_VISIBLE_DEVICES ` /
144+ ` --include ` flags, which control only the training ranks.
145+
136146## Adding a new model architecture
137147
138148No special steps are needed for new model architectures. vLLM's RLHF weight
0 commit comments