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

[Unity][Frontend][NN] Add diffusers style Attention layer #15609

Merged
merged 5 commits into from
Aug 26, 2023

Conversation

jwfromm
Copy link
Contributor

@jwfromm jwfromm commented Aug 23, 2023

This PR adds support for the Attention layer in the nn module API. This layer mimics the behavior of the Attention layer used in huggingface Diffusers. Under the hood it uses scaled dot product attention. Notably, there are still some missing features. For example I didnt add support for attention masks yet. I also am assuming 3 dimensional inputs so this likely wouldnt be useful for the VAE of stable diffusion. However, it does allow us to represent the all attention layers of the UNET. I'm hoping we can expand on the functionality more if needed in future PRs.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Aug 23, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@jwfromm jwfromm changed the title [Unity][Frontend][NN] Add diffusers like Attention layer [Unity][Frontend][NN] Add diffusers style Attention layer Aug 23, 2023
@Hzfengsy
Copy link
Member

cc @junrushao @cyx-6

@jwfromm jwfromm requested a review from cyx-6 August 24, 2023 15:39
Copy link
Contributor

@LeshengJin LeshengJin left a comment

Choose a reason for hiding this comment

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

Attention is all you need! Thanks, @jwfromm

@junrushao junrushao merged commit d5dcabf into apache:unity Aug 26, 2023
1 check passed
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.

5 participants