You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/05/11 03:58:01 UTC

[GitHub] [tvm] huochaitiantang commented on a change in pull request #8007: [ONNX] QLinearConv Support

huochaitiantang commented on a change in pull request #8007:
URL: https://github.com/apache/tvm/pull/8007#discussion_r629828874



##########
File path: tests/python/frontend/onnx/test_forward.py
##########
@@ -4217,6 +4228,8 @@ def verify_cumsum(indata, axis, exclusive=0, reverse=0, type="float32"):
     "test_maxpool_with_argmax_2d_precomputed_strides/",
     "test_maxunpool_export_with_output_shape/",
     "test_mvn/",
+    # For QLinearConv tests in ONNX, scale and zero_point input are placeholders,
+    # but qnn.conv2d requires scale and zero_point input to be scalar

Review comment:
       I have tried to work around this issue but failed. For ONNX test model of QLinearConv, y_scale is input node and will be parsed to free_var in relay. It will cause an error while lowering requantize because it requires output_scale (y_scale) to be constant expr:
   ```
   E     1: tvm::relay::qnn::RequantizeLower(tvm::RelayExpr const&, tvm::RelayExpr const&, tvm::RelayExpr const&, tvm::RelayExpr const&, tvm::RelayExpr const&, tvm::relay::qnn::RequantizeAttrs const*, tvm::r
   untime::Array<tvm::PrimExpr, void> const&, tvm::runtime::DataType const&)
   E           at /home/liuliang/Desktop/tvms/tvm/src/relay/qnn/op/requantize.cc:148
   E     0: float tvm::relay::GetScalarFromConstant<float>(tvm::RelayExpr)
   E           at /home/liuliang/Desktop/tvms/tvm/src/relay/qnn/op/../../transforms/pattern_utils.h:514
   E     File "/home/liuliang/Desktop/tvms/tvm/src/relay/quantize/../transforms/pattern_utils.h", line 514
   E   TVMError: 
   E   ---------------------------------------------------------------
   E   An error occurred during the execution of TVM.
   E   For more information, please see: https://tvm.apache.org/docs/errors.html
   E   ---------------------------------------------------------------
   E     Check failed: (n) is false: Expr must be a constant expr - #[version = "0.0.5"]
   E   free_var %y_scale: float32;
   E   cast(%y_scale, dtype="float32") /* ty=float32 */
   ```
   Do you have some suggestions to solve it?




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