Skip to content

[DeepSeek] Enable data parallel - #1003

Merged
kwen2501 merged 1 commit into
mainfrom
reland_956
Mar 21, 2025
Merged

kwen2501 merged 1 commit into
mainfrom
reland_956

Conversation

@kwen2501

Copy link
Copy Markdown
Contributor

Reland #956

This PR adds FSDP on the Expert modules. Since before this we are already doing a DP-to-EP shuffle between the Attention and the Experts, we applies HSDP on the Attention, with the replicate dimension being the same as the EP dimension.

In particular, we are using Zero-2 sharding which shards optimizer and gradients, and not sharding the weights, to avoid the expensive re-gather of MoE.

ghstack-source-id: 3dbd063
Pull Request resolved: #956
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 21, 2025
@kwen2501
kwen2501 merged commit 576e177 into main Mar 21, 2025
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 13, 2026
Reland pytorch#956

This PR adds FSDP on the Expert modules. Since before this we are
already doing a DP-to-EP shuffle between the Attention and the Experts,
we applies HSDP on the Attention, with the replicate dimension being the
same as the EP dimension.

In particular, we are using Zero-2 sharding which shards optimizer and
gradients, and not sharding the weights, to avoid the expensive
re-gather of MoE.
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 25, 2026
Reland pytorch#956

This PR adds FSDP on the Expert modules. Since before this we are
already doing a DP-to-EP shuffle between the Attention and the Experts,
we applies HSDP on the Attention, with the replicate dimension being the
same as the EP dimension.

In particular, we are using Zero-2 sharding which shards optimizer and
gradients, and not sharding the weights, to avoid the expensive
re-gather of MoE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants