mbs-octoml commented on a change in pull request #8926:
URL: https://github.com/apache/tvm/pull/8926#discussion_r702108313



##########
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:
       Does this imply the function metadata snaffled away by the callback from 
LowerTEPass above is also wrong? Perhaps we only need the entry for main anyway 
in which case we could get rid of UpdateFunctionMetadata entirely?




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