ZhennanQin commented on a change in pull request #13697: [MKLDNN] Enable signed
int8 support for convolution.
URL: https://github.com/apache/incubator-mxnet/pull/13697#discussion_r244652851
##########
File path: example/quantization/imagenet_gen_qsym_mkldnn.py
##########
@@ -140,8 +140,8 @@ def save_params(fname, arg_params, aux_params,
logger=None):
' thresholds. This mode is expected to produce
the best inference accuracy of all three'
' kinds of quantized models if the calibration
dataset is representative enough of the'
' inference dataset.')
- parser.add_argument('--quantized-dtype', type=str, default='uint8',
- choices=['int8', 'uint8'],
+ parser.add_argument('--quantized-dtype', type=str, default='auto',
Review comment:
@KellenSunderland If data loader is configured with rgb_mean=(0,0,0), then
the in_data for first convolution are all non-negative values, we can directly
quantize the input to uint8 and don't need to ignore the first convolution. The
flow will look like
input ->quantize->convolution(uint8)
If data loader is configured with rgb_mean!=(0,0,0), then in_data for first
convolution will have negative values. For this case, you need to exclude the
first convolution to run it in fp32 mode, and after the relu following first
convolution, do quantization to uint8. The flow will look like,
input ->convolution(fp32) -> relu(fp32) ->quantize->pooling(uint8)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services