MFSDP v2 currently rejects the placement differences needed for HSDP/HFSDP.
megatron_fsdp/experimental/parameter_group.py requires main_grad and main_weight to have identical placements and raises until HSDP/HFSDP support is implemented. That blocks hybrid sharding modes where weights, gradients, and optimizer state intentionally use different inner-DP / outer-DP layouts.
Implementation detail:
- First microbatch: all-gather across DP-outer.
- Last microbatch: reduce-scatter or all-reduce across DP-outer.
- DP-outer communication should probably run on a separate stream so it can overlap with DP-inner communication.
Expected outcome:
- Define MFSDP v2 layout semantics for HSDP and HFSDP.
- Support HSDP outer-DP replication / gradient synchronization.
- Support HFSDP optimizer-state sharding across inner and outer DP ranks.
- Add focused tests for the required placement and collective transitions.
Development PRs:
MFSDP v2 currently rejects the placement differences needed for HSDP/HFSDP.
megatron_fsdp/experimental/parameter_group.pyrequiresmain_gradandmain_weightto have identical placements and raises until HSDP/HFSDP support is implemented. That blocks hybrid sharding modes where weights, gradients, and optimizer state intentionally use different inner-DP / outer-DP layouts.Implementation detail:
Expected outcome:
Development PRs: