[GitHub] [incubator-tvm] liangfu commented on a change in pull request #4714: Mxnet parser for Qnn dialect

2020-01-15 Thread GitBox
liangfu commented on a change in pull request #4714: Mxnet parser for Qnn 
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r367195032
 
 

 ##
 File path: python/tvm/relay/frontend/mxnet_qnn_op_utils.py
 ##
 @@ -21,52 +21,95 @@
 
 import numpy as np
 from tvm import relay
-from tvm.relay.qnn.op.qnn import dequantize
+from tvm.relay.qnn.op.qnn import quantize, dequantize
 
-zero_centered_uint8_quantized_range = np.float32(255)
-zero_centered_int8_quantized_range = np.float32(127)
+zero_centered_uint8_quantized_range = np.float32(255.5)
 
 Review comment:
   Can you explain why are we adding an extra 0.5 here?


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


[GitHub] [incubator-tvm] liangfu commented on a change in pull request #4714: Mxnet parser for Qnn dialect

2020-01-15 Thread GitBox
liangfu commented on a change in pull request #4714: Mxnet parser for Qnn 
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r367197041
 
 

 ##
 File path: python/tvm/relay/frontend/mxnet.py
 ##
 @@ -180,6 +190,17 @@ def _mx_conv2d(inputs, attrs):
 new_attrs["groups"] = attrs.get_int("num_group", 1)
 new_attrs["data_layout"] = data_layout
 new_attrs["kernel_layout"] = kernel_layout
+return new_attrs
+
+def _mx_conv2d(inputs, attrs):
+kernel_size = attrs.get_int_tuple("kernel")
+data_layout = attrs.get_str("layout", "NCHW")
+if len(kernel_size) != 2:
+raise tvm.error.OpAttributeInvalid(
+'Non 1D or 2D kernels are not supported for operator Convolution')
 
 Review comment:
   Only 2D kernels are supported.


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


[GitHub] [incubator-tvm] liangfu commented on a change in pull request #4714: Mxnet parser for Qnn dialect

2020-01-15 Thread GitBox
liangfu commented on a change in pull request #4714: Mxnet parser for Qnn 
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r367198080
 
 

 ##
 File path: python/tvm/relay/frontend/mxnet.py
 ##
 @@ -1075,6 +1098,377 @@ def _mx_cond(inputs, attrs, subgraphs):
 return ret
 
 
+def _qnn_mx_contrib_quantize(inputs, attrs):
 
 Review comment:
   Can we put functions with `_qnn_mx` prefix into mxnet_qnn_op_utils.py file 
as well?


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


[GitHub] [incubator-tvm] liangfu commented on a change in pull request #4714: Mxnet parser for Qnn dialect

2020-01-15 Thread GitBox
liangfu commented on a change in pull request #4714: Mxnet parser for Qnn 
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r367192729
 
 

 ##
 File path: python/tvm/relay/frontend/mxnet.py
 ##
 @@ -14,12 +14,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-# pylint: disable=invalid-name, import-self, len-as-condition, no-else-return
+# pylint: disable=invalid-name, import-self, len-as-condition, no-else-return, 
too-many-lines
 
 Review comment:
   Avoid disabling linter in head of a file. Instead, you can disable them in 
specific functions or classes.


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


[GitHub] [incubator-tvm] liangfu commented on a change in pull request #4714: Mxnet parser for Qnn dialect

2020-01-15 Thread GitBox
liangfu commented on a change in pull request #4714: Mxnet parser for Qnn 
dialect
URL: https://github.com/apache/incubator-tvm/pull/4714#discussion_r367196432
 
 

 ##
 File path: src/relay/qnn/op/convolution.cc
 ##
 @@ -57,7 +57,7 @@ bool QnnConv2DRel(const Array& types, int num_inputs, 
const Attrs& attrs,
   CHECK(IsScalarType(types[2], DataType::Int(32)));// input_zero_point
   CHECK(IsScalarType(types[3], DataType::Int(32)));// kernel_zero_point
   CHECK(IsScalarType(types[4], DataType::Float(32)));  // input_scale
-  CHECK(IsScalarType(types[5], DataType::Float(32)));  // kernel_scale
+  // AssignType(types[1], DataType::Float(32), data->shape[axis], reporter);  
// kernel_scale
 
 Review comment:
   Why are we removing type check of `types[5]` ?


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