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/09/03 19:02:42 UTC

[GitHub] [tvm] mbs-octoml commented on a change in pull request #8926: Fix incorrect AOT Memory Planning

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: commits-unsubscribe@tvm.apache.org

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