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

RF scaled_dot_product_attention #1555

Open
albertz opened this issue Jun 27, 2024 · 0 comments
Open

RF scaled_dot_product_attention #1555

albertz opened this issue Jun 27, 2024 · 0 comments

Comments

@albertz
Copy link
Member

albertz commented Jun 27, 2024

Add scaled_dot_product_attention as a function to RF, and use it in our attention code. (Does this also work with RelPosSelfAttention?)

In case of PyTorch, wrap torch.nn.functional.scaled_dot_product_attention. That should be much more compute and memory efficient compared to the direct implementation. It uses FlashAttention or potentially a number of other efficient kernels. (Although on older GPUs, probably not. See my question on PyTorch discussion forum.)

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

No branches or pull requests

1 participant