Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
flash-attention
Commits
45ba93cd
Commit
45ba93cd
authored
Aug 24, 2023
by
Tri Dao
Browse files
Add newlines to README
parent
9e5e8bc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
README.md
README.md
+22
-20
No files found.
README.md
View file @
45ba93cd
...
@@ -141,26 +141,28 @@ flash_attn_func(q, k, v, dropout_p=0.0, softmax_scale=None, causal=False)
...
@@ -141,26 +141,28 @@ flash_attn_func(q, k, v, dropout_p=0.0, softmax_scale=None, causal=False)
If seqlen_q != seqlen_k and causal=True, the causal mask is aligned to the
If seqlen_q != seqlen_k and causal=True, the causal mask is aligned to the
bottom right corner of the attention matrix, instead of the top-left corner.
bottom right corner of the attention matrix, instead of the top-left corner.
For example, if seqlen_q = 2 and seqlen_k = 5, the causal mask (1 = keep, 0 = masked out) is:
For example, if seqlen_q = 2 and seqlen_k = 5, the causal mask (1 = keep, 0 =
v2.0:
masked out) is:
1 0 0 0 0
v2.0:
1 1 0 0 0
1 0 0 0 0
v2.1:
1 1 0 0 0
1 1 1 1 0
v2.1:
1 1 1 1 1
1 1 1 1 0
If seqlen_q = 5 and seqlen_k = 2, the causal mask is:
1 1 1 1 1
v2.0:
1 0
If seqlen_q = 5 and seqlen_k = 2, the causal mask is:
1 1
v2.0:
1 1
1 0
1 1
1 1
1 1
1 1
v2.1:
1 1
0 0
1 1
0 0
v2.1:
0 0
0 0
1 0
0 0
1 1
0 0
1 0
1 1
If the row of the mask is all zero, the output will be zero.
If the row of the mask is all zero, the output will be zero.
## Performance
## Performance
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment