8000 flash_attn_func does not support padding mask maybe we need to drop a… by vince62s · Pull Request #149 · eole-nlp/eole · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

flash_attn_func does not support padding mask maybe we need to drop a… #149

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

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eole/modules/multi_headed_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ def _compute_attention(
causal = self.is_decoder and attn_type == "self" and mask is not None
# keeping this (vs sdpa below) only because it handles windows_size
# also flash_attn_func does not support pad mask so not for encoder not for context attn
if self.flash and self.is_decoder and attn_type == "self":
# adding b == 1 as a condition to avoid padded cases in decoder only
if self.flash and b == 1 and self.is_decoder and attn_type == "self":
window_size = (
(-1, -1)
if sliding_window == 0 or not causal
Expand Down
Loading
0