Skip to content

gqa added to mpt attn #1938

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

Merged
merged 4 commits into from
Dec 12, 2023
Merged

Conversation

megha95
Copy link
Contributor

@megha95 megha95 commented Dec 5, 2023

mpt.py modified to support GQA in MPTAttention

@WoosukKwon WoosukKwon self-requested a review December 5, 2023 19:17
@WoosukKwon
Copy link
Collaborator

@megha95 Thanks for submitting the PR! Just a quick question: Which MPT model uses GQA?

@megha95
Copy link
Contributor Author

megha95 commented Dec 6, 2023

@WoosukKwon some of our customers want to try serving MPT with GQA. And, so this PR will help us enable it.

@WoosukKwon WoosukKwon self-assigned this Dec 7, 2023
Comment on lines 144 to 145
if self.num_kv_heads != self.num_heads:
input_metadata.attn_bias._bias = input_metadata.attn_bias._bias.unflatten(1, (self.num_kv_heads, self.num_queries_per_kv))
Copy link
Collaborator

Choose a reason for hiding this comment

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

@megha95 Could you elaborate more on this case? I think the current RoPE-based GQA models do not need this. Is this for GQA + ALiBi?

Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

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

LGTM. I fixed attention.py so that the change does not affect non-ALiBi models. Thanks for submitting the PR!

@WoosukKwon WoosukKwon merged commit 6428f1d into vllm-project:main Dec 12, 2023
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
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.

2 participants