Skip to content

[ALST/Ulysses] Added ALST/Ulysses documentation#4420

Merged
kashif merged 15 commits into
mainfrom
doc/update-alst-ulysses-docs
Dec 8, 2025
Merged

[ALST/Ulysses] Added ALST/Ulysses documentation#4420
kashif merged 15 commits into
mainfrom
doc/update-alst-ulysses-docs

Conversation

@kashif

@kashif kashif commented Nov 1, 2025

Copy link
Copy Markdown
Collaborator

What does this PR do?

Added an ALST/Ulysses section to the distributed training doc with yaml config.

Needs:

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

- Simplify ALST/Ulysses section to match style of other docs sections
- Condense from ~495 lines to ~164 lines while keeping essential info
- Add practical example using trl/scripts/sft.py with 4 GPUs
- Update requirements to recommend Flash Attention 2 over SDPA
- Add concise 2D parallelism explanation with code snippet
- Simplify best practices to 5 key points
- Streamline troubleshooting section
- Fix alst_ulysses_4gpu.yaml config (remove 'auto' values)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@kashif kashif marked this pull request as draft November 1, 2025 18:41
@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.

kashif and others added 4 commits November 1, 2025 18:43
- Simplify ALST/Ulysses section to match style of other docs sections
- Condense from ~495 lines to ~164 lines while keeping essential info
- Add practical example using trl/scripts/sft.py with 4 GPUs
- Update requirements to recommend Flash Attention 2 over SDPA
- Add concise 2D parallelism explanation with code snippet
- Simplify best practices to 5 key points
- Streamline troubleshooting section
- Fix alst_ulysses_4gpu.yaml config (remove 'auto' values)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread docs/source/distributing_training.md Outdated
Comment thread docs/source/distributing_training.md Outdated
Comment thread docs/source/distributing_training.md Outdated

### 2D Parallelism

The 4 GPU configuration above automatically enables 2D parallelism by combining Data Parallelism (DP) with Context Parallelism (CP). The `dp_shard_size` is automatically calculated to distribute across available GPUs:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add experiments here as the fsdp example

Comment thread docs/source/distributing_training.md Outdated
cp_size = 2
dp_shard_size = num_gpus // cp_size # Automatically calculated

parallelism_config = ParallelismConfig(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do it via .yaml as in the other example to follow the same style?

Here's how to run ALST/Ulysses training using the built-in [`sft.py`](https://github.com/huggingface/trl/blob/main/trl/scripts/sft.py) script with 4 GPUs:

```bash
accelerate launch --config_file examples/accelerate_configs/alst_ulysses_4gpu.yaml \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@SunMarc

SunMarc commented Nov 4, 2025

Copy link
Copy Markdown
Member

cc @stas00

Comment thread docs/source/distributing_training.md Outdated

@NouamaneTazi NouamaneTazi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 🙌

Comment thread docs/source/distributing_training.md
Comment thread docs/source/distributing_training.md
Comment thread examples/accelerate_configs/alst_ulysses_4gpu.yaml
Co-authored-by: Sergio Paniego Blanco <sergiopaniegoblanco@gmail.com>

@sergiopaniego sergiopaniego left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SunMarc

SunMarc commented Dec 8, 2025

Copy link
Copy Markdown
Member

should we merge @kashif ?

@kashif kashif marked this pull request as ready for review December 8, 2025 13:43
@kashif

kashif commented Dec 8, 2025

Copy link
Copy Markdown
Collaborator Author

sure let me do 1 final check @SunMarc

@kashif kashif merged commit e820eec into main Dec 8, 2025
3 checks passed
@kashif kashif deleted the doc/update-alst-ulysses-docs branch December 8, 2025 13:49
songhappy pushed a commit to songhappy/trl that referenced this pull request Apr 20, 2026
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Sergio Paniego Blanco <sergiopaniegoblanco@gmail.com>
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.

6 participants