Skip to content

SP ulysses native implementation#4084

Open
SunMarc wants to merge 1 commit into
mainfrom
sp-ulysses-accelerate
Open

SP ulysses native implementation#4084
SunMarc wants to merge 1 commit into
mainfrom
sp-ulysses-accelerate

Conversation

@SunMarc

@SunMarc SunMarc commented Jun 19, 2026

Copy link
Copy Markdown
Member

What does this PR do?

This PR adds a native SP implementation in accelerate so that it is compatible with FSDPv2 and deepspeed.

cc @qgallouedec for viz

wrapped = []
for obj in result:
if isinstance(obj, torch.utils.data.DataLoader) and not isinstance(obj, SequenceShardingDataLoader):
obj = SequenceShardingDataLoader(obj, shard_group, attention=self._sp_attention)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

_sp_attention is a bit ugly, this might change. lmk @winglian if you have a better design for this in order to deal with packed sequences.

@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.

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