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
e17fb984
Commit
e17fb984
authored
Dec 06, 2018
by
Khalique
Browse files
initial progress on group conv
parent
84e7335e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
src/include/migraphx/operators.hpp
src/include/migraphx/operators.hpp
+4
-3
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+4
-0
src/targets/gpu/include/migraphx/gpu/miopen.hpp
src/targets/gpu/include/migraphx/gpu/miopen.hpp
+6
-1
No files found.
src/include/migraphx/operators.hpp
View file @
e17fb984
...
@@ -63,6 +63,7 @@ struct convolution
...
@@ -63,6 +63,7 @@ struct convolution
valid
valid
};
};
padding_mode_t
padding_mode
=
default_
;
padding_mode_t
padding_mode
=
default_
;
int
group
=
1
;
template
<
class
Self
,
class
F
>
template
<
class
Self
,
class
F
>
static
auto
reflect
(
Self
&
self
,
F
f
)
static
auto
reflect
(
Self
&
self
,
F
f
)
...
@@ -86,7 +87,7 @@ struct convolution
...
@@ -86,7 +87,7 @@ struct convolution
return
{
t
,
return
{
t
,
{
{
input
.
lens
()[
0
],
input
.
lens
()[
0
],
weights
.
lens
()[
0
],
weights
.
lens
()[
0
]
*
group
,
std
::
size_t
(
std
::
max
<
std
::
ptrdiff_t
>
(
std
::
size_t
(
std
::
max
<
std
::
ptrdiff_t
>
(
1
,
1
,
(
input
.
lens
()[
2
]
-
(
1
+
dilation
[
0
]
*
(
weights
.
lens
()[
2
]
-
1
))
+
(
input
.
lens
()[
2
]
-
(
1
+
dilation
[
0
]
*
(
weights
.
lens
()[
2
]
-
1
))
+
...
@@ -105,7 +106,7 @@ struct convolution
...
@@ -105,7 +106,7 @@ struct convolution
{
{
return
{
t
,
return
{
t
,
{
input
.
lens
()[
0
],
{
input
.
lens
()[
0
],
weights
.
lens
()[
0
],
weights
.
lens
()[
0
]
*
group
,
static_cast
<
std
::
size_t
>
(
static_cast
<
std
::
size_t
>
(
std
::
ceil
(
static_cast
<
double
>
(
input
.
lens
()[
2
])
/
stride
[
0
])),
std
::
ceil
(
static_cast
<
double
>
(
input
.
lens
()[
2
])
/
stride
[
0
])),
static_cast
<
std
::
size_t
>
(
static_cast
<
std
::
size_t
>
(
...
@@ -116,7 +117,7 @@ struct convolution
...
@@ -116,7 +117,7 @@ struct convolution
return
{
return
{
t
,
t
,
{
input
.
lens
()[
0
],
{
input
.
lens
()[
0
],
weights
.
lens
()[
0
],
weights
.
lens
()[
0
]
*
group
,
static_cast
<
std
::
size_t
>
(
std
::
ceil
(
static_cast
<
std
::
size_t
>
(
std
::
ceil
(
static_cast
<
double
>
(
input
.
lens
()[
2
]
-
weights
.
lens
()[
2
]
+
1
)
/
stride
[
0
])),
static_cast
<
double
>
(
input
.
lens
()[
2
]
-
weights
.
lens
()[
2
]
+
1
)
/
stride
[
0
])),
static_cast
<
std
::
size_t
>
(
std
::
ceil
(
static_cast
<
std
::
size_t
>
(
std
::
ceil
(
...
...
src/onnx/onnx.cpp
View file @
e17fb984
...
@@ -220,6 +220,10 @@ struct onnx_parser
...
@@ -220,6 +220,10 @@ struct onnx_parser
op
.
padding_mode
=
op
::
convolution
::
same
;
op
.
padding_mode
=
op
::
convolution
::
same
;
}
}
}
}
if
(
contains
(
attributes
,
"group"
))
{
op
.
group
=
parse_value
(
attributes
.
at
(
"group"
)).
at
<
int
>
();
}
if
(
args
.
size
()
==
3
)
if
(
args
.
size
()
==
3
)
{
{
uint64_t
axis
=
1
;
uint64_t
axis
=
1
;
...
...
src/targets/gpu/include/migraphx/gpu/miopen.hpp
View file @
e17fb984
...
@@ -54,14 +54,19 @@ inline tensor_descriptor make_tensor(const migraphx::shape& s)
...
@@ -54,14 +54,19 @@ inline tensor_descriptor make_tensor(const migraphx::shape& s)
inline
convolution_descriptor
make_conv
(
const
migraphx
::
op
::
convolution
&
op
)
inline
convolution_descriptor
make_conv
(
const
migraphx
::
op
::
convolution
&
op
)
{
{
auto
c
=
make_obj
<
convolution_descriptor
>
(
&
miopenCreateConvolutionDescriptor
);
auto
c
=
make_obj
<
convolution_descriptor
>
(
&
miopenCreateConvolutionDescriptor
);
miopenConvolutionMode_t
c_mode
=
miopenConvolution
;
if
(
op
.
group
>
1
)
c_mode
=
miopenGroupConv
;
miopenInitConvolutionDescriptor
(
c
.
get
(),
miopenInitConvolutionDescriptor
(
c
.
get
(),
miopenConvolution
,
c_mode
,
op
.
padding
[
0
],
op
.
padding
[
0
],
op
.
padding
[
1
],
op
.
padding
[
1
],
op
.
stride
[
0
],
op
.
stride
[
0
],
op
.
stride
[
1
],
op
.
stride
[
1
],
op
.
dilation
[
0
],
op
.
dilation
[
0
],
op
.
dilation
[
1
]);
op
.
dilation
[
1
]);
if
(
op
.
group
>
1
)
miopenSetConvolutionGroupCount
(
c
.
get
(),
op
.
group
);
return
c
;
return
c
;
}
}
...
...
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