Skip to content

[Dev] fix: skip FSDP DTensor boundary validation under fake process group - #3668

Merged
Victarry merged 1 commit into
NVIDIA:devfrom
Victarry:denliu/fix-fsdp-fake-pg-compat
Mar 4, 2026
Merged

[Dev] fix: skip FSDP DTensor boundary validation under fake process group#3668
Victarry merged 1 commit into
NVIDIA:devfrom
Victarry:denliu/fix-fsdp-fake-pg-compat

Conversation

@Victarry

@Victarry Victarry commented Mar 3, 2026

Copy link
Copy Markdown

PR to main #3669

Summary

  • Skip validate_uneven_dtensor boundary check when the distributed backend is 'fake' (fake process group)
  • The validation uses 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 fail
  • Fake process group is only used for single-GPU memory profiling where numerical correctness is irrelevant, so the validation can be safely skipped

Target branch: dev

Test plan

  • Run Megatron-LM with --fake-process-group --use-megatron-fsdp --data-parallel-sharding-strategy optim_grads_params --init-model-with-meta-device on a single GPU
  • Verify training completes 3 iterations without DTensor assertion error
  • Verify memory snapshot is correctly captured

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>
@Victarry
Victarry requested review from a team as code owners March 3, 2026 04:03
@copy-pr-bot

copy-pr-bot Bot commented Mar 3, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Victarry

Victarry commented Mar 3, 2026

Copy link
Copy Markdown
Author

/ok to test ffdf587

@svcnvidia-nemo-ci svcnvidia-nemo-ci added this to the Core 0.16 milestone Mar 3, 2026
@Victarry
Victarry added this pull request to the merge queue Mar 4, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22654519915

@Victarry Victarry changed the title fix: skip FSDP DTensor boundary validation under fake process group [Dev] fix: skip FSDP DTensor boundary validation under fake process group Mar 4, 2026
Merged via the queue into NVIDIA:dev with commit 5dadaf1 Mar 4, 2026
50 checks passed
@Victarry
Victarry deleted the denliu/fix-fsdp-fake-pg-compat branch March 4, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants