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
fc093b02
Commit
fc093b02
authored
Dec 03, 2023
by
Umang Yadav
Browse files
formatting
parent
119a6b86
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
26 deletions
+21
-26
src/targets/gpu/fuse_mlir.cpp
src/targets/gpu/fuse_mlir.cpp
+7
-4
test/verify/quant_conv_2.cpp
test/verify/quant_conv_2.cpp
+0
-2
test/verify/test_conv.cpp
test/verify/test_conv.cpp
+1
-1
test/verify/test_conv2.cpp
test/verify/test_conv2.cpp
+2
-4
test/verify/test_conv_add.cpp
test/verify/test_conv_add.cpp
+3
-3
test/verify/test_conv_add_relu.cpp
test/verify/test_conv_add_relu.cpp
+4
-6
test/verify/test_conv_bn.cpp
test/verify/test_conv_bn.cpp
+1
-1
test/verify/test_conv_bn_add.cpp
test/verify/test_conv_bn_add.cpp
+1
-1
test/verify/test_conv_pooling.cpp
test/verify/test_conv_pooling.cpp
+2
-4
No files found.
src/targets/gpu/fuse_mlir.cpp
View file @
fc093b02
...
...
@@ -333,7 +333,8 @@ bool is_pointwise_op_supported_by_mlir(const instruction& i)
"softmax"
,
"tanh"
,
};
bool
is_float
=
contains
({
type_t
::
float_type
,
type_t
::
half_type
,
type_t
::
fp8e4m3fnuz_type
},
result_type
);
bool
is_float
=
contains
({
type_t
::
float_type
,
type_t
::
half_type
,
type_t
::
fp8e4m3fnuz_type
},
result_type
);
if
(
contains
(
any_type_ops
,
name
))
return
true
;
if
(
result_type
!=
type_t
::
bool_type
and
contains
(
no_bool_ops
,
name
))
...
...
@@ -412,8 +413,10 @@ struct find_mlir_standalone_op
auto
gemm_based_op
=
r
.
result
;
// enable only for fp32/fp16/i8/fp8 types
if
(
std
::
any_of
(
gemm_based_op
->
inputs
().
begin
(),
gemm_based_op
->
inputs
().
end
(),
[
&
](
auto
i
)
{
return
not
contains
(
{
shape
::
type_t
::
float_type
,
shape
::
type_t
::
half_type
,
shape
::
type_t
::
int8_type
,
shape
::
type_t
::
fp8e4m3fnuz_type
},
return
not
contains
({
shape
::
type_t
::
float_type
,
shape
::
type_t
::
half_type
,
shape
::
type_t
::
int8_type
,
shape
::
type_t
::
fp8e4m3fnuz_type
},
i
->
get_shape
().
type
());
}))
return
;
...
...
test/verify/quant_conv_2.cpp
View file @
fc093b02
...
...
@@ -45,5 +45,3 @@ struct quant_conv_2 : verify_program<quant_conv_2<DType>>
template
struct
quant_conv_2
<
migraphx
::
shape
::
int8_type
>;
template
struct
quant_conv_2
<
migraphx
::
shape
::
fp8e4m3fnuz_type
>;
test/verify/test_conv.cpp
View file @
fc093b02
test/verify/test_conv2.cpp
View file @
fc093b02
...
...
@@ -34,10 +34,8 @@ struct test_conv2 : verify_program<test_conv2<DType>>
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
DType
,
{
1
,
512
,
28
,
28
}});
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
DType
,
{
256
,
512
,
1
,
1
}});
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
DType
,
{
1
,
512
,
28
,
28
}});
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
DType
,
{
256
,
512
,
1
,
1
}});
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
1
,
1
}},
{
"dilation"
,
{
1
,
1
}}}),
...
...
test/verify/test_conv_add.cpp
View file @
fc093b02
test/verify/test_conv_add_relu.cpp
View file @
fc093b02
...
...
@@ -35,12 +35,10 @@ struct test_conv_add_relu : verify_program<test_conv_add_relu<DType>>
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
3
,
3
}});
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
3
,
3
}});
auto
bias_literal
=
migraphx
::
literal
{
migraphx
::
shape
{
DType
,
{
4
}},
{
2.0
f
,
2.0
f
,
2.0
f
,
2.0
f
}};
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
3
,
3
}});
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
3
,
3
}});
auto
bias_literal
=
migraphx
::
literal
{
migraphx
::
shape
{
DType
,
{
4
}},
{
2.0
f
,
2.0
f
,
2.0
f
,
2.0
f
}};
auto
bias
=
mm
->
add_literal
(
bias_literal
);
auto
conv
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
input
,
weights
);
auto
bcast_bias
=
mm
->
add_instruction
(
...
...
test/verify/test_conv_bn.cpp
View file @
fc093b02
test/verify/test_conv_bn_add.cpp
View file @
fc093b02
test/verify/test_conv_pooling.cpp
View file @
fc093b02
...
...
@@ -35,10 +35,8 @@ struct test_conv_pooling : verify_program<test_conv_pooling<DType>>
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
32
,
32
}});
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
3
,
3
}});
auto
input
=
mm
->
add_parameter
(
"x"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
32
,
32
}});
auto
weights
=
mm
->
add_parameter
(
"w"
,
migraphx
::
shape
{
DType
,
{
4
,
3
,
3
,
3
}});
auto
conv
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
input
,
weights
);
auto
pooling
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
}}),
conv
);
...
...
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