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
eff3d2d3
"...git@developer.sourcefind.cn:OpenDAS/llama-factory.git" did not exist on "358bd2a0104d3b06a39433042df9578bdbcf944c"
Commit
eff3d2d3
authored
May 20, 2022
by
turneram
Browse files
Add contiguous before reshape
parent
cd96c1c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/onnx/parse_attention.cpp
src/onnx/parse_attention.cpp
+2
-1
No files found.
src/onnx/parse_attention.cpp
View file @
eff3d2d3
...
@@ -100,11 +100,12 @@ struct parse_attention : op_parser<parse_attention>
...
@@ -100,11 +100,12 @@ struct parse_attention : op_parser<parse_attention>
auto
gemm4
=
info
.
add_instruction
(
migraphx
::
make_op
(
"dot"
),
softmax
,
v_t
);
auto
gemm4
=
info
.
add_instruction
(
migraphx
::
make_op
(
"dot"
),
softmax
,
v_t
);
// result is BxNxSxH, transpose to BxSxNxH and reshape to BxSxHiddenSize
// result is BxNxSxH, transpose to BxSxNxH and reshape to BxSxHiddenSize
// transposeCtx
gemm4
=
info
.
add_instruction
(
gemm4
=
info
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
1
,
3
}}}),
gemm4
);
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
1
,
3
}}}),
gemm4
);
return
info
.
add_instruction
(
return
info
.
add_instruction
(
make_op
(
"reshape"
,
{{
"dims"
,
{
batch_size
,
sequence_length
,
num_heads
*
head_size
}}}),
make_op
(
"reshape"
,
{{
"dims"
,
{
batch_size
,
sequence_length
,
num_heads
*
head_size
}}}),
gemm4
);
info
.
make_contiguous
(
gemm4
)
)
;
}
}
};
};
...
...
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