Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/configs/grpo_math_1B.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ policy:
stop_token_ids: null
stop_strings: null
vllm_cfg:
async_engine: false # Only for internal testing, will be enabled by https://github.com/NVIDIA/NeMo-RL/issues/447.
async_engine: false
precision: ${policy.precision}
tensor_parallel_size: 1
pipeline_parallel_size: 1
Expand Down
6 changes: 6 additions & 0 deletions nemo_rl/models/generation/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,12 @@ def __init__(
"""Initialize a vLLM policy with distributed workers."""
# Store config
self.cfg = config
if self.cfg["vllm_cfg"]["pipeline_parallel_size"] > 1:
assert self.cfg["vllm_cfg"]["async_engine"], (
"When pipeline_parallel_size > 1, async_engine must be set to True in the vLLM configuration. "
"You can enable it by adding `policy.generation.vllm_cfg.async_engine=true` to your command."
)

# Ensure all required VllmConfig fields are present
missing_keys = [
key for key in VllmConfig.__required_keys__ if key not in self.cfg
Expand Down
Loading