fix(mfsdp): refresh V2 compute weights after optimizer step - #6336
Open
wujingyue wants to merge 1 commit into
Open
fix(mfsdp): refresh V2 compute weights after optimizer step#6336wujingyue wants to merge 1 commit into
wujingyue wants to merge 1 commit into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
wujingyue
force-pushed
the
agent/mfsdp-v2-native-weight-sync
branch
2 times, most recently
from
August 7, 2026 04:23
89e7063 to
1252bd6
Compare
wujingyue
marked this pull request as ready for review
August 7, 2026 04:26
Contributor
Author
|
/ok to test 1252bd6 |
skyw
approved these changes
Aug 7, 2026
| def _copy_main_params_to_model_params(self) -> None: | ||
| """No-op: MFSDP v2 currently syncs compute weights in its forward pre-hook.""" | ||
| """Refresh MFSDP V2 compute weights after updating optimizer weights.""" | ||
| # TODO: Reuse experimental.checkpoint.resync_compute_weights after #6024 merges. |
Contributor
There was a problem hiding this comment.
Nit: may be add name to the TODO.
| for parameter in self.get_parameters() | ||
| if (parameter_group := get_containing_parameter_group(parameter)) is not None | ||
| } | ||
| for parameter_group in parameter_groups: |
Contributor
There was a problem hiding this comment.
Nit: single letter "s" difference is hard to spot and easily miss. May consider better name.
wujingyue
force-pushed
the
agent/mfsdp-v2-native-weight-sync
branch
from
August 7, 2026 17:48
1252bd6 to
54d9aec
Compare
wujingyue
force-pushed
the
agent/mfsdp-v2-native-weight-sync
branch
from
August 7, 2026 17:52
54d9aec to
ad73e1b
Compare
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
wujingyue
force-pushed
the
agent/mfsdp-v2-native-weight-sync
branch
from
August 7, 2026 17:55
ad73e1b to
bb85dbd
Compare
jaredcasper
approved these changes
Aug 7, 2026
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
FullyShardedOptimizer's native post-step copy hook.Root cause
#5949 moved main-weight to model-weight synchronization from pre-forward to optimizer post-step.
FullyShardedOptimizerinherited the post-step extension point but left its implementation as a no-op, so optimizer weights updated while subsequent forwards continued to use stale compute weights.The existing three-step integration test used a 1% relative tolerance. The resulting loss drift remained below that threshold, so the test passed despite the missing refresh.
Validation
uv run python -m torch.distributed.run --nproc_per_node=2 -m pytest -q tests/unit_tests/distributed/mfsdp_v2/test_mcore_adapter.py::TestMcoreAdapter::test_build_train_and_stepruff checkandblack --checkon edited filesRelated to #5949 and #6325.