Repository navigation
Conversation
Contributor
Author
|
/ok to test 33627e2 |
Contributor
Author
|
/ok to test 0a0f601 |
shjwudp
force-pushed
the
split/pr6484-fine-grained-hooks
branch
from
August 20, 2026 05:18
0a0f601 to
1fdb108
Compare
Contributor
Author
|
/ok to test 1fdb108 |
shjwudp
force-pushed
the
split/pr6484-fine-grained-hooks
branch
from
September 3, 2026 14:34
e200680 to
51723a8
Compare
copy-pr-bot
Bot
force-pushed
the
pull-request/6484
branch
from
September 4, 2026 06:44
7dcc669 to
cff249e
Compare
Clarify the API contract: the callback runs gradient reduction once all trainable parameters have accumulated their gradients, not via a module-level full-backward post hook (which can fire at the wrong time, e.g. with TE delayed wgrad). Addresses review feedback on NVIDIA#6484. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
pre_backward() runs from the registered backward hook or the 1F1B schedule, neither of which passes a value, so the knob is dead. Restore the unconditional context.register_post_backward_final_callback() call. Addresses NVIDIA#6484 review feedback. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
The range_push was moved after context=self.context during the life-cycle refactor; it is a no-op reorder, so put it back to keep the diff focused. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
Rename _post_backward_hook_registered to _grad_reduction_callback_registered to match the renamed register_grad_reduction_callback API, and document that external schedulers calling unshard() directly must perform the root all-gather-stream sync that pre_forward() normally does first. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
…rop duplicate-guard - Keep the public method name register_post_backward_hook (the callback also reshards; rename to grad_reduction_callback was misleading). - Drop the _post_backward_hook_registered state so FsdpModule can accept multiple hooks and let the fine-grained scheduler do its own checking. - Comment why register_load_state_dict_pre_hook is registered unconditionally. - Rename _lifecycle_events to _forward_backward_events. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
Wrap the unshard/reshard/gradient_reduce nvtx push/pop in a context manager so an early return cannot skip the matching pop. forward/backward span multiple lifecycle methods and keep their explicit push/pop. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
Drop tests that assert on private attributes/internal methods (behavior- not-implementation): test_fully_shard_can_disable_execution_hooks, test_register_post_backward_hook_waits_for_all_parameter_gradients, and test_multiple_forwards_before_backwards_reset_gradient_readiness. register_hooks and the fine-grained scheduler get their coverage in the upcoming 1F1B PRs. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
…IA#6484 lifecycle) Port the NVIDIA#6692 fine-grained scheduler integration on top of split/pr-a-overlap (a2ba13b), dropping the removed custom_schedule lifecycle and relying on the NVIDIA#6484 MFSDP v2 API (register_post_backward_hook, idempotent unshard()/reshard()). - Add fine_grained_mfsdp_scheduler.py (setup_combined_1f1b_hooks, submodule unshard/reshard hooks, reshard_fsdp_module) with no custom_schedule. - Wire it in model_chunk_schedule_plan.py. - Add end-to-end ND-parallel overlap parity test. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
shjwudp
force-pushed
the
split/pr6484-fine-grained-hooks
branch
from
September 7, 2026 02:38
e5bdfec to
7172f5f
Compare
Signed-off-by: Jack Chang <jianbinc@nvidia.com>
…hedule_plan.py Signed-off-by: Jack Chang <jianbinc@nvidia.com>
Signed-off-by: Jack Chang <jianbinc@nvidia.com>
shjwudp
marked this pull request as draft
September 7, 2026 12:22
shjwudp
added a commit
to shjwudp/Megatron-LM
that referenced
this pull request
Sep 7, 2026
…IA#6484 lifecycle) Port the NVIDIA#6692 fine-grained scheduler integration on top of split/pr-a-overlap (a2ba13b), dropping the removed custom_schedule lifecycle and relying on the NVIDIA#6484 MFSDP v2 API (register_post_backward_hook, idempotent unshard()/reshard()). - Add fine_grained_mfsdp_scheduler.py (setup_combined_1f1b_hooks, submodule unshard/reshard hooks, reshard_fsdp_module) with no custom_schedule. - Wire it in model_chunk_schedule_plan.py. - Add end-to-end ND-parallel overlap parity test. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
shjwudp
added a commit
to shjwudp/Megatron-LM
that referenced
this pull request
Sep 10, 2026
…IA#6484 lifecycle) Port the NVIDIA#6692 fine-grained scheduler integration on top of split/pr-a-overlap (a2ba13b), dropping the removed custom_schedule lifecycle and relying on the - Add fine_grained_mfsdp_scheduler.py (setup_combined_1f1b_hooks, submodule unshard/reshard hooks, reshard_fsdp_module) with no custom_schedule. - Wire it in model_chunk_schedule_plan.py. - Add end-to-end ND-parallel overlap parity test. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
shjwudp
added a commit
to shjwudp/Megatron-LM
that referenced
this pull request
Sep 15, 2026
…IA#6484 lifecycle) Port the NVIDIA#6692 fine-grained scheduler integration on top of split/pr-a-overlap (a2ba13b), dropping the removed custom_schedule lifecycle and relying on the - Add fine_grained_mfsdp_scheduler.py (setup_combined_1f1b_hooks, submodule unshard/reshard hooks, reshard_fsdp_module) with no custom_schedule. - Wire it in model_chunk_schedule_plan.py. - Add end-to-end ND-parallel overlap parity test. Signed-off-by: Jack Chang <jianbinc@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 2 of the MFSDP v2 combined-1F1B split. This PR contains the MCore adapter and
models/commonschedule integration; the generic experimental lifecycle remains in #6484.overlap_moe_expert_parallel_commno_sync()handling and wait for the final reduce-scatter before gradient consumersDependency
Depends on #6484 and is based on its verified
pull-request/6484mirror. Retarget this PR tomainbefore merging; merging while based on the mirror would land into the bot scratch branch instead ofmain.Validation
git diff --check: passedmain: pending cluster MFA availability