fix: Fix non-colocated refit when vLLM model parallel size is larger than 8#1369
Conversation
📝 WalkthroughWalkthroughIntroduces a conditional in vllm_generation.py to adjust NCCL environment variables during non-colocated, cross-node model-parallel inference: when NCCL_CUMEM_ENABLE is active and cross-node parallelism is required with colocated disabled, it sets NCCL_NVLS_ENABLE="0" and logs an informational message. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Runner as Inference Runner
participant VLLMGen as vllm_generation.py
participant Env as OS Env Vars
participant Log as Logger
Runner->>VLLMGen: initialize_inference(...)
activate VLLMGen
VLLMGen->>Env: read NCCL_CUMEM_ENABLE
alt NCCL_CUMEM_ENABLE == "1"
VLLMGen->>VLLMGen: check colocated == False
VLLMGen->>VLLMGen: check needs_cross_node_parallelism == True
alt non-colocated and cross-node
VLLMGen->>Env: set NCCL_NVLS_ENABLE="0"
VLLMGen->>Log: info("Disabling NCCL NVLS for cross-node non-colocated")
else otherwise
Note over VLLMGen: No changes to NVLS
end
else
Note over VLLMGen: No CUMEM block executed
end
VLLMGen-->>Runner: proceed with inference setup
deactivate VLLMGen
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
nemo_rl/models/generation/vllm/vllm_generation.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
**/*.py: Follow the Google Python Style Guide for all Python code
Target Python 3.12+ for all Python code in NeMo-RL
Indent Python code with 4 spaces; do not use tabs
Python filenames should be snake_case (e.g., some_file.py)
Class names should be PascalCase
Function and method names should be snake_case
Local variable names should be snake_case; if starting with a number, prefix with k (e.g., k_99th_percentile)
Global variables should be UPPER_SNAKE_CASE and prefixed with G_ (e.g., G_MY_GLOBAL)
Constants should be UPPER_SNAKE_CASE
Avoid shadowing variables declared in an outer scope
Initialize all externally visible members of a class in the constructor
For public interfaces used outside a file, prefer docstrings over comments
Use comments mainly for code within a function or interfaces local to a file
Commented-out code must include a nearby comment explaining usage and why it is commented out; otherwise remove before merging
Use Google-style docstrings for classes and functions (Sphinx-parseable)
Avoid using reflection when functionality can be easily achieved without it
Limit except clauses to the smallest specific set of exceptions possible
For duck-typing via try/except, keep the try body minimal and use else for main logic
Add the NVIDIA copyright header (with current year) at the top of all Python files, excluding tests/ and test-only scripts
Files:
nemo_rl/models/generation/vllm/vllm_generation.py
nemo_rl/**/*.py
📄 CodeRabbit inference engine (CODING_GUIDELINES.md)
nemo_rl/**/*.py: Do not set non-None configuration defaults in code; YAML is the single source of truth for defaults
Access required config attributes directly (e.g., policy_cfg["precision"]) and assume presence; do not introduce hidden defaults
Express configuration optionality via TypedDict using typing.NotRequired
When adding a new config key to a TypedDict subclass, document the key’s purpose, valid values/types, and recommended default in code
For any class or function decorated with @ray.remote, add '# pragma: no cover' on the class/def line (and on remote functions)
Files:
nemo_rl/models/generation/vllm/vllm_generation.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: sphinx-build / Build docs
- GitHub Check: Lint check
- GitHub Check: Lint check
- GitHub Check: Lint check
- GitHub Check: Post automodel integration comment / Comment on PR
- GitHub Check: Post submodule check comment / Comment on PR
|
Hi @youngeunkwon0405 , thanks for the fix! I'm not sure if the colocated path has the same issue with cross node parallel and needs the same fix. |
Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com>
I also checked for colocated case. I was able to see the same |
…than 8 (#1369) Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com> Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
…than 8 (#1369) Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com> Signed-off-by: Lawrence Lane <llane@nvidia.com>
…than 8 (NVIDIA-NeMo#1369) Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com>
…than 8 (NVIDIA-NeMo#1369) Signed-off-by: Youngeun Kwon <youngeunk@nvidia.com> Signed-off-by: yuanhangs <yuanhangs@nvidia.com>
What does this PR do ?
See #1352 for the details.
Issues
List issues that this PR closes (syntax):
Closes #1352
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information
Summary by CodeRabbit