Skip to content

[docs] Context parallelism with DistributedConfig - #50522

Draft
3outeille wants to merge 1 commit into
cp-11-trainerfrom
cp-5-docs
Draft

3outeille wants to merge 1 commit into
cp-11-trainerfrom
cp-5-docs

Conversation

@3outeille

@3outeille 3outeille commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Stack: #50493 → #50496 → #50511 → #50514 → #50499 → #50521 → this PR

Adds a "Context parallelism" page under Distributed training, next to FSDP2. It covers:

  • usage in a training loop, and how to feed the same batch to the ranks of a cp group;
  • the context parallel plan (base_model_cp_plan, the two styles, cp_plan overrides);
  • masks, which come from the model itself, and what this costs;
  • the attention styles, and how to register your own;
  • training with [Trainer], and combining CP with TP and EP;
  • what is refused and why, and how CP relates to the sequence_parallel TP style.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

Pages changed in this PR:

`docs/source/en/context_parallelism.md` documents the plan API: the `base_model_cp_plan` default and
the two styles, the `cp_plan` override, `cp_implementation` and how to register your own, the
model's own masks (packing, padding, sliding windows, chunked attention, custom mask functions),
the cost, tensor and expert parallelism, the automatic padding, `Trainer`, and what is refused.
The page joins the performance section of the table of contents after FSDP2.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants