anirudh2290 commented on issue #14467: MKL-DNN QuantizedFullyConnectedOp Error
URL: 
https://github.com/apache/incubator-mxnet/issues/14467#issuecomment-475526979
 
 
   Thanks @ciyongch  . Can you please let me know why quantized_fully_connected 
doesn't handle inferring the data dimension 0 based on the output shape. For 
example, the following runs fine on fp32:
   
   ```
   import mxnet as mx
   qdtype="float32"
   num_hidden=100
   no_bias=False
   flatten=True
   x = mx.sym.var("x", dtype=qdtype)
   qdata = mx.sym.Variable(name='qdata')#, shape=data_shape, dtype=qdtype)
   qbias = mx.sym.Variable(name='qbias')#, shape=(10, 100), dtype=qdtype)
   y = mx.sym.exp(x)
   fc_fp32 = mx.sym.FullyConnected(data=qdata, num_hidden=num_hidden, 
no_bias=no_bias, flatten=flatten)
   sum_first = mx.sym.elemwise_add(y, fc_fp32)
   sum_first_1 = mx.sym.Group([sum_first, x, y])
   ex = sum_first_1.simple_bind(mx.cpu(), qdata=(0, 1024), 
fullconnected0_weight=(100, 1024), fullyconnected0_bias=(100,), x=(10, 100))
   print(ex.arg_dict["qdata"].shape)
   ```
   
   Expectation is after quantization also it should run fine. But it fails at 
this check.
   Is there any reason why we cant remove the check here: 
   
https://github.com/apache/incubator-mxnet/blob/master/src/operator/quantization/quantized_fully_connected.cc#L50
   and add a inference from output to input like in non quantized fully 
connected here: 
https://github.com/apache/incubator-mxnet/blob/master/src/operator/nn/fully_connected.cc#L78
 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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