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/10/18 16:02:37 UTC
[GitHub] [tvm] mehrdadh opened a new pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
mehrdadh opened a new pull request #9309:
URL: https://github.com/apache/tvm/pull/9309
This PR:
- adds Zephyr/Arduino template projects to TVM build
- changes microTVM test and tutorials to use template directory from TVM build which makes it compatible to run using both TVM build from repository and tlcpack pip package.
- Adds microtvm template directories to setup.py
This PR is currently waiting on https://github.com/apache/tvm/pull/9274 and https://github.com/apache/tvm/pull/9289 to merge.
cc @areusch @leandron
--
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] mehrdadh commented on pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#issuecomment-951204820
@junrushao1994 this PR is a step towards adding microtvm project API to pip package. Please take a look when you have time. thanks!
--
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] mehrdadh commented on a change in pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#discussion_r740390855
##########
File path: cmake/modules/Arduino.cmake
##########
@@ -0,0 +1,78 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+if(USE_MICRO)
+ message(STATUS "Add Arduino for microTVM")
+
+ function(microtvm_add_arduino)
+ list(
+ APPEND
+ ARDUINO_FILE_COPY_JOBS
+ "apps/microtvm/arduino/template_project microtvm_api_server.py -> arduino"
Review comment:
we could. the only file that we don't need there is the README file.
--
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] areusch commented on a change in pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
areusch commented on a change in pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#discussion_r739419339
##########
File path: cmake/modules/Arduino.cmake
##########
@@ -0,0 +1,78 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+if(USE_MICRO)
+ message(STATUS "Add Arduino for microTVM")
+
+ function(microtvm_add_arduino)
+ list(
+ APPEND
+ ARDUINO_FILE_COPY_JOBS
+ "apps/microtvm/arduino/template_project microtvm_api_server.py -> arduino"
Review comment:
should we not copy the whole template_project?
##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -287,11 +288,11 @@ def _find_modified_include_path(self, project_dir, file_path, include_path):
return include_path
def _get_platform_version(self, arduino_cli_path: str) -> float:
+ # sample output of this command:
+ # 'arduino-cli alpha Version: 0.18.3 Commit: d710b642 Date: 2021-05-14T12:36:58Z\n'
version_output = subprocess.check_output([arduino_cli_path, "version"], encoding="utf-8")
- version_output = (
- version_output.replace("\n", "").replace("\r", "").replace(":", "").lower().split(" ")
- )
- full_version = version_output[version_output.index("version") + 1].split(".")
+ full_version = re.findall("version: ([\.0-9]*)", version_output.lower())
Review comment:
nit: should add `r" string prefix` (see https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals regarding backslashes)
--
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] mehrdadh commented on a change in pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#discussion_r735779991
##########
File path: python/tvm/micro/build.py
##########
@@ -34,10 +35,24 @@
STANDALONE_CRT_DIR = None
+class MicroTVMTemplateProject(enum.Enum):
+ ZEPHYR = "zephyr"
+ ARDUINO = "arduino"
+ CRT = "crt"
Review comment:
It's located [here](https://github.com/apache/tvm/tree/main/src/runtime/crt/host). We used this CRT host template project for CRT tests and also tutorials.
--
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 pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
leandron commented on pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#issuecomment-956428146
> @mehrdadh a couple comments, can address in a follow-on if they merit changes
Sorry I merged it because I thought it was only pending on me. Can we push fixes on follow up PRs?
--
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] areusch commented on a change in pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
areusch commented on a change in pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#discussion_r739419339
##########
File path: cmake/modules/Arduino.cmake
##########
@@ -0,0 +1,78 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+if(USE_MICRO)
+ message(STATUS "Add Arduino for microTVM")
+
+ function(microtvm_add_arduino)
+ list(
+ APPEND
+ ARDUINO_FILE_COPY_JOBS
+ "apps/microtvm/arduino/template_project microtvm_api_server.py -> arduino"
Review comment:
should we not copy the whole template_project?
##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -287,11 +288,11 @@ def _find_modified_include_path(self, project_dir, file_path, include_path):
return include_path
def _get_platform_version(self, arduino_cli_path: str) -> float:
+ # sample output of this command:
+ # 'arduino-cli alpha Version: 0.18.3 Commit: d710b642 Date: 2021-05-14T12:36:58Z\n'
version_output = subprocess.check_output([arduino_cli_path, "version"], encoding="utf-8")
- version_output = (
- version_output.replace("\n", "").replace("\r", "").replace(":", "").lower().split(" ")
- )
- full_version = version_output[version_output.index("version") + 1].split(".")
+ full_version = re.findall("version: ([\.0-9]*)", version_output.lower())
Review comment:
nit: should add `r" string prefix` (see https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals regarding backslashes)
--
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] mehrdadh commented on pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#issuecomment-956429654
@leandron I will send a patch.
--
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 pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
leandron commented on pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#issuecomment-956428146
> @mehrdadh a couple comments, can address in a follow-on if they merit changes
Sorry I merged it because I thought it was only pending on me. Can we push fixes on follow up PRs?
--
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] mehrdadh commented on pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#issuecomment-956429654
@leandron I will send a patch.
--
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 merged pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
leandron merged pull request #9309:
URL: https://github.com/apache/tvm/pull/9309
--
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] gromero commented on a change in pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
gromero commented on a change in pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#discussion_r735181213
##########
File path: python/tvm/micro/build.py
##########
@@ -34,10 +35,24 @@
STANDALONE_CRT_DIR = None
+class MicroTVMTemplateProject(enum.Enum):
+ ZEPHYR = "zephyr"
+ ARDUINO = "arduino"
+ CRT = "crt"
Review comment:
Hi @mehrdadh Could you please elaborate why CRT is considered to be a Template Project?
--
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 merged pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
leandron merged pull request #9309:
URL: https://github.com/apache/tvm/pull/9309
--
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] mehrdadh commented on a change in pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on a change in pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#discussion_r740390855
##########
File path: cmake/modules/Arduino.cmake
##########
@@ -0,0 +1,78 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+if(USE_MICRO)
+ message(STATUS "Add Arduino for microTVM")
+
+ function(microtvm_add_arduino)
+ list(
+ APPEND
+ ARDUINO_FILE_COPY_JOBS
+ "apps/microtvm/arduino/template_project microtvm_api_server.py -> arduino"
Review comment:
we could. the only file that we don't need there is the README file.
--
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] mehrdadh commented on pull request #9309: [microTVM] Add microTVM Template Projects to tlcpack pip Package
Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #9309:
URL: https://github.com/apache/tvm/pull/9309#issuecomment-954014214
@leandron just a friendly reminder about this PR. thanks!
--
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