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/01/28 11:45:23 UTC

[GitHub] [tvm] grant-arm opened a new pull request #10095: [mircoTVM] Include standalone_crt dependencies in MLF

grant-arm opened a new pull request #10095:
URL: https://github.com/apache/tvm/pull/10095


   This PR includes the standalone_crt files in the MLF tarball if the runtime is `crt` .
   It also updates the `metadata.json` file as described in the ["Capturing dependent libraries..." discussion](https://discuss.tvm.apache.org/t/tvm-capturing-dependent-libraries-of-code-generated-tir-initially-for-use-in-model-library-format/11080/9) in the Discuss forums.
   
    * Adds runtime to AOTExecutorFactoryModule
    * Standalone CRT files are added to MLF tarball if runtime is crt
    * external_dependencies info added to metadata.json for crt runtime
    * microNPU demo Makefile references standalone crt files from MLF tarball
   
   @manupa-arm @Mousius @areusch 
   


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



[GitHub] [tvm] Mousius merged pull request #10095: [microTVM] Include standalone_crt dependencies in MLF

Posted by GitBox <gi...@apache.org>.
Mousius merged pull request #10095:
URL: https://github.com/apache/tvm/pull/10095


   


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



[GitHub] [tvm] leandron commented on a change in pull request #10095: [microTVM] Include standalone_crt dependencies in MLF

Posted by GitBox <gi...@apache.org>.
leandron commented on a change in pull request #10095:
URL: https://github.com/apache/tvm/pull/10095#discussion_r794740072



##########
File path: python/tvm/micro/model_library_format.py
##########
@@ -287,6 +288,9 @@ def reset(tarinfo):
             return tarinfo
 
         tar_f.add(str(source_dir), arcname=".", filter=reset)
+        is_aot = isinstance(mod, executor_factory.AOTExecutorFactoryModule)
+        if is_aot and str(mod.runtime) == "crt":
+            tar_f.add(get_standalone_crt_dir(), arcname="./runtime")

Review comment:
       Can we convert this `./runtime` to be a a variable defined somewhere. So that we can also use it everywhere we need this path identifier, for example, in the `standalone_crt = { ...` definition below around line `327`?

##########
File path: python/tvm/micro/model_library_format.py
##########
@@ -317,6 +321,16 @@ def _export_graph_model_library_format(
         "style": "full-model",
     }
 
+    if is_aot and (str(mod.runtime) == "crt"):
+        standalone_crt = {
+            "short_name": "tvm_standalone_crt",
+            "url": "./runtime",

Review comment:
       here ^




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



[GitHub] [tvm] grant-arm commented on a change in pull request #10095: [microTVM] Include standalone_crt dependencies in MLF

Posted by GitBox <gi...@apache.org>.
grant-arm commented on a change in pull request #10095:
URL: https://github.com/apache/tvm/pull/10095#discussion_r794829776



##########
File path: python/tvm/micro/model_library_format.py
##########
@@ -317,6 +321,16 @@ def _export_graph_model_library_format(
         "style": "full-model",
     }
 
+    if is_aot and (str(mod.runtime) == "crt"):
+        standalone_crt = {
+            "short_name": "tvm_standalone_crt",
+            "url": "./runtime",

Review comment:
       Thanks for the feedback @leandron . I've changed this now.




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



[GitHub] [tvm] Mousius commented on a change in pull request #10095: [mircoTVM] Include standalone_crt dependencies in MLF

Posted by GitBox <gi...@apache.org>.
Mousius commented on a change in pull request #10095:
URL: https://github.com/apache/tvm/pull/10095#discussion_r794436250



##########
File path: apps/microtvm/ethosu/Makefile
##########
@@ -19,13 +19,13 @@
 
 # Setup build environment
 BUILD_DIR := build
-STANDALONE_CRT_PATH := $(shell python3 -c "import tvm.micro; print(tvm.micro.get_standalone_crt_dir())")
 
 ARM_CPU = ARMCM55
 ETHOSU_PATH = /opt/arm/ethosu
 ETHOSU_DRIVER_PATH ?= ${ETHOSU_PATH}/core_driver
 CMSIS_PATH ?= ${ETHOSU_PATH}/cmsis
 ETHOSU_PLATFORM_PATH ?= ${ETHOSU_PATH}/core_platform
+STANDALONE_CRT_PATH := $(abspath $(BUILD_DIR))/$(shell python3 -c "import json; data=json.load(open('./build/metadata.json')); print([e for e in data['external_dependencies'] if e['short_name'] == 'tvm_standalone_crt'][0]['url'])")

Review comment:
       Do we need this to be dynamic now? I'd expect a user to just encode it as part of the demo




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



[GitHub] [tvm] grant-arm commented on a change in pull request #10095: [mircoTVM] Include standalone_crt dependencies in MLF

Posted by GitBox <gi...@apache.org>.
grant-arm commented on a change in pull request #10095:
URL: https://github.com/apache/tvm/pull/10095#discussion_r794448151



##########
File path: apps/microtvm/ethosu/Makefile
##########
@@ -19,13 +19,13 @@
 
 # Setup build environment
 BUILD_DIR := build
-STANDALONE_CRT_PATH := $(shell python3 -c "import tvm.micro; print(tvm.micro.get_standalone_crt_dir())")
 
 ARM_CPU = ARMCM55
 ETHOSU_PATH = /opt/arm/ethosu
 ETHOSU_DRIVER_PATH ?= ${ETHOSU_PATH}/core_driver
 CMSIS_PATH ?= ${ETHOSU_PATH}/cmsis
 ETHOSU_PLATFORM_PATH ?= ${ETHOSU_PATH}/core_platform
+STANDALONE_CRT_PATH := $(abspath $(BUILD_DIR))/$(shell python3 -c "import json; data=json.load(open('./build/metadata.json')); print([e for e in data['external_dependencies'] if e['short_name'] == 'tvm_standalone_crt'][0]['url'])")

Review comment:
       I wasn't sure which way to go with this.
   I've hard-coded it in the demo Makefile now, which I agree feels more natural.




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