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 2020/01/17 08:20:04 UTC

[GitHub] [incubator-tvm] anijain2305 opened a new pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.

anijain2305 opened a new pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.
URL: https://github.com/apache/incubator-tvm/pull/4732
 
 
   As Title.
   
   @FrozenGene @jackwish @shoubhik @yzhliu 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-tvm] shoubhik commented on a change in pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.

Posted by GitBox <gi...@apache.org>.
shoubhik commented on a change in pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.
URL: https://github.com/apache/incubator-tvm/pull/4732#discussion_r367815134
 
 

 ##########
 File path: src/relay/qnn/op/convolution.cc
 ##########
 @@ -57,7 +57,9 @@ bool QnnConv2DRel(const Array<Type>& 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
+  // Kernel scale can be a vector of length output_channels or a scalar.
+  size_t axis = param->kernel_layout.find("O");
+  AssignType(types[4], DataType::Float(32), weight->shape[axis], reporter);  // kernel scale
 
 Review comment:
   should this be types[5]? there is a types[4] on line 59.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-tvm] shoubhik commented on a change in pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.

Posted by GitBox <gi...@apache.org>.
shoubhik commented on a change in pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.
URL: https://github.com/apache/incubator-tvm/pull/4732#discussion_r367816522
 
 

 ##########
 File path: src/relay/qnn/op/convolution.cc
 ##########
 @@ -57,7 +57,9 @@ bool QnnConv2DRel(const Array<Type>& 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
+  // Kernel scale can be a vector of length output_channels or a scalar.
+  size_t axis = param->kernel_layout.find("O");
 
 Review comment:
   Since it is a single char, better use 'O' instead of "O", from C++ perspective.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-tvm] anijain2305 commented on issue #4732: [QNN] Conv2D type checking for kernel per-channel scales.

Posted by GitBox <gi...@apache.org>.
anijain2305 commented on issue #4732: [QNN] Conv2D type checking for kernel per-channel scales.
URL: https://github.com/apache/incubator-tvm/pull/4732#issuecomment-575532628
 
 
   @shoubhik Good catch about the index. Comments addressed.

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-tvm] jackwish commented on issue #4732: [QNN] Conv2D type checking for kernel per-channel scales.

Posted by GitBox <gi...@apache.org>.
jackwish commented on issue #4732: [QNN] Conv2D type checking for kernel per-channel scales.
URL: https://github.com/apache/incubator-tvm/pull/4732#issuecomment-576003731
 
 
   Thank you for ping, and sorry for missed this. I had a busy week. :)

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-tvm] zhiics merged pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.

Posted by GitBox <gi...@apache.org>.
zhiics merged pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.
URL: https://github.com/apache/incubator-tvm/pull/4732
 
 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

[GitHub] [incubator-tvm] shoubhik commented on a change in pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.

Posted by GitBox <gi...@apache.org>.
shoubhik commented on a change in pull request #4732: [QNN] Conv2D type checking for kernel per-channel scales.
URL: https://github.com/apache/incubator-tvm/pull/4732#discussion_r367817443
 
 

 ##########
 File path: src/relay/qnn/op/convolution.cc
 ##########
 @@ -57,7 +57,9 @@ bool QnnConv2DRel(const Array<Type>& 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
+  // Kernel scale can be a vector of length output_channels or a scalar.
+  size_t axis = param->kernel_layout.find("O");
 
 Review comment:
   Also we should check what happens if there is no "O", just to be safe.

----------------------------------------------------------------
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


With regards,
Apache Git Services