jinhuang415 commented on a change in pull request #10433: [MXNET-290] MKLDNN support for model quantization URL: https://github.com/apache/incubator-mxnet/pull/10433#discussion_r183240942
########## File path: src/c_api/c_api_symbolic.cc ########## @@ -595,7 +596,12 @@ int MXQuantizeSymbol(SymbolHandle sym_handle, offline.emplace(offline_params[i]); } g.attrs["offline_params"] = std::make_shared<nnvm::any>(std::move(offline)); - g = ApplyPass(std::move(g), "QuantizeGraph"); +#if MXNET_USE_MKLDNN == 1 + if (dev_type == Context::kCPU) + g = ApplyPass(std::move(g), "QuantizeGraphUnsigned"); + else +#endif + g = ApplyPass(std::move(g), "QuantizeGraph"); Review comment: Currently, the main difference is the quantized convolution input type (CPU requires uint8 while GPU requires int8) and min/max node index calculation, but it's possible more differences in the future so we use a different function. ---------------------------------------------------------------- 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