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

can mask be supported? #30

Open
unwritten opened this issue Jan 2, 2024 · 0 comments
Open

can mask be supported? #30

unwritten opened this issue Jan 2, 2024 · 0 comments
Labels

Comments

@unwritten
Copy link

in
flash_attn_func(q, k, v, dropout_p=0.0, softmax_scale=None, causal=False):

can mask be supported before going into softmax like:

        att = att.masked_fill(mask[:, None, :, :], min_value)
        att = F.softmax(att, dim=-1, dtype=torch.float32).to(rdtype).masked_fill(mask[:, None, :, :], 0.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants