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
94fcfc02
Unverified
Commit
94fcfc02
authored
Oct 06, 2023
by
Paul Fultz II
Committed by
GitHub
Oct 06, 2023
Browse files
Run optimize_module for int8 quantization (#2300)
parent
19c87449
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/quantization.cpp
src/quantization.cpp
+5
-4
No files found.
src/quantization.cpp
View file @
94fcfc02
...
...
@@ -70,6 +70,10 @@ void quantize_int8(program& prog,
MIGRAPHX_THROW
(
"QUANTIZE_INT8: only support DOT and CONVOLUTION operation"
);
}
// Run optimize_module() before converting to int8 to const eval and fold in FP32 to
// avoid loss of precision.
run_passes
(
prog
,
{
optimize_module
{}});
std
::
shared_ptr
<
std
::
vector
<
std
::
pair
<
float
,
float
>>>
int8_quant_params
=
std
::
make_shared
<
std
::
vector
<
std
::
pair
<
float
,
float
>>>
();
std
::
shared_ptr
<
std
::
vector
<
float
>>
max_abs_vals
=
std
::
make_shared
<
std
::
vector
<
float
>>
();
...
...
@@ -143,10 +147,7 @@ void quantize_int8(program& prog,
run_passes
(
prog
,
{
quantize_int8_pass
{
ins_names
,
*
int8_quant_params
},
eliminate_common_subexpression
{},
dead_code_elimination
{},
simplify_reshapes
{},
dead_code_elimination
{},
optimize_module
{},
simplify_qdq
{},
dead_code_elimination
{}});
}
...
...
gaoqiong
@gaoqiong
mentioned in commit
b329ac7f
·
Dec 14, 2023
mentioned in commit
b329ac7f
mentioned in commit b329ac7f8bc849f1854e8117215476cd25fa6c6c
Toggle commit list
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