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

[Relay][Pytorch] Add support for aten::scaled_dot_product_attention #16143

Merged
merged 5 commits into from
Nov 29, 2023

Conversation

mshr-h
Copy link
Contributor

@mshr-h mshr-h commented Nov 17, 2023

@mshr-h mshr-h force-pushed the pytorch-sdpa branch 2 times, most recently from 3b150c7 to e195703 Compare November 28, 2023 10:39
@mshr-h mshr-h changed the title [WIP] [Relay][Pytorch] Add support for aten::scaled_dot_product_attention [Relay][Pytorch] Add support for aten::scaled_dot_product_attention Nov 29, 2023
@mshr-h mshr-h marked this pull request as ready for review November 29, 2023 09:06
@github-actions github-actions bot requested review from Hzfengsy and masahi November 29, 2023 09:08
@masahi masahi merged commit 97ddd66 into apache:main Nov 29, 2023
20 of 21 checks passed
@mshr-h mshr-h deleted the pytorch-sdpa branch November 30, 2023 01:37
@HPC4AI
Copy link

HPC4AI commented Dec 28, 2023

May I ask which version of tvm I need to use and how to use tvm to accelerate the sdpa operator?

Fix #15361 Support torch.nn.functional.scaled_dot_product_attention and torch.nn.Transformer. cc @jikechao @vvchernov @Hzfengsy @masahi

@mshr-h
Copy link
Contributor Author

mshr-h commented Jan 9, 2024

@FuncJ
You need v0.15 which will be released on Jan 22. #16277

@yogurfrul
Copy link
Contributor

yogurfrul commented Jul 16, 2024

I worked on torch2.1. The testcase verify_model(test_fn(), [query_4d, key_3d, value_4d]) got error as below:
IndexError: Dimension out of range (expected to be in range of [-3, 2], but got 3)

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.

[FRONTEND][PYTORCH] Relay pytorch frontend does not support aten:scaled_dot_product_attention
4 participants