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/18 22:30:41 UTC

[GitHub] [tvm] giuseros commented on a change in pull request #8023: [AOT] Initial implementation of --no-typed-operators

giuseros commented on a change in pull request #8023:
URL: https://github.com/apache/tvm/pull/8023#discussion_r634781747



##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -605,7 +625,8 @@ class AOTExecutorCodegen : public ExprVisitor {
     // Find the return sid
     return_sid_ = AotReturnSidVisitor(storage_device_map_).FindReturnSid(func);
     for (unsigned int output_index = 0; output_index < return_sid_.size(); output_index++) {
-      main_signature_.push_back(tir::Var(MakeString("output_", output_index), DataType::Handle()));
+      auto output_var = tir::Var("output", DataType::Handle());
+      main_signature_.push_back(output_var);

Review comment:
       Same here

##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -588,10 +609,9 @@ class AOTExecutorCodegen : public ExprVisitor {
     auto pf = GetPackedFunc("relay.backend.GraphPlanMemory");
     storage_device_map_ = (*pf)(func);
 
-    int input_index = 0;
     for (auto input : func->params) {
       input_vars_.push_back(input);
-      main_signature_.push_back(tir::Var(MakeString("input_", input_index), DataType::Handle()));
+      main_signature_.push_back(tir::Var("input", DataType::Handle()));

Review comment:
       Why removing the indices? It's useful  when we read TIR to see the inputs/outputs numbered. 

##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -137,10 +137,17 @@ class AOTExecutorCodegen : public ExprVisitor {
       // Pack the sid inside the TVMValue
       auto sid_array = te::Var(MakeString("sid_", sid, "_value"), DataType::Handle());
       auto sid_value = sids_table_[sid];
-      tvm::PrimExpr set_tensor =
-          tvm::tir::Call(DataType::Handle(), tvm::tir::builtin::tvm_struct_set(),
-                         {sid_array, 0, tir::builtin::kArrData, sid_value});
-      stmts_.push_back(tir::LetStmt(sid_array, StackAlloca("array", 1), tir::Evaluate(set_tensor)));
+
+      if (target_host_->GetAttr<Bool>("typed-operators").value_or(Bool(true))) {

Review comment:
       Why don't you create a flag `use_typed_operators_` ? 

##########
File path: tests/python/relay/aot/test_crt_aot.py
##########
@@ -43,7 +43,8 @@
 from aot_test_utils import *
 
 
-def test_conv_with_params():
+@pytest.mark.parametrize("target_options", ["", "--typed-operators=0"])

Review comment:
       I am worried about test explosion. Once you rebase and incorporate @manupa-arm changes (i.e., memory workspace feature) each test would run now 4 times [with/without workspace] x [with/without typed-operators]. Maybe you could select some tests where enabling this feature? Or maybe enable it by default, and add few tests without the feature?




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