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 2022/06/24 10:29:45 UTC

[GitHub] [tvm] manupa-arm commented on a diff in pull request #11015: [usmp] U3 use case

manupa-arm commented on code in PR #11015:
URL: https://github.com/apache/tvm/pull/11015#discussion_r905930513


##########
src/target/source/interface_c.cc:
##########
@@ -103,6 +109,9 @@ class InterfaceCNode : public runtime::ModuleNode {
   }
 
  private:
+  constexpr static const char* _macro_pool_size_postfix = "_POOL_SIZE_BYTES";
+  constexpr static const char* _macro_pool_data_postfix = "_POOL_DATA";

Review Comment:
   Can you verify a debug build works with this ? 
   
   We have had problems before. See https://github.com/apache/tvm/pull/10262



##########
src/target/source/codegen_params.cc:
##########
@@ -97,17 +98,18 @@ void PrintIntegralArray(void* data, size_t num_elements, int indent_chars, std::
       os << ", ";
     }
     if ((i % elements_per_row) == elements_per_row - 1) {
-      os << "\n";
+      os << eol;

Review Comment:
   Is this change required in the scope of this PR ?



##########
tests/python/relay/aot/test_crt_aot_usmp.py:
##########
@@ -18,16 +18,23 @@
 
 from collections import OrderedDict
 import re
-
+import textwrap

Review Comment:
   why is this needed ?



##########
tests/cpp/target/source/interface_c_test.cc:
##########
@@ -409,7 +409,7 @@ TEST(InterfaceAPI, ContainsWorkspacePoolStructSingle) {
 
   ASSERT_THAT(
       header_source,
-      HasSubstr("#define TVMGEN_ULTIMATE_CAT_SPOTTER_MY_MEMORY_POOL_WORKSPACE_POOL_SIZE 100000"));
+      HasSubstr("#define TVMGEN_ULTIMATE_CAT_SPOTTER_MY_MEMORY_POOL_POOL_SIZE_BYTES 100000"));

Review Comment:
   As stated previously, lets not do this breaking change now.



##########
src/target/source/interface_c.cc:
##########
@@ -90,8 +92,12 @@ class InterfaceCNode : public runtime::ModuleNode {
     for (const tir::usmp::AllocatedPoolInfo pool : pools_) {
       String pool_name = pool->pool_info->pool_name;
       Integer pool_size = pool->allocated_size;
-      EmitIntegerValueMacro(code, SanitizeName(pool_name) + " size",
-                            SanitizeName(pool_name) + "_WORKSPACE_POOL_SIZE", pool_size->value);

Review Comment:
   This is a breaking change  and I dont see the requirement to do this.
   For this PR, my suggestion would be to add _CONSTANT_POOL_SIZE and _CONSTANT_POOL_DATA seperately. 
   
   We can revisit if we want to change this behaviour and consolidate to a single pool size.



##########
src/target/source/interface_c.cc:
##########
@@ -152,6 +161,43 @@ class InterfaceCNode : public runtime::ModuleNode {
     code_stream << "#define " << macro_name_prefixed << " " << macro_value << "\n";
   }
 
+  void EmitConstantPool(std::stringstream& code_, const std::string& brief_description,

Review Comment:
   We need a test for this in interface_c_test.cc



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