-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[int8] Add MobileNetV2_1.0 & ResNet18 Quantization #14823
Conversation
cc @zhreshold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's wait the CI back.
@@ -392,6 +392,7 @@ mkldnn_memory_format_t GetDefaultFormat(const mkldnn::memory::desc &desc) { | |||
case mkldnn_gOhwi8o: | |||
case mkldnn_gOhwi16o: | |||
case mkldnn_gOhIw16o4i: | |||
case mkldnn_Goihw16g_s8s8: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this? It's first time for us to have this format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, when quantize s8s8 group conv.
@@ -234,6 +242,12 @@ def save_params(fname, arg_params, aux_params, logger=None): | |||
'mobilenet0_pool0_fwd'] | |||
if exclude_first_conv: | |||
excluded_sym_names += ['mobilenet0_conv0_fwd'] | |||
elif args.model == 'mobilenetv2_1.0': | |||
rgb_mean = '123.68,116.779,103.939' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any exception that the rgb_mean dna std is not the same? otherwise repeatively coding it looks redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @zhreshold, along with enabling more models, we don't need to show how to reproduce each one since most of the command is very similar. We need to define a template for the user to reproduce any existed models for classification networks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhreshold @pengzhao-intel agree, I'll refactor this script along with enabling more models next time.
@mxnet-label-bot add [Quantization, Example] |
Merging now. @xinyu-intel will refactor the script in the next PR. |
* add resnet18 and mobilenetv2 models * add readme * support mkldnn s8s8 goihw16g weight format * fix_readme_typo
* add resnet18 and mobilenetv2 models * add readme * support mkldnn s8s8 goihw16g weight format * fix_readme_typo
Description
Add MobileNetV2_1.0 & ResNet18 Quantization.
ResNet18 Performance on Skylake 8180 28c
#14819 will improve mobilenetv2 fp32/int8 performance
@pengzhao-intel @ZhennanQin
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments