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
28126c4c
"testing/vscode:/vscode.git/clone" did not exist on "c5bbc608555014e7b0b7108bc0a5eebb1522768f"
Commit
28126c4c
authored
Nov 14, 2023
by
Ted Themistokleous
Browse files
Update format
parent
b2997e91
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
+9
-10
test/fuse_pointwise.cpp
test/fuse_pointwise.cpp
+2
-1
test/simplify_algebra_test.cpp
test/simplify_algebra_test.cpp
+5
-6
test/simplify_reshapes_test.cpp
test/simplify_reshapes_test.cpp
+2
-3
No files found.
test/fuse_pointwise.cpp
View file @
28126c4c
...
...
@@ -414,7 +414,8 @@ TEST_CASE(add_reshape_add_nonstandard)
auto
y
=
mm
->
add_parameter
(
"y"
,
s1
);
auto
z
=
mm
->
add_parameter
(
"z"
,
s2
);
auto
add1
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"add"
),
x
,
y
);
auto
reshape
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
s2
.
lens
()}}),
add1
);
auto
reshape
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
s2
.
lens
()}}),
add1
);
auto
add2
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"add"
),
reshape
,
z
);
mm
->
add_return
({
add2
});
}
...
...
test/simplify_algebra_test.cpp
View file @
28126c4c
...
...
@@ -1900,12 +1900,12 @@ TEST_CASE(simplify_split_add_relu_reshape)
auto
slc1
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
1
}},
{
"starts"
,
{
0
}},
{
"ends"
,
{
1
}}}),
relu
);
auto
rsp1
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
3
,
4
}}}),
slc1
);
auto
rsp1
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
3
,
4
}}}),
slc1
);
auto
slc2
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
1
}},
{
"starts"
,
{
1
}},
{
"ends"
,
{
2
}}}),
relu
);
auto
rsp2
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
3
,
4
}}}),
slc2
);
auto
rsp2
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
3
,
4
}}}),
slc2
);
auto
add
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"add"
),
rsp1
,
rsp2
);
m2
.
add_instruction
(
pass_op
{},
add
);
...
...
@@ -2328,8 +2328,7 @@ TEST_CASE(simplify_dot_horiz_reshape)
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
2
}},
{
"starts"
,
{
0
}},
{
"ends"
,
{
4
}}}),
dot
);
auto
y
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
2
}},
{
"starts"
,
{
4
}},
{
"ends"
,
{
8
}}}),
dot
);
auto
x_rsp
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
3
,
4
,
2
,
2
}}}),
x
);
auto
x_rsp
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
3
,
4
,
2
,
2
}}}),
x
);
auto
y_rsp
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
2
}},
{
"steps"
,
{
2
}}}),
y
);
auto
sum
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"add"
),
{
x_rsp
,
y_rsp
});
...
...
@@ -2692,8 +2691,8 @@ void reorder_reshape_slice()
{
s
=
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
BS
,
128
,
1920
},
{
165120
,
1
,
128
}};
}
auto
input
=
m2
.
add_parameter
(
"input"
,
s
);
auto
rsp_input
=
input
;
auto
input
=
m2
.
add_parameter
(
"input"
,
s
);
auto
rsp_input
=
input
;
std
::
vector
<
int64_t
>
lens
=
{
static_cast
<
int64_t
>
(
BS
),
128
,
30
,
64
};
auto
r
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
lens
}}),
rsp_input
);
...
...
test/simplify_reshapes_test.cpp
View file @
28126c4c
...
...
@@ -1299,7 +1299,7 @@ TEST_CASE(transpose_contiguous_reshape_unary)
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
2
,
2
,
2
,
2
,
5
,
5
}}}),
x
);
auto
transpose_ins
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
3
,
4
,
1
,
5
,
2
}}}),
reshape_ins1
);
auto
relu
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"relu"
),
transpose_ins
);
auto
relu
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"relu"
),
transpose_ins
);
auto
reshape_ins2
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"reshape"
,
{{
"dims"
,
{
2
,
2
,
10
,
10
}}}),
relu
);
m2
.
add_instruction
(
pass_op
{},
reshape_ins2
);
...
...
@@ -1352,8 +1352,7 @@ TEST_CASE(transpose_contiguous_unsqueeze_unary)
auto
transpose_ins
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
x
);
auto
round
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"nearbyint"
),
transpose_ins
);
auto
unsq_ins
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
2
}}}),
round
);
auto
unsq_ins
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
2
}}}),
round
);
m2
.
add_instruction
(
pass_op
{},
unsq_ins
);
}
EXPECT
(
m1
==
m2
);
...
...
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