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-6-tp-x-cp
branch
from
November 9, 2026 14:25
5acd8bd to
2b71a64
Compare
This was referenced Nov 9, 2026
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 9, 2026 14:37
2b71a64 to
210c54b
Compare
This was referenced Nov 9, 2026
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 10, 2026 02:50
210c54b to
59258f7
Compare
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 10, 2026 03:01
59258f7 to
37cf584
Compare
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 10, 2026 05:19
37cf584 to
a64ce5d
Compare
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 10, 2026 05:44
a64ce5d to
9a8e25a
Compare
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 10, 2026 06:03
9a8e25a to
752288d
Compare
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 12, 2026 06:19
752288d to
6f80c79
Compare
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 12, 2026 07:15
6f80c79 to
7094e39
Compare
`fsdp_cp` is now an axis of a dense root mesh `(pp, dp_replicate, fsdp_cp, tp)`, and the five dense axes are an unflattened view of it: FSDP2 composes the mesh it shards over with the mesh the parameters are already sharded on, and torch only composes meshes built from the same root. Requires `torch>=2.10` (`DeviceMesh._unflatten`), refused in `DistributedConfig`. Under TP this rank holds `num_heads / tp_size` heads and Ulysses splits those across the cp group, so `cp_size * tp_size` must divide the attention and key/value heads.
`tp_size=2 x cp_size=2` on four ranks, plain and packed, against the same weights on the full sequences, plus the gathered save, the head divisibility check under TP, and a test that the two plans compose: the attention module whose call CP routes is the one whose projections TP sharded.
3outeille
force-pushed
the
cp-6-tp-x-cp
branch
from
November 12, 2026 08:01
7094e39 to
405f6f5
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 → this PR → #50514 → #50515 → #50499 → #50521 → #50522
Context parallelism now composes with tensor parallelism:
DistributedConfig(tp_size=T, cp_size=C), with or withoutfsdp_size.num_heads / tp_sizeheads, and Ulysses splits those across the cp ranks. Sotp_size * cp_sizemust divide the attention and key/value heads.rank // (cp_size * tp_size).distributed]DistributedConfig(cp_size=N)#50496 already buildsfsdp_cpon the root mesh, which FSDP2 composes withtp.pp_sizeandep_sizewithcp_sizeare still refused.Tests
tests/context_parallel, CPU (gloo). Loss, logits slice and every gradient match an unsharded run:Also: the head check with
tp_size * cp_size, and gatheredsave_pretrainedwith tp × cp. The existing TP, FSDP and EP tests of llama and qwen3_moe pass, and so doestests/tensor_parallel.