chore(customizer): add automodel and mcore backends in RL image - #1231
Conversation
📝 WalkthroughWalkthroughThe RL image now builds and documents Automodel, mcore, Transformer-Engine, and separate DTensor V2 and Megatron policy-worker environments. Smoke tests validate the new worker imports and distributions. ChangesRL worker environments and build configuration
Sequence Diagram(s)sequenceDiagram
participant DockerBuild
participant WorkerPrefetch
participant ActorRegistry
participant SmokeTest
DockerBuild->>WorkerPrefetch: Build and prefetch worker environments
WorkerPrefetch->>ActorRegistry: Register DTensor V2 and Megatron workers
ActorRegistry->>SmokeTest: Expose worker environments
SmokeTest->>SmokeTest: Check imports and distributions
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker/rl/README.md`:
- Around line 3-10: Update the Docker RL README image inventory to include the
automodel extra and Transformer-Engine compilation. Also revise the per-worker
Ray venv count from five to eight to reflect the seven filters and V2
policy-worker addition.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 92bf6bad-027c-48be-b599-df3a56387fde
📒 Files selected for processing (2)
docker/rl/Dockerfile.nmp-rl-basedocker/rl/README.md
|
30046ae to
64c0df7
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docker/rl/Dockerfile.nmp-rl-base`:
- Around line 8-9: Update docker/rl/Dockerfile.nmp-rl-base lines 8-9 to describe
mcore as a built Megatron backend. In docker/rl/README.md lines 260-264, add
MegatronPolicyWorker, VllmAsyncGenerationWorker, SandboxedGymActor, and
SandboxEpisodeBrokerActor; at lines 281-285, identify the diagram as the
Automodel path or include the Megatron policy alternative; at lines 434-442, add
the mcore filter and revise the inventory to eight filters and nine venvs.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4e1c24b1-9509-4201-8dab-e4edb8585fb2
📒 Files selected for processing (3)
docker/rl/Dockerfile.nmp-rl-basedocker/rl/README.mdtests/smoke_gpu/test_rl_training.py
1f9c342 to
53f7449
Compare
Signed-off-by: anubhutiv <anubhutiv@nvidia.com>
64c0df7 to
2b5ef22
Compare
Summary
automodelandmcoreextras in the RL base image so both GRPO training tiers,DTensor V2andMegatronChanges
automodel(DTensor V2)policy.dtensor_cfg._v2: true, which selectsDTensorPolicyWorkerV2->PY_EXECUTABLES.AUTOMODEL. That extra wasn't built, so the venv would have been constructed on the node at first run against a cold cache, including a Transformer-Engine source compile per node, at job time.--extra automodelto the warmup syncs.DTensorPolicyWorkerV2. This is also the only LoRA-capable DTensor tier, V1 assertslora_cfg.enabled is Falseinnemo_rl/models/policy/lm_policy.py.mcore(Megatron)--extra mcoreto the warmup syncs and prefetchesMegatronPolicyWorker.mcorebacks the GRPO capabilities DTensor does not implement in NeMo-RL today: pipeline parallelism, FP8 training / FP8 rollouts / FP8 KV-cache, NVFP4 quantization-aware RL, draft models + EAGLE3 speculative decoding, Megatron-native generation (no refit weight conversion)[tool.uv] override-dependenciescollapses every TE requirement,automodel's declaredv2.14.1andmegatron-bridge[te]'s own rev, ontogit+…/TransformerEngine.git@release_v2.15, souv.lockholds exactly one resolvedtransformer-engine 2.15.0+42b8400.mcoresync reuses the wheel theautomodelsync built.deep_ep,mamba-ssmandcausal-conv1dare pinned identically across the extras and are reused the same way.mcoregenuinely adds is cheap:megatron-bridgeandmegatron-coreare editable path sources from submodules already on disk, plus wheel-onlyflashinfer-*==0.6.8.post1,nvshmem4py-cu13,cupy-cuda13x, andnvidia-modeloptfrom git.Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation:
Summary by CodeRabbit