Repository navigation
Conversation
[ghstack-poisoned]
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. [ghstack-poisoned]
weifengpy
left a comment
There was a problem hiding this comment.
fsdp wrapping looks good to me
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-poisoned]
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-poisoned]
|
Another (slightly tangential) noob q: I guess |
|
Very cool. One question out of curiosity: any particular reason to use the 2D That would improve memory savings by a factor of 2 in this case. |
@weifengpy any comment you may have? |
I believe @weifengpy may be the best person to answer this. |
@kwen2501 at grad clipping, would
good catch! we need similar things to pp, i.e. all-reduce total_norm explicitly |
indeed, applying |
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.
|
Landed via #1003 |
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.
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.
Stack from ghstack (oldest at bottom):
output_splits#941This 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.