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
e5dc9629
Commit
e5dc9629
authored
May 22, 2019
by
Shucai Xiao
Browse files
Merge branch 'int8_miopen_call' into int8_quantize
parents
faef98bf
5be03483
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
test/gpu/miopen.cpp
test/gpu/miopen.cpp
+6
-2
No files found.
test/gpu/miopen.cpp
View file @
e5dc9629
...
@@ -82,6 +82,10 @@ auto get_hash(const T& x)
...
@@ -82,6 +82,10 @@ auto get_hash(const T& x)
return
std
::
hash
<
T
>
{}(
x
);
return
std
::
hash
<
T
>
{}(
x
);
}
}
// add an overload function for int type
// to avoid overflow in test examples
inline
auto
get_hash
(
const
int
&
x
)
{
return
std
::
hash
<
int
>
{}(
x
)
/
64
;
}
void
compile_check
(
migraphx
::
program
&
p
,
const
migraphx
::
target
&
t
)
void
compile_check
(
migraphx
::
program
&
p
,
const
migraphx
::
target
&
t
)
{
{
auto
name
=
t
.
name
();
auto
name
=
t
.
name
();
...
@@ -1263,12 +1267,11 @@ struct quant_dot_3args_2 : verify_program<quant_dot_3args_2>
...
@@ -1263,12 +1267,11 @@ struct quant_dot_3args_2 : verify_program<quant_dot_3args_2>
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
int8_type
,
{
8
,
2
}};
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
int8_type
,
{
8
,
2
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
int8_type
,
{
8
,
7
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
int8_type
,
{
8
,
7
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
int32_type
,
{
2
,
7
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
int32_type
,
{
2
,
7
}};
std
::
vector
<
int
>
m3_data
(
2
*
7
,
1
);
auto
l1
=
p
.
add_parameter
(
"a"
,
m1_shape
);
auto
l1
=
p
.
add_parameter
(
"a"
,
m1_shape
);
auto
tl1
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
1
,
0
}},
l1
);
auto
tl1
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
1
,
0
}},
l1
);
auto
l2
=
p
.
add_parameter
(
"b"
,
m2_shape
);
auto
l2
=
p
.
add_parameter
(
"b"
,
m2_shape
);
auto
l3
=
p
.
add_
literal
(
m3_shape
,
m3_data
);
auto
l3
=
p
.
add_
parameter
(
"c"
,
m3_shape
);
p
.
add_instruction
(
migraphx
::
op
::
quant_dot
{
1
,
3
},
tl1
,
l2
,
l3
);
p
.
add_instruction
(
migraphx
::
op
::
quant_dot
{
1
,
3
},
tl1
,
l2
,
l3
);
return
p
;
return
p
;
}
}
...
@@ -1319,6 +1322,7 @@ struct batch_quant_dot_1 : verify_program<batch_quant_dot_1>
...
@@ -1319,6 +1322,7 @@ struct batch_quant_dot_1 : verify_program<batch_quant_dot_1>
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
int8_type
,
{
3
,
2
,
8
,
2
}};
migraphx
::
shape
m1_shape
{
migraphx
::
shape
::
int8_type
,
{
3
,
2
,
8
,
2
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
int8_type
,
{
3
,
2
,
7
,
8
}};
migraphx
::
shape
m2_shape
{
migraphx
::
shape
::
int8_type
,
{
3
,
2
,
7
,
8
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
int32_type
,
{
3
,
2
,
2
,
7
}};
migraphx
::
shape
m3_shape
{
migraphx
::
shape
::
int32_type
,
{
3
,
2
,
2
,
7
}};
std
::
vector
<
int
>
m3_data
(
2
*
7
,
1
);
auto
l1
=
p
.
add_parameter
(
"a"
,
m1_shape
);
auto
l1
=
p
.
add_parameter
(
"a"
,
m1_shape
);
auto
tl1
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
l1
);
auto
tl1
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
1
,
3
,
2
}},
l1
);
...
...
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