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
a4178130
Commit
a4178130
authored
Oct 15, 2018
by
Paul
Browse files
Enable miopen fusions
parent
acd4e0fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+12
-4
No files found.
src/targets/gpu/fuse_ops.cpp
View file @
a4178130
...
@@ -131,7 +131,15 @@ MIGRAPH_PRED_MATCHER(fusable_conv, instruction_ref ins)
...
@@ -131,7 +131,15 @@ MIGRAPH_PRED_MATCHER(fusable_conv, instruction_ref ins)
{
{
if
(
ins
->
name
()
!=
"gpu::convolution"
)
if
(
ins
->
name
()
!=
"gpu::convolution"
)
return
false
;
return
false
;
auto
op
=
any_cast
<
miopen_convolution
>
(
ins
->
get_operator
()).
op
;
auto
wei
=
ins
->
inputs
().
at
(
1
)
->
get_shape
();
assert
(
wei
.
lens
().
size
()
==
4
);
auto
channels
=
wei
.
lens
()[
1
]
*
wei
.
lens
()[
0
];
if
(
wei
.
lens
()[
0
]
>
64
and
channels
>
32768
)
return
false
;
auto
conv
=
any_cast
<
miopen_convolution
>
(
ins
->
get_operator
());
if
(
conv
.
algo
==
miopenConvolutionFwdAlgoWinograd
)
return
false
;
auto
op
=
conv
.
op
;
return
op
.
padding
==
make_array
<
size_t
>
(
0
,
0
)
and
op
.
stride
==
make_array
<
size_t
>
(
1
,
1
)
and
return
op
.
padding
==
make_array
<
size_t
>
(
0
,
0
)
and
op
.
stride
==
make_array
<
size_t
>
(
1
,
1
)
and
op
.
dilation
==
make_array
<
size_t
>
(
1
,
1
);
op
.
dilation
==
make_array
<
size_t
>
(
1
,
1
);
}
}
...
@@ -366,10 +374,10 @@ struct match_conv_bias_relu
...
@@ -366,10 +374,10 @@ struct match_conv_bias_relu
void
fuse_ops
::
apply
(
program
&
p
)
const
void
fuse_ops
::
apply
(
program
&
p
)
const
{
{
// clang-format off
// clang-format off
match
::
find_matches
(
p
,
match_triadd
{});
match
::
find_matches
(
p
,
match
::
find_matches
(
p
,
match_triadd
{},
match_conv_bias_relu
{
ctx
},
// match_conv_bias_relu{ctx},
match_conv_bias
{
ctx
},
// match_conv_bias{ctx},
match_add_relu
{}
match_add_relu
{}
);
);
// clang-format on
// clang-format on
...
...
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