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
d9a5cb29
Commit
d9a5cb29
authored
Feb 10, 2024
by
Tri Dao
Browse files
Fix dv = torch::empty_like(k) for mha_bwd_varlen as well
parent
a190df01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
csrc/flash_attn/flash_api.cpp
csrc/flash_attn/flash_api.cpp
+1
-1
No files found.
csrc/flash_attn/flash_api.cpp
View file @
d9a5cb29
...
@@ -1069,7 +1069,7 @@ mha_varlen_bwd(const at::Tensor &dout, // total_q x num_heads, x head_size
...
@@ -1069,7 +1069,7 @@ mha_varlen_bwd(const at::Tensor &dout, // total_q x num_heads, x head_size
TORCH_CHECK
(
dv
.
stride
(
-
1
)
==
1
,
"dv must have contiguous last dimension"
);
TORCH_CHECK
(
dv
.
stride
(
-
1
)
==
1
,
"dv must have contiguous last dimension"
);
CHECK_SHAPE
(
dv
,
total_k
,
num_heads_k
,
head_size
);
CHECK_SHAPE
(
dv
,
total_k
,
num_heads_k
,
head_size
);
}
else
{
}
else
{
dv
=
torch
::
empty_like
(
k
);
dv
=
torch
::
empty_like
(
v
);
}
}
at
::
Tensor
dout_padded
;
at
::
Tensor
dout_padded
;
...
...
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