feat: colocated Megatron reshard - #3490
Conversation
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test fcda426 |
|
/ok to test d24e7c4 |
|
/ok to test 4941ebb |
|
/ok to test 9fc3e0a |
|
left a few minor comments but looks like it follows the megatron rl pattern and should be good |
wdykas
left a comment
There was a problem hiding this comment.
LGTM except a few comments
|
/ok to test d549a67 |
|
/ok to test 796a168 |
|
/ok to test 738d84d |
|
/ok to test 07f392e |
738d84d to
07f392e
Compare
07f392e to
7a2653a
Compare
|
/ok to test 7a2653a |
|
/ok to test 94f7a94 |
|
/ok to test 110a8b6 |
|
/ok to test fe4e7ac |
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
The NVIDIA-NeMo#3499 rebase replaced worker_init_timing_metrics with the SetupTimingMetrics dataclass; the eager initial sync is the generation load in that scheme. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
refit_policy_generation no longer hand-rolls the Megatron collective; without a wired synchronizer it fell through to the vLLM broadcast path (AttributeError: model_update_group). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
f81a58d to
4c3e03c
Compare
|
/ok to test 4c3e03c |
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
|
/ok to test 3ad74f7 |
terrykong
left a comment
There was a problem hiding this comment.
Team review of the colocated Megatron reshard. 7 specialised agents plus two independent adversarial passes; 9 candidate findings were dropped as wrong or unfounded before posting.
Overall this reads well and I'd like to see it land. Routing Megatron through WeightSynchronizer removes 7 isinstance(policy_generation, MegatronGeneration) conditions from refit_policy_generation, and I verified the upstream API usage in detail (build_inference_pg_collection, swap_model_weights, the _pg_collection setattr, finalize() idempotency, and the torch_memory_saver pattern all match Megatron-LM / Megatron-Bridge precedent). The moe_router_num_groups reset is a genuinely necessary workaround for InferenceTopKRouter's assert, not a clobber.
Two items worth acting on before merge: the offload_optimizer_for_refit default silently changes behaviour for two shipped nemo_gym configs, and the colocated reshard path lacks the virtual-pipeline guard its nccl_reshard sibling already has. The rest are suggestions and nits.
Reviewed at 3ad74f7 (re-verified after the rebase).
Generated by Claude Code
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
|
/ok to test 5f1f294 |
|
@terrykong I believe I've addressed all the comments. I also found a couple of extra issues I fixed in 5f1f294 Can you please take another look? |
…03-elastic-recovery Part 2 (#3590) landed as a squash, so every file it touched conflicts with itself here. Verified all 17 are byte-identical between the Part 2 branch tip and main, which makes "ours" (that same content plus this branch's delta) the provably correct side. pyrefly.toml was the one real conflict: three commits each appended an allow-list entry, all three kept. The substantive change comes from the colocated Megatron reshard (#3490): mark_stale() is gone from WeightSynchronizer and every implementation, with per-step staleness now owned by the training loop. Nothing on this branch called it, so the removal merged cleanly; the one leftover was a fake in test_reconcile_communicator that still defined it, now dropped so the fake matches the interface it stands in for.
What does this PR do ?
This PR adds the ability to refit during colocated RL.
Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information