Skip to content

Conversation

jinhongyii
Copy link
Member

No description provided.

@junrushao
Copy link
Member

CC @masahi as the original author of this optimization :)


return split_rotary

def get_split_rotary_group_query_attention(num_query_heads, num_kv_heads, head_dim, position_embedding_base):
Copy link
Member

Choose a reason for hiding this comment

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

I’m wondering if we can merge the two get_split_rotary into one.

Copy link
Member Author

@jinhongyii jinhongyii Sep 19, 2023

Choose a reason for hiding this comment

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

We fuse split rotary of GQA into 2 kernels because of num_heads are different, while split rotary of non-GQA is fused into 1 kernel. So let's keep them as different function

@masahi
Copy link
Contributor

masahi commented Sep 19, 2023

nice, does a big model that use MQA / GQA benefit from this pass? The speed up for 13B was much smaller than 7B when I tested.

@jinhongyii
Copy link
Member Author

llama2 70b uses GQA. Indeed the speed up is small. Only 2% I observed

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.

4 participants