Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
4ce41ebc
Commit
4ce41ebc
authored
Aug 29, 2019
by
Shucai Xiao
Browse files
clang format
parent
33ce5786
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
src/quantization.cpp
src/quantization.cpp
+3
-3
test/gpu/quantization.cpp
test/gpu/quantization.cpp
+10
-7
No files found.
src/quantization.cpp
View file @
4ce41ebc
test/gpu/quantization.cpp
View file @
4ce41ebc
...
...
@@ -108,10 +108,12 @@ TEST_CASE(dot_large_alpha_beta_float)
auto
mb
=
p
.
insert_instruction
(
insert_loc
,
migraphx
::
op
::
mul
{},
fb
,
pb
);
auto
rb
=
p
.
insert_instruction
(
insert_loc
,
migraphx
::
op
::
round
{},
mb
);
auto
cb
=
p
.
insert_instruction
(
insert_loc
,
migraphx
::
op
::
clip
{
127.0
f
,
-
128.0
f
},
rb
);
auto
qb
=
p
.
insert_instruction
(
insert_loc
,
migraphx
::
op
::
convert
{
migraphx
::
shape
::
int8_type
},
cb
);
auto
qb
=
p
.
insert_instruction
(
insert_loc
,
migraphx
::
op
::
convert
{
migraphx
::
shape
::
int8_type
},
cb
);
// quantize parameter b to int32 type
auto
qc
=
p
.
insert_instruction
(
std
::
next
(
pc
),
migraphx
::
op
::
convert
{
migraphx
::
shape
::
int32_type
},
pc
);
auto
qc
=
p
.
insert_instruction
(
std
::
next
(
pc
),
migraphx
::
op
::
convert
{
migraphx
::
shape
::
int32_type
},
pc
);
auto
qdot
=
p
.
add_instruction
(
migraphx
::
op
::
quant_dot
{
2000
,
51
},
qa
,
qb
,
qc
);
p
.
add_instruction
(
migraphx
::
op
::
convert
{
migraphx
::
shape
::
float_type
},
qdot
);
...
...
@@ -121,7 +123,8 @@ TEST_CASE(dot_large_alpha_beta_float)
auto
p
=
create_program
();
const
std
::
vector
<
std
::
pair
<
float
,
float
>>&
quant_params
{{
0.1
f
,
1.0
f
},
{
0.1
f
,
0.0
f
},
{
0.1
f
,
100.0
f
}};
const
std
::
vector
<
std
::
pair
<
float
,
float
>>&
quant_params
{
{
0.1
f
,
1.0
f
},
{
0.1
f
,
0.0
f
},
{
0.1
f
,
100.0
f
}};
// default scale 64.0f is used for all args
migraphx
::
quantize_int8
(
p
,
{
"dot"
},
quant_params
);
...
...
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