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

Improve argument validation for Flash-attn + SWA #1162

Merged
merged 8 commits into from
Mar 2, 2024

Conversation

haileyschoelkopf
Copy link
Contributor

@haileyschoelkopf haileyschoelkopf commented Feb 29, 2024

As raised by @malteos , Flash attention requires not 2.0.0+ but version 2.3.0+ to support sliding_window_width. However also, sliding-window attention is supported in the absence of Flash.

This PR changes the argument validation to 1) check for version 2.3.0 and 2) only perform this check if "flash" type attention is used. Also, it doesn't pass window_size kwarg when not required, meaning we'll never give the invalid kwarg to flash versions < 2.3.0 .

@haileyschoelkopf
Copy link
Contributor Author

haileyschoelkopf commented Feb 29, 2024

image
Also updates Mistral config with seqlen info following https://discord.com/channels/1144547040454508606/1144547040928481394/1156616342682751087 .

@haileyschoelkopf haileyschoelkopf marked this pull request as ready for review March 1, 2024 14:48
@haileyschoelkopf
Copy link
Contributor Author

Ready for review!

Copy link
Member

@Quentin-Anthony Quentin-Anthony left a comment

Choose a reason for hiding this comment

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

LGTM

@Quentin-Anthony Quentin-Anthony merged commit 19596b0 into main Mar 2, 2024
2 checks passed
@Quentin-Anthony Quentin-Anthony deleted the fix-swa-versioncheck branch March 2, 2024 22:22
KidiIT

This comment was marked as spam.

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.

None yet

3 participants