Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Hidden Dimension Configurable For SwiGLU #289

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

mali-git
Copy link
Member

@mali-git mali-git commented Jan 13, 2025

What does this PR do?

This PR introduces a change to the SwiGLU activation by making the hidden dimension configurable. Previously, the hidden dimension was fixed (4 * n_embd), limiting flexibility in customizing the model architecture especially when using group query attention. This update enhances the usability of SwiGLU by allowing users to specify a custom hidden dimension during initialization.

General Changes

  • Add ffn_hidden to the SwiGLU module.

Breaking Changes

  • None

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)

@mali-git mali-git requested a review from fromm-m January 13, 2025 12:13
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

Copy link
Member

@le1nux le1nux left a comment

Choose a reason for hiding this comment

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

LGTM :)

@mali-git mali-git merged commit e0b4274 into main Jan 13, 2025
3 checks passed
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