Mousius commented on a change in pull request #8926:
URL: https://github.com/apache/tvm/pull/8926#discussion_r702170073
##########
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:
All of that function metadata is passed through and generated into the
model library output, so it's still used - though I'm guessing it'd also be
slightly wrong as `StorageRewrite` runs against the entire module. I'll take a
look if I get a minute, this is more pressing as we use it to determine the
size of the memory for the stack allocator.
--
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]