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/02/12 00:12:53 UTC

[GitHub] [tvm] areusch commented on a change in pull request #7449: [µTVM] Print .elf statistics for a model runtime built with Zephyr

areusch commented on a change in pull request #7449:
URL: https://github.com/apache/tvm/pull/7449#discussion_r574914911



##########
File path: python/tvm/micro/contrib/zephyr.py
##########
@@ -204,6 +204,22 @@ def library(self, output, sources, options=None):
         )
         return tvm.micro.MicroLibrary(build_dir, [f"lib{project_name}.a"])
 
+    def _print_make_statistics(self, output):
+        print("==================")

Review comment:
       want to print this after you see "Memory region"?

##########
File path: python/tvm/micro/contrib/zephyr.py
##########
@@ -204,6 +204,22 @@ def library(self, output, sources, options=None):
         )
         return tvm.micro.MicroLibrary(build_dir, [f"lib{project_name}.a"])
 
+    def _print_make_statistics(self, output):
+        print("==================")
+        output = output.splitlines()
+        lines = iter(output)
+        for line in lines:

Review comment:
       could you catch StopIteration somewhere so that in the event the output looks weird, this doesn't break the compilation flow?

##########
File path: python/tvm/micro/contrib/zephyr.py
##########
@@ -204,6 +204,22 @@ def library(self, output, sources, options=None):
         )
         return tvm.micro.MicroLibrary(build_dir, [f"lib{project_name}.a"])
 
+    def _print_make_statistics(self, output):
+        print("==================")
+        output = output.splitlines()
+        lines = iter(output)
+        for line in lines:
+            if line.startswith("Memory region"):
+                # print statistics header
+                print(line)

Review comment:
       it might be better to use _LOG.info() rather than print, so it could be suppressed if needed




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

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