[Dev] fix: skip FSDP DTensor boundary validation under fake process group - #3668
Merged
Merged
Conversation
The `validate_uneven_dtensor` function uses `all_reduce(MAX)` across all ranks to verify that local shards collectively cover the full global tensor. Under fake process group (backend='fake'), all collective operations are no-ops, so only rank 0's boundaries are visible — the end-boundary check always fails. Skip the boundary validation when the distributed backend is 'fake', since fake process group is only used for memory profiling where numerical correctness is irrelevant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yaox12
approved these changes
Mar 3, 2026
Author
|
/ok to test ffdf587 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22654519915 |
6 tasks
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.
PR to main #3669
Summary
validate_uneven_dtensorboundary check when the distributed backend is'fake'(fake process group)all_reduce(MAX)to verify all ranks' shards cover the full tensor, but under fake PG all collectives are no-ops — only rank 0's boundaries are visible, causing the end-boundary assertion to always failTarget branch:
devTest plan
--fake-process-group --use-megatron-fsdp --data-parallel-sharding-strategy optim_grads_params --init-model-with-meta-deviceon a single GPU