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

[Feature request] attn_mask support #119

Open
junjie18 opened this issue Feb 5, 2023 · 3 comments
Open

[Feature request] attn_mask support #119

junjie18 opened this issue Feb 5, 2023 · 3 comments

Comments

@junjie18
Copy link

junjie18 commented Feb 5, 2023

Hi, thanks for your great work.
Would you be willing to support attn_mask in flash attention. Since Query Denoise[1, 2] seems to be a common practice in Computer Vision tasks.

[1] Li F, Zhang H, Liu S, et al. Dn-detr: Accelerate detr training by introducing query denoising
[2] Zhang H, Li F, Liu S, et al. Dino: Detr with improved denoising anchor boxes for end-to-end object detection

@tridao
Copy link
Contributor

tridao commented Feb 5, 2023

The Triton implementation in this repo supports attention bias.
However it's an experimental feature, as I sometimes see race conditions (due to the Triton compiler) in the backward pass with attention bias.
The Triton team has just rewritten their backend so things might be more stable, but I haven't tried.

@vadimkantorov
Copy link

vadimkantorov commented Jun 15, 2023

@tridao also perf-wise, how does Triton impl compare to your custom cutlass impl? are there any recent evidence on the backward issues solved in more recent tritons?

@tridao
Copy link
Contributor

tridao commented Jun 15, 2023

Speed should be around the same.
Idk about recent triton versions, I haven't had the time to test.

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

3 participants