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
5a2b89fc
Commit
5a2b89fc
authored
Aug 12, 2022
by
turneram
Browse files
Only apply to bs>1; wip fuse dot add
parent
ab236eec
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
32 deletions
+49
-32
src/simplify_algebra.cpp
src/simplify_algebra.cpp
+49
-32
No files found.
src/simplify_algebra.cpp
View file @
5a2b89fc
...
@@ -802,6 +802,9 @@ struct find_conv_dot_horiz_fusion
...
@@ -802,6 +802,9 @@ struct find_conv_dot_horiz_fusion
int
axis
=
1
;
int
axis
=
1
;
int
concat_axis
=
0
;
int
concat_axis
=
0
;
if
(
name
==
"dot"
)
if
(
name
==
"dot"
)
{
std
::
cout
<<
ins
->
get_shape
().
lens
().
front
()
<<
std
::
endl
;
if
(
ins
->
get_shape
().
lens
().
front
()
>
1
)
{
{
axis
=
int
(
args
.
front
()
->
get_shape
().
lens
().
size
()
-
1
);
axis
=
int
(
args
.
front
()
->
get_shape
().
lens
().
size
()
-
1
);
concat_axis
=
axis
-
1
;
concat_axis
=
axis
-
1
;
...
@@ -822,8 +825,15 @@ struct find_conv_dot_horiz_fusion
...
@@ -822,8 +825,15 @@ struct find_conv_dot_horiz_fusion
input
);
input
);
auto
fused
=
m
.
insert_instruction
(
std
::
next
(
reshape
),
op
,
reshape
,
concat
);
auto
fused
=
m
.
insert_instruction
(
std
::
next
(
reshape
),
op
,
reshape
,
concat
);
int64_t
offset
=
0
;
int64_t
offset
=
0
;
std
::
vector
<
instruction_ref
>
add_args
;
instruction_ref
next_ins
;
for
(
auto
arg
:
range
(
start
,
last
))
for
(
auto
arg
:
range
(
start
,
last
))
{
{
auto
aarg
=
std
::
next
(
std
::
next
(
arg
));
while
(
aarg
->
name
()
!=
"add"
)
aarg
=
std
::
next
(
aarg
);
aarg
->
debug_print
();
add_args
.
push_back
(
aarg
->
inputs
().
front
());
fused
=
m
.
insert_instruction
(
fused
=
m
.
insert_instruction
(
std
::
next
(
fused
),
std
::
next
(
fused
),
make_op
(
"reshape"
,
make_op
(
"reshape"
,
...
@@ -837,9 +847,16 @@ struct find_conv_dot_horiz_fusion
...
@@ -837,9 +847,16 @@ struct find_conv_dot_horiz_fusion
fused
);
fused
);
offset
+=
len
;
offset
+=
len
;
}
}
m
.
debug_print
();
return
;
return
;
}
}
else
{
axis
=
int
(
args
.
front
()
->
get_shape
().
lens
().
size
()
-
1
);
concat_axis
=
axis
;
}
}
for
(
auto
arg
:
args
)
for
(
auto
arg
:
args
)
m
.
move_instructions
(
arg
,
input
);
m
.
move_instructions
(
arg
,
input
);
...
...
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