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

 ##########
 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:
   currently, only python frontend support quantization and in fact calibration 
progress will not use backend specific quantized operator. So I think it's good 
to add error message in this place currently.

----------------------------------------------------------------
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

Reply via email to