Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@le1nux
Copy link
Member

@le1nux le1nux commented Aug 1, 2025

What does this PR do?

This PR fixe an issue that occurs when using SwiGLU in a FSDP2 + TP combination.
Since the hidden dim is computed dynamically to compensate for the difference in the number of trainable weights in comparison to GeLU, we end up with hidden dims that are not a multiple of the world size.

This in return creates a problem when applying TP and subsequently FSDP2, as uneven sharding is not allowed for FSDP2 + TP (yet). The issue does not occur when only using FSDP2, as FSDP2 already support uneven sharding out of the box.

General Changes

  • ..

Breaking Changes

  • ..

Checklist before submitting final PR

  • My PR is minimal and addresses one issue in isolation
  • [] I have merged the latest version of the target branch into this feature branch
  • I have reviewed my own code w.r.t. correct implementation, missing type hints, proper documentation, etc.
  • I have run a sample config for model training
  • I have checked that all tests run through (python tests/tests.py)
  • I have updated the internal changelog (CHANGELOG_DEV.md)

@le1nux le1nux requested a review from fromm-m August 1, 2025 13:28
@le1nux le1nux changed the base branch from main to benchmark_tooling August 1, 2025 13:28
Copy link
Member

@fromm-m fromm-m left a comment

Choose a reason for hiding this comment

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

LGTM

@le1nux le1nux merged commit 1563b9e into benchmark_tooling Aug 6, 2025
4 checks passed
@le1nux le1nux deleted the tp_swiglu_hidden_dim_fix branch August 6, 2025 21:42
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.