Mousius commented on a change in pull request #8023:
URL: https://github.com/apache/tvm/pull/8023#discussion_r636967491
##########
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:
This was some minor boyscouting as code gen seems to already do this for
us:
```
TVM_DLL int32_t tvm__run_func(void* arg0, void* arg1, void* arg2, void*
arg3, void* arg4) {
void* input = arg0;
void* output = arg1;
void* output1 = arg2;
void* output2 = arg3;
void* output3 = arg4;
(void)fused_add_1(input, output);
(void)fused_add_1(output, output1);
(void)fused_add_1(output1, output2);
(void)fused_add_1(output2, output3);
return 0;
}
```
Also, `input_index` wasn't incremented so you'd get output like this instead:
```
TVM_DLL int32_t tvm__run_func(void* arg0, void* arg1, void* arg2, void*
arg3) {
void* input_0 = arg0;
void* input_01 = arg1;
void* input_02 = arg2;
void* output_0 = arg3;
(void)fused_concatenate_add_1(input_0, input_01, input_02, output_0);
return 0;
}
```
--
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:
[email protected]