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 2022/02/28 17:31:38 UTC

[GitHub] [tvm] ashutosh-arm commented on a change in pull request #10224: [CMSIS-NN] enable USMP with CMSIS-NN

ashutosh-arm commented on a change in pull request #10224:
URL: https://github.com/apache/tvm/pull/10224#discussion_r816103078



##########
File path: src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
##########
@@ -316,14 +345,13 @@ class RelayToTIRVisitor : public MixedModeMutator {
 
     tvm::Array<PrimExpr> call_ext_args = {tir::StringImm("arm_fully_connected_s8"), input, filter};
     if (bias_add_call) {
-      call_ext_args.push_back(bias);
+      call_ext_args.push_back(buffer_creator_.GetBufferVar("bias"));
     }
     call_ext_args.push_back(output);
 
     int context_buffer_size = 0;
-    std::string context_buffer_name = "NULL";
-    tvm::Array<PrimExpr> context_buffer_args = {tir::StringImm(context_buffer_name),
-                                                ToArg(context_buffer_size)};
+    PrimExpr buffer_var = tir::StringImm("NULL");

Review comment:
       nit: context_buffer_var would be more meaningful.

##########
File path: src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
##########
@@ -196,12 +227,13 @@ class RelayToTIRVisitor : public MixedModeMutator {
 
     tvm::Array<PrimExpr> call_ext_args = {tir::StringImm(cmsisnn_api), input, filter, multiplier};
     if (bias_add_call) {
+      tir::Var bias = buffer_creator_.GetBufferVar("bias");
       call_ext_args.push_back(bias);
     }
     call_ext_args.push_back(shift);
     call_ext_args.push_back(output);
 
-    std::string context_buffer_name = "NULL";
+    PrimExpr buffer_var = tir::StringImm("NULL");

Review comment:
       nit: Like other places, it can be renamed to context_buffer_var for better clarity.

##########
File path: src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
##########
@@ -267,10 +293,13 @@ class RelayToTIRVisitor : public MixedModeMutator {
     // %3 = qnn.requantize(%2, %req_input_scale_scalar, %req_input_zero_point_scalar,
     //                     %output_scale_scalar, %output_zero_point_scalar)
     // clip(%3, a_min=%min_scalar, a_max=%max_scalar)
-    tir::Var input("input", DataType::Handle(8));
-    tir::Var filter("filter", DataType::Handle(8));
-    tir::Var bias("bias", DataType::Handle(32));
-    tir::Var output("output", DataType::Handle(8));
+    BufferCreator buffer_creator_;

Review comment:
       I have seen trailing underscores for member variables. Not sure what the guideline is.




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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org