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
f17d6246
Commit
f17d6246
authored
Dec 03, 2022
by
Paul
Browse files
Merge branch 'develop' into ck-gemm-fused
parents
87673e1b
fdc3f00a
Changes
23
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
657 additions
and
334 deletions
+657
-334
test/onnx/transpose_dyn_test.onnx
test/onnx/transpose_dyn_test.onnx
+0
-0
test/op_shape_test.cpp
test/op_shape_test.cpp
+122
-3
test/ref_ops_test.cpp
test/ref_ops_test.cpp
+535
-331
No files found.
test/onnx/transpose_dyn_test.onnx
0 → 100644
View file @
f17d6246
File added
test/op_shape_test.cpp
View file @
f17d6246
...
@@ -1549,16 +1549,76 @@ TEST_CASE(nms_shape)
...
@@ -1549,16 +1549,76 @@ TEST_CASE(nms_shape)
score_thres_s
);
score_thres_s
);
}
}
TEST_CASE
(
pooling_shape
)
TEST_CASE
(
pooling_shape
0
)
{
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}};
throws_shape
(
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
1
}},
{
"stride"
,
{
0
}},
{
"lengths"
,
{
1
}}}),
input
);
}
TEST_CASE
(
pooling_shape1
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
1
,
1
}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
1
,
1
}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
3
,
3
}},
{
"lengths"
,
{
1
,
1
}}}),
input
);
}
TEST_CASE
(
pooling_shape2
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
2
,
2
}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
3
,
3
}},
{
"lengths"
,
{
1
,
1
}},
{
"ceil_mode"
,
true
}}),
input
);
}
TEST_CASE
(
pooling_shape3
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}};
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
3
,
3
}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
2
,
2
}},
{
"stride"
,
{
3
,
3
}},
{
"lengths"
,
{
3
,
3
}},
{
"ceil_mode"
,
true
}}),
input
);
}
TEST_CASE
(
pooling_dyn_shape0
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
3
,
3
,
3
},
{
3
,
3
,
3
},
{
3
,
3
,
0
}}};
throws_shape
(
migraphx
::
make_op
(
"pooling"
,
throws_shape
(
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
1
}},
{
"padding"
,
{
1
}},
{
"stride"
,
{
0
}},
{
"stride"
,
{
0
}},
{
"lengths"
,
{
1
}}}),
{
"lengths"
,
{
1
}}}),
input
);
input
);
}
TEST_CASE
(
pooling_dyn_shape1
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
3
,
3
,
3
},
{
3
,
3
,
3
},
{
3
,
3
,
0
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
3
,
3
,
3
},
{
1
,
1
,
1
},
{
1
,
1
,
0
}}};
expect_shape
(
output
,
expect_shape
(
output
,
migraphx
::
make_op
(
"pooling"
,
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
...
@@ -1566,9 +1626,15 @@ TEST_CASE(pooling_shape)
...
@@ -1566,9 +1626,15 @@ TEST_CASE(pooling_shape)
{
"stride"
,
{
3
,
3
}},
{
"stride"
,
{
3
,
3
}},
{
"lengths"
,
{
1
,
1
}}}),
{
"lengths"
,
{
1
,
1
}}}),
input
);
input
);
}
migraphx
::
shape
output1
{
migraphx
::
shape
::
float_type
,
{
4
,
3
,
2
,
2
}};
TEST_CASE
(
pooling_dyn_shape2
)
expect_shape
(
output1
,
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
5
,
5
,
0
},
{
3
,
3
,
3
},
{
3
,
3
,
0
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
5
,
5
,
0
},
{
2
,
2
,
2
},
{
2
,
2
,
0
}}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pooling"
,
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
0
,
0
}},
{
"padding"
,
{
0
,
0
}},
...
@@ -1578,6 +1644,37 @@ TEST_CASE(pooling_shape)
...
@@ -1578,6 +1644,37 @@ TEST_CASE(pooling_shape)
input
);
input
);
}
}
TEST_CASE
(
pooling_dyn_shape3
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
4
,
4
,
0
},
{
3
,
3
,
0
},
{
4
,
12
,
8
},
{
4
,
12
,
8
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
4
,
4
,
0
},
{
3
,
3
,
0
},
{
2
,
4
,
3
},
{
2
,
4
,
3
}}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
0
,
0
}},
{
"stride"
,
{
3
,
3
}},
{
"lengths"
,
{
1
,
1
}}}),
input
);
}
TEST_CASE
(
pooling_dyn_shape4
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
4
,
4
,
0
},
{
3
,
3
,
0
},
{
4
,
12
,
8
},
{
4
,
12
,
8
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
4
,
4
,
0
},
{
3
,
3
,
0
},
{
3
,
6
,
4
},
{
3
,
6
,
4
}}};
expect_shape
(
output
,
migraphx
::
make_op
(
"pooling"
,
{{
"mode"
,
migraphx
::
op
::
pooling_mode
::
max
},
{
"padding"
,
{
2
,
2
}},
{
"stride"
,
{
3
,
3
}},
{
"lengths"
,
{
3
,
3
}},
{
"ceil_mode"
,
true
}}),
input
);
}
TEST_CASE
(
prefix_scan_sum
)
TEST_CASE
(
prefix_scan_sum
)
{
{
{
{
...
@@ -2226,6 +2323,28 @@ TEST_CASE(transpose_shape)
...
@@ -2226,6 +2323,28 @@ TEST_CASE(transpose_shape)
throws_shape
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
1
,
2
}}}),
input
);
throws_shape
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
1
,
2
}}}),
input
);
}
}
TEST_CASE
(
transpose_dyn_shape0
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
2
,
2
,
0
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
2
,
2
,
0
},
{
1
,
4
,
0
}}};
expect_shape
(
input
,
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
1
}}}),
input
);
expect_shape
(
output
,
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
1
,
0
}}}),
input
);
}
TEST_CASE
(
transpose_dyn_shape1
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
4
,
4
,
0
},
{
4
,
4
,
0
}}};
migraphx
::
shape
output
{
migraphx
::
shape
::
float_type
,
{{
4
,
4
,
0
},
{
4
,
4
,
0
},
{
1
,
4
,
0
}}};
expect_shape
(
input
,
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
1
,
2
}}}),
input
);
expect_shape
(
output
,
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
2
,
1
,
0
}}}),
input
);
}
TEST_CASE
(
transpose_axes_error
)
{
migraphx
::
shape
input
{
migraphx
::
shape
::
float_type
,
{
2
,
2
}};
throws_shape
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
1
}}}),
input
);
}
TEST_CASE
(
step_test
)
TEST_CASE
(
step_test
)
{
{
migraphx
::
shape
s1
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
4
}};
migraphx
::
shape
s1
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
4
}};
...
...
test/ref_ops_test.cpp
View file @
f17d6246
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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