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

 ##########
 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:
   In `QuantizeCompute` (`quantize-inl.h`) you can check if 
std::is_same<xpu,gpu>::value and check for param.out_type and throw exception.

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


With regards,
Apache Git Services

Reply via email to