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
eeca63a7
"deploy/vscode:/vscode.git/clone" did not exist on "da3a354eef50b77c2891fe5aa7e3de323d96e324"
Commit
eeca63a7
authored
Jun 25, 2022
by
Tri Dao
Browse files
Bug fix: wrong smem_o write pointer for d=16
parent
765741c1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
csrc/flash_attn/fmha_api.cpp
csrc/flash_attn/fmha_api.cpp
+2
-2
csrc/flash_attn/src/fmha/smem_tile.h
csrc/flash_attn/src/fmha/smem_tile.h
+2
-0
No files found.
csrc/flash_attn/fmha_api.cpp
View file @
eeca63a7
...
@@ -101,7 +101,7 @@ void set_params(Fused_multihead_attention_fprop_params ¶ms,
...
@@ -101,7 +101,7 @@ void set_params(Fused_multihead_attention_fprop_params ¶ms,
// Set this to probability of keeping an element to simplify things.
// Set this to probability of keeping an element to simplify things.
params
.
p_dropout
=
1.
f
-
p_dropout
;
params
.
p_dropout
=
1.
f
-
p_dropout
;
// Convert p from float to int so we don't have to convert the random uint to float to compare.
// Convert p from float to int so we don't have to convert the random uint to float to compare.
// [Minor] We want to round down since when we do the comparison we use <= instead <
// [Minor] We want to round down since when we do the comparison we use <= instead
of
<
params
.
p_dropout_in_uint
=
uint32_t
(
std
::
floor
(
params
.
p_dropout
*
4294967295.0
));
params
.
p_dropout_in_uint
=
uint32_t
(
std
::
floor
(
params
.
p_dropout
*
4294967295.0
));
params
.
p_dropout_in_uint16_t
=
uint16_t
(
std
::
floor
(
params
.
p_dropout
*
65535.0
));
params
.
p_dropout_in_uint16_t
=
uint16_t
(
std
::
floor
(
params
.
p_dropout
*
65535.0
));
params
.
rp_dropout
=
1.
f
/
params
.
p_dropout
;
params
.
rp_dropout
=
1.
f
/
params
.
p_dropout
;
...
...
csrc/flash_attn/src/fmha/smem_tile.h
View file @
eeca63a7
...
@@ -1204,6 +1204,8 @@ struct Smem_tile_o {
...
@@ -1204,6 +1204,8 @@ struct Smem_tile_o {
this
->
smem_write_
^=
7
*
32
;
this
->
smem_write_
^=
7
*
32
;
}
else
if
(
Mma_tile
::
MMAS_N
>=
2
)
{
}
else
if
(
Mma_tile
::
MMAS_N
>=
2
)
{
this
->
smem_write_
^=
3
*
32
;
this
->
smem_write_
^=
3
*
32
;
}
else
{
this
->
smem_write_
^=
3
*
32
;
}
}
// this->smem_write_ ^= (ni & 1) ? 7 * 32 : 3 * 32;
// this->smem_write_ ^= (ni & 1) ? 7 * 32 : 3 * 32;
// if ((threadIdx.x == 0) && (blockIdx.x == 0) && (blockIdx.y == 0)) {
// if ((threadIdx.x == 0) && (blockIdx.x == 0) && (blockIdx.y == 0)) {
...
...
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