You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/02/09 01:05:42 UTC

[GitHub] anirudh2290 commented on a change in pull request #14094: Enhance gpu quantization

anirudh2290 commented on a change in pull request #14094: Enhance gpu quantization
URL: https://github.com/apache/incubator-mxnet/pull/14094#discussion_r255278810
 
 

 ##########
 File path: python/mxnet/contrib/quantization.py
 ##########
 @@ -499,6 +499,9 @@ def quantize_model(sym, arg_params, aux_params,
     if quantized_dtype not in ('int8', 'uint8'):
         raise ValueError('unknown quantized_dtype %s received,'
                          ' expected `int8` or `uint8`' % quantized_dtype)
+    if quantized_dtype == 'uint8' and ctx != cpu():
+        raise ValueError('currently, uint8 quantization is only supported by CPU,'
+                         ' please switch to the context of CPU or int8 data type for GPU')
 
 Review comment:
   better to add this error to backend like in the case for MKLDNN with int8 so that we dont have to add to other frontends when we support quantization.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services