This repository was archived by the owner on Nov 17, 2023. It is now read-only.
add uint8 bn mkldnn implementation#16003
Merged
Merged
Conversation
xinyu-intel
reviewed
Aug 26, 2019
| excluded_sym_names += ['resnetv10_conv0_fwd'] | ||
| elif args.model.find('resnet') != -1 and args.model.find('v2') != -1: | ||
| excluded_sym_names += ['resnetv20_flatten0_flatten0'] | ||
| excluded_sym_names += ['resnetv20_flatten0_flatten0', 'resnetv20_stage1_batchnorm0_fwd'] |
Contributor
There was a problem hiding this comment.
why exclude the first one?
Contributor
Author
There was a problem hiding this comment.
This is for the sake of accuracy, if do not exclude this layer, top-1 accuracy will drop to 52.3. Reason of this accuracy drop is under investigation.
xinyu-intel
reviewed
Aug 26, 2019
ZhennanQin
approved these changes
Aug 26, 2019
Contributor
ZhennanQin
left a comment
There was a problem hiding this comment.
LGTM. Just add a comment to remind that the excluded BN layer is for accuracy purpose.
pengzhao-intel
approved these changes
Aug 26, 2019
Contributor
pengzhao-intel
left a comment
There was a problem hiding this comment.
Thanks for the contribution.
LGTM and mering now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
add uint8 batchnorm, mkldnn implementation and test
@PatricZhao @ZhennanQin
Details
Usage
Check the doc in https://github.com/apache/incubator-mxnet/tree/master/example/quantization/README.md to quantize models and do inference.
Quantized bn will be used automatically when a bn operator cannot be fused.
Performance
In most cases, bn can be fused, so quantized bn is not introduced. In reset50 v2, some of the bn operators are standalone, quantizing these bn give a performance as follows: