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
MIGraphX
Commits
5ded4ac1
Commit
5ded4ac1
authored
May 11, 2022
by
turneram
Browse files
Formatting
parent
988bf26b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
src/onnx/parse_attention.cpp
src/onnx/parse_attention.cpp
+1
-6
No files found.
src/onnx/parse_attention.cpp
View file @
5ded4ac1
...
@@ -155,12 +155,7 @@ struct parse_attention : op_parser<parse_attention>
...
@@ -155,12 +155,7 @@ struct parse_attention : op_parser<parse_attention>
info
.
add_instruction
(
migraphx
::
make_op
(
"mul"
),
gemm3
,
info
.
make_contiguous
(
alpha_lit
));
info
.
add_instruction
(
migraphx
::
make_op
(
"mul"
),
gemm3
,
info
.
make_contiguous
(
alpha_lit
));
// apply softmax and store result P to scratch2: BxNxSxS*
// apply softmax and store result P to scratch2: BxNxSxS*
std
::
vector
<
float
>
mask
(
batch_size
*
num_heads
*
sequence_length
*
all_sequence_length
,
0
);
// Inference mask is all 1s => masking can be skipped
if
(
false
and
mask_index_lens
.
size
()
>=
2
)
{}
else
if
(
false
and
mask_index_lens
.
size
()
==
1
)
{
}
// else => no mask
auto
softmax
=
info
.
add_instruction
(
migraphx
::
make_op
(
"softmax"
,
{{
"axis"
,
3
}}),
gemm3
);
auto
softmax
=
info
.
add_instruction
(
migraphx
::
make_op
(
"softmax"
,
{{
"axis"
,
3
}}),
gemm3
);
// compute P*V (as V*P), and store in scratch3: BxNxSxH
// compute P*V (as V*P), and store in scratch3: BxNxSxH
...
...
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