electriclilies commented on a change in pull request #8926:
URL: https://github.com/apache/tvm/pull/8926#discussion_r702110466



##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -656,6 +651,20 @@ class AOTExecutorCodegen : public MixedModeVisitor {
     auto storage_rewrite = tir::transform::StorageRewrite();
     mod_run = storage_rewrite(mod_run);
 
+    // The workspace for main function should be calculated after performing 
storage_rewrite for
+    // the top level TIR function.
+    auto workspace_byte_alignment =
+        
target_host_->GetAttr<Integer>("workspace-byte-alignment").value_or(16);
+    Integer main_workspace_size = CalculateWorkspaceBytes(

Review comment:
       Unfortunately `UpdateFunctionMetadata` creates the whole FunctionInfo 
object which includes `workspace_sizes`, `io_sizes`, `constant_sizes`, etc. I 
think we still need to do that during lowering... 




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to