Repository navigation
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 9, 2026 14:25
c9e600a to
d0d2eb7
Compare
This was referenced Nov 9, 2026
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 9, 2026 14:37
d0d2eb7 to
58051e9
Compare
This was referenced Nov 9, 2026
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 10, 2026 02:50
58051e9 to
62333ac
Compare
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 10, 2026 03:01
62333ac to
963136f
Compare
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 10, 2026 05:19
963136f to
dcd89f0
Compare
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 10, 2026 05:45
dcd89f0 to
95dc69d
Compare
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 10, 2026 06:03
95dc69d to
55ebcac
Compare
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 12, 2026 06:19
55ebcac to
a17b368
Compare
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 12, 2026 07:15
a17b368 to
b5fac32
Compare
Each rank of a cp group dispatches the tokens of its own slice only, so no token reaches an expert twice and `efsdp * ep` still covers `fsdp * cp * tp`. The expert gradient divide factor already counts the cp ranks through `dp_size`, so only the explanatory comment and the mesh docstring change; `cp_size` with `ep_size` is no longer refused.
The tiny Qwen3-MoE against the same weights on the full sequences, with token dispatch on `cp2 x ep2`, `cp2 x fsdp2 x ep4`, `cp2 x fsdp2 x ep2` (efsdp), `cp2 x tp2 x ep4` and `cp2 x hsdp2 x ep2`, plus the all-reduce plan with `ep_size=tp_size=2` where the ep group holds one cp slice. Every case stays within four ranks.
3outeille
force-pushed
the
cp-9-ep-x-cp
branch
from
November 12, 2026 08:01
b5fac32 to
4a238a2
Compare
This branch has not been deployed
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.
What does this PR do?
Stack: #50493 → #50496 → #50511 → this PR → #50515 → #50499 → #50521 → #50522
Context parallelism now composes with expert parallelism:
DistributedConfig(cp_size=C, ep_size=E, ...). Onlypp_sizeis still refused withcp_size.ep_dispatch_experts, the default of most MoE models): each rank dispatches the tokens of its own cp slice. A cp slice plays the role a batch plays for the expert mesh.efsdp = fsdp * cp * tp / epalready covers the world.set_gradient_divide_factor(dp_size)already gives the gradient of the full-sequence loss, becausedp_sizeincludescp_sizeand the CP loss hook scales each rank's gradient bycp_size. No code change; only the comment is updated.ep_size=tp_size, and the ranks of a tp group hold the same slice.Tests
tests/context_parallel, CPU (gloo), tiny Qwen3-MoE. Loss, logits slice and every gradient, experts included, match an unsharded run:The existing EP / FSDP tests of qwen3_moe and
tests/expert_parallelpass.