Skip to content

[docs] Sequence parallelism with DistributedConfig - #50522

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

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 → #50796 → #50511 → #50514 → #50521 → this PR

Adds a "Sequence 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 an sp group;
  • the sequence parallel plan (base_model_sp_plan, the two styles, sp_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 SP with TP and EP;
  • what is refused and why, and how SP relates to the sequence_parallel TP style;
  • how it differs from parallelism_config.sp_size (DeepSpeed Ulysses) and parallelism_config.cp_size (ring attention) in Trainer and Accelerate.

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Nov 9, 2026 •

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:

@3outeille 3outeille changed the title [docs] Context parallelism with DistributedConfig [] Sequence parallelism with Nov 20, 2026
@3outeille 3outeille changed the title [] Sequence parallelism with [docs] Sequence parallelism with DistributedConfig Nov 20, 2026
@3outeille
3outeille removed this pull request from stack #50797 November 20, 2026 08:49
@3outeille
3outeille added this pull request to stack #51004 November 20, 2026 08:50
@3outeille
3outeille removed this pull request from stack #51004 November 30, 2026 05:31
@3outeille
3outeille added this pull request to stack #51606 December 2, 2026 05:05
@3outeille
3outeille force-pushed the cp-5-docs branch 2 times, most recently from 5e443d5 to b7335ae Compare December 2, 2026 08:00
@3outeille
3outeille marked this pull request as ready for review December 2, 2026 08:05
@3outeille
3outeille force-pushed the cp-5-docs branch 2 times, most recently from e0b8737 to 1f58202 Compare December 3, 2026 07:38
`docs/source/en/sequence_parallelism.md` documents the plan API: the `base_model_sp_plan` default and
the two styles, the `sp_plan` override 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