Skip to content

Conversation

@roychan
Copy link

@roychan roychan commented Nov 2, 2025

What does this PR do?

This PR fixes the logic in setting self.fsdp in _process_fsdp_args in src/transformers/training_args.py. In the original logic, when self.fsdp is False, it will not be converted to list, and cause the later logic below failed because self.fsdp is a boolean (False).

FSDPOption.FULL_SHARD in self.fsdp and FSDPOption.SHARD_GRAD_OP in self.fsdp:

This diff fixes it by initializing it to list.

Who can review?

@SunMarc

Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

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

Thanks for spotting this ! In which cases fsdp is set to False automatically ? Maybe we can fix that also

@HuggingFaceDocBuilderDev

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.

@roychan
Copy link
Author

roychan commented Nov 5, 2025

Thanks for spotting this ! In which cases fsdp is set to False automatically ? Maybe we can fix that also

Thank you for reviewing the change. It was set in my code base (outside transformers) and I have it fixed (set to None) already.

@roychan roychan closed this Nov 5, 2025
@roychan roychan reopened this Nov 5, 2025
@SunMarc SunMarc enabled auto-merge (squash) November 5, 2025 10:41
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.

3 participants