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

Fix plamo2 model to use rms_norm #1308

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mitmul
Copy link
Contributor

@mitmul mitmul commented Feb 27, 2025

Thank you for fixing my messy code in #1283. However, it seems that some parts of the model code have changed, leading to slightly different behavior from the original. This PR aims at fixing it.

@mitmul
Copy link
Contributor Author

mitmul commented Feb 27, 2025

I removed the redundant parts of the code because, as mentioned in the comment here, sliding window attention should be implemented using RotatingKVCache rather than being directly incorporated into the model code.

But I still see some differences between MLX's layer norm and the _rms_norm func in the plamo2 modeling code as shown in this comment: #1283 (comment)

@mitmul mitmul changed the title Fix plamo2 model to use rms_norm and enable sliding window attention Fix plamo2 model to use rms_norm Feb 27, 2025
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.

1 participant