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

Adding attention_reshape (inference only) kernels. #497

Merged
merged 3 commits into from
Feb 28, 2023

Conversation

Narsil
Copy link
Contributor

@Narsil Narsil commented Feb 26, 2023

Tried to implement cat but there were some weird issues, and it was
causing a ton of kernels being called, with each some device to host sync (huge bottleneck).

This PR adds a pretty specific reshape for (qkv, past_key, past_value) useful for
inference run of transformer models. For instance gpt2 (https://github.com/Narsil/fast_gpt2)

@Narsil
Copy link
Contributor Author

Narsil commented Feb 27, 2023

@coreylowman

Copy link
Owner

@coreylowman coreylowman left a comment

Choose a reason for hiding this comment

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

Nice contribution, thanks! 🚀

@coreylowman coreylowman merged commit 1d8d20a into coreylowman:main Feb 28, 2023
@Narsil Narsil deleted the attention_reshape branch February 28, 2023 14:27
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