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/09/06 19:20:28 UTC

[GitHub] [tvm] mehrdadh opened a new pull request #8940: [microTVM] Change platform to device

mehrdadh opened a new pull request #8940:
URL: https://github.com/apache/tvm/pull/8940


   Since now we are supporting two microtvm platforms (zephyr, arduino), it is confusing to use platform for both zephyr/arduino and the device target (e.g. qemu_x86/nrf5340dk and due/feathers2) that we support for each platform. This PR refactors the later to microtvm_device.
   
   This PR also moves the supported microtvm devices for each platform to its microtvm_api_server.py to create a single source for supported devices. 
   
   cc @areusch @gromero 


-- 
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 #8940: [microTVM] Refactor `platform` used as board name in microTVM

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



##########
File path: tests/micro/zephyr/conftest.py
##########
@@ -20,33 +20,44 @@
 
 import pytest
 
+from tvm.micro import project
 import tvm.contrib.utils
 import tvm.target.target
 
-# The models that should pass this configuration. Maps a short, identifying platform string to
-# (model, zephyr_board).
-PLATFORMS = {
-    "qemu_x86": ("host", "qemu_x86"),
-    "qemu_riscv32": ("host", "qemu_riscv32"),
-    "qemu_riscv64": ("host", "qemu_riscv64"),
-    "mps2_an521": ("mps2_an521", "mps2_an521"),
-    "nrf5340dk": ("nrf5340dk", "nrf5340dk_nrf5340_cpuapp"),
-    "stm32f746xx_disco": ("stm32f746xx", "stm32f746g_disco"),
-    "stm32f746xx_nucleo": ("stm32f746xx", "nucleo_f746zg"),
-    "stm32l4r5zi_nucleo": ("stm32l4r5zi", "nucleo_l4r5zi"),
-    "zynq_mp_r5": ("zynq_mp_r5", "qemu_cortex_r5"),
-}
+TEMPLATE_PROJECT_DIR = (
+    pathlib.Path(__file__).parent
+    / ".."
+    / ".."
+    / ".."
+    / "apps"
+    / "microtvm"
+    / "zephyr"
+    / "template_project"
+).resolve()
+
+
+def zephyr_boards() -> dict:
+    """Returns a dict mapping board to target model"""
+    template = project.TemplateProject.from_directory(TEMPLATE_PROJECT_DIR)
+    project_options = template.info()["project_options"]
+    for option in project_options:

Review comment:
       I agree yep




-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: tests/micro/arduino/conftest.py
##########
@@ -48,13 +35,23 @@
 ).resolve()
 
 
+def arduino_micro_devices() -> dict:
+    sys.path.insert(0, str(TEMPLATE_PROJECT_DIR))
+    try:
+        import microtvm_api_server
+    finally:
+        sys.path.pop(0)
+
+    return microtvm_api_server.MICRO_DEVICES
+
+
 def pytest_addoption(parser):
     parser.addoption(
-        "--microtvm-platforms",

Review comment:
       sorry the previous top-level comment was about this flag in both the arduino and zephyr tests




-- 
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 #8940: [microTVM] Change platform to device

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #8940:
URL: https://github.com/apache/tvm/pull/8940#issuecomment-915504971


   @areusch @gromero @guberti Thanks for the reviews.
   I have updated conftest.py for each platform to use project options for board choices and updated the terminology to use zephyr-board and arduino-board for each.
   
   As a result of using zephyr-board directly for zephyr tests, we have to remove `nrf5340dk` as a choice and use the board name which is `nrf5340dk_nrf5340_cpuapp`. I updated the tutorial that uses this board.


-- 
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 merged pull request #8940: [microTVM] Refactor `platform` used as board name in microTVM

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


   


-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: apps/microtvm/zephyr/template_project/microtvm_api_server.py
##########
@@ -57,6 +57,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, zephyr_board).
+MICRO_DEVICES = {
+    "qemu_x86": ("host", "qemu_x86"),

Review comment:
       OK for me to move  it into the server side. Same comment applies here as for the arduino devices above.

##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -43,6 +43,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, arduino_board).
+MICRO_DEVICES = {

Review comment:
       OK for me to move it into the server side. In fact I'm planing to add that list as the choices for PROJECT_OPTIONS '{zephyr,arduino}_board` option because currently the API doesn't do that. That's necessary for the TVMC + micro targets work. So that change concur with what I'm planning.

##########
File path: apps/microtvm/reference-vm/README.md
##########
@@ -72,20 +72,20 @@ For example:
 $ ./base-box-tool.py --provider virtualbox build zephyr
 ```
 
-2. **Run** release tests for each platform:
+2. **Run** release tests for each microTVM device:

Review comment:
       I think that 'platform' here actually refers to PLATFORM (like `zephyr` or `arduino`), so not related to MICROTVM_PLATFORM. Hence that's an occurrence of 'platform' that is correct and should not be replace in the context of the proposed change.

##########
File path: tests/micro/zephyr/conftest.py
##########
@@ -17,35 +17,42 @@
 import datetime
 import os
 import pathlib
+import sys
 
 import pytest
 
 import tvm.contrib.utils
 import tvm.target.target
 
-# The models that should pass this configuration. Maps a short, identifying platform string to
-# (model, zephyr_board).
-PLATFORMS = {
-    "qemu_x86": ("host", "qemu_x86"),
-    "qemu_riscv32": ("host", "qemu_riscv32"),
-    "qemu_riscv64": ("host", "qemu_riscv64"),
-    "mps2_an521": ("mps2_an521", "mps2_an521"),
-    "nrf5340dk": ("nrf5340dk", "nrf5340dk_nrf5340_cpuapp"),
-    "stm32f746xx_disco": ("stm32f746xx", "stm32f746g_disco"),
-    "stm32f746xx_nucleo": ("stm32f746xx", "nucleo_f746zg"),
-    "stm32l4r5zi_nucleo": ("stm32l4r5zi", "nucleo_l4r5zi"),
-    "zynq_mp_r5": ("zynq_mp_r5", "qemu_cortex_r5"),
-}
+TEMPLATE_PROJECT_DIR = (
+    pathlib.Path(__file__).parent
+    / ".."
+    / ".."
+    / ".."
+    / "apps"
+    / "microtvm"
+    / "zephyr"
+    / "template_project"
+).resolve()
+
+
+def zephyr_micro_devices() -> dict:
+    sys.path.insert(0, str(TEMPLATE_PROJECT_DIR))
+    try:
+        import microtvm_api_server
+    finally:
+        sys.path.pop(0)
+
+    return microtvm_api_server.MICRO_DEVICES

Review comment:
       Same comment on importing directly the Arduino devices applies here. Please see above.

##########
File path: tests/micro/arduino/conftest.py
##########
@@ -48,13 +35,23 @@
 ).resolve()
 
 
+def arduino_micro_devices() -> dict:
+    sys.path.insert(0, str(TEMPLATE_PROJECT_DIR))
+    try:
+        import microtvm_api_server
+    finally:
+        sys.path.pop(0)
+
+    return microtvm_api_server.MICRO_DEVICES

Review comment:
       I'm ok with importing the list of devices directly here for now. But I consider that a kind of shortcut to the API, however currently there is no way to get it via the API info query. That's another change I'm planning to submit soon because it's necessary for the TVMC + micro target work. Hence, only as a reference, that's what I'm planning
   
   https://github.com/gromero/tvm/commit/7ff1f17f31d30d806c1fd4a6cbf5e609766901e0
   
   That change would allow something like:
   
   ```
   import tvm.micro.project
   ```
   and then query the boards via the API:
   
   ```
   template = project.TemplateProject.from_directory(ZEPHYR_TEMPLATE_DIR)
   boards = template.info()["zephyr_board"]
   ```
   
   Anyways, I'm ok with importing directly for 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] guberti commented on a change in pull request #8940: [microTVM] Refactor `platform` used as board name in microTVM

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



##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -43,6 +43,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, arduino_board).
+MICRO_DEVICES = {

Review comment:
       I like this change - looks good for now. In a future PR, I would like to revisit how boards are specified, to make it easier for users to use boards that aren't explicitly in `BOARD_PROPERTIES`.

##########
File path: apps/microtvm/reference-vm/README.md
##########
@@ -72,20 +72,20 @@ For example:
 $ ./base-box-tool.py --provider virtualbox build zephyr
 ```
 
-2. **Run** release tests for each platform:
+2. **Run** release tests for each microTVM device:

Review comment:
       LGTM!




-- 
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 #8940: [microTVM] Refactor `platform` used as board name in microTVM

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



##########
File path: tests/micro/zephyr/conftest.py
##########
@@ -20,33 +20,44 @@
 
 import pytest
 
+from tvm.micro import project
 import tvm.contrib.utils
 import tvm.target.target
 
-# The models that should pass this configuration. Maps a short, identifying platform string to
-# (model, zephyr_board).
-PLATFORMS = {
-    "qemu_x86": ("host", "qemu_x86"),
-    "qemu_riscv32": ("host", "qemu_riscv32"),
-    "qemu_riscv64": ("host", "qemu_riscv64"),
-    "mps2_an521": ("mps2_an521", "mps2_an521"),
-    "nrf5340dk": ("nrf5340dk", "nrf5340dk_nrf5340_cpuapp"),
-    "stm32f746xx_disco": ("stm32f746xx", "stm32f746g_disco"),
-    "stm32f746xx_nucleo": ("stm32f746xx", "nucleo_f746zg"),
-    "stm32l4r5zi_nucleo": ("stm32l4r5zi", "nucleo_l4r5zi"),
-    "zynq_mp_r5": ("zynq_mp_r5", "qemu_cortex_r5"),
-}
+TEMPLATE_PROJECT_DIR = (
+    pathlib.Path(__file__).parent
+    / ".."
+    / ".."
+    / ".."
+    / "apps"
+    / "microtvm"
+    / "zephyr"
+    / "template_project"
+).resolve()
+
+
+def zephyr_boards() -> dict:
+    """Returns a dict mapping board to target model"""
+    template = project.TemplateProject.from_directory(TEMPLATE_PROJECT_DIR)
+    project_options = template.info()["project_options"]
+    for option in project_options:

Review comment:
       perhaps we should make a helper for this, can be a follow-on




-- 
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 edited a comment on pull request #8940: [microTVM] Change platform to device

Posted by GitBox <gi...@apache.org>.
mehrdadh edited a comment on pull request #8940:
URL: https://github.com/apache/tvm/pull/8940#issuecomment-915504971


   @areusch @gromero @guberti Thanks for the reviews.
   I have updated conftest.py for each platform to use project options for board choices and updated the terminology to use zephyr-board and arduino-board for each.
   
   As a result of using zephyr-board directly for zephyr tests, we have to remove `nrf5340dk` as a choice and use the board name which is `nrf5340dk_nrf5340_cpuapp`. I updated the tutorial that uses this board.
   
   Same thing for `stm32f746xx_nucleo`which is now we use `nucleo_f746zg`.


-- 
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 pull request #8940: [microTVM] Change platform to device

Posted by GitBox <gi...@apache.org>.
areusch commented on pull request #8940:
URL: https://github.com/apache/tvm/pull/8940#issuecomment-914619644


   i chatted a bit more with @mehrdadh about the question of how to represent the (target, arduino_board) or (target, zephyr_board) pairs. It sort of seems like the neatest solution is to place the mapping in `microtvm_api_server.py` and make `server_info_query` return a suggested `target` based on the ProjectOption provided by the user to e.g. `tvmc`. My hesitations in doing this are:
   
   1. right now Project API is entirely "downstream" of TVM--it just consumes a specified artifact of TVM and doesn't configure TVM. doing this would change that relationship. this means if TVM e.g. evolves the defintion of target to split it into pieces, Project API implementations may need to be updated. I'm not sure this is a big deal, but it's something to think on.
   2. Since we would likely move the `tvm.target.micro` shorthands into Project API servers, it means that all platforms are suggested to make a Project API implementation even if they don't use the project generator. This wouldn't be required, though--you could still specify the target the old-fashioend way. it just could be a burden in some cases. we could always alleviate it by allowing platforms to create something specific to them.
   
   right now this is essentially test configuration. I think we could continue to import microtvm_api_server from these tests until we resolve this question.


-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: apps/microtvm/reference-vm/README.md
##########
@@ -72,20 +72,20 @@ For example:
 $ ./base-box-tool.py --provider virtualbox build zephyr
 ```
 
-2. **Run** release tests for each platform:
+2. **Run** release tests for each microTVM device:

Review comment:
       as this is in context of a base box release test, i think this should use the same language as we use in tests/micro/zephyr/test_zephyr.py

##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -43,6 +43,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, arduino_board).
+MICRO_DEVICES = {

Review comment:
       i might be a bit dense here but where is this used in microtvm_api_server.py? prefer to avoid complicating that file except when necessary

##########
File path: tests/micro/arduino/conftest.py
##########
@@ -48,13 +35,23 @@
 ).resolve()
 
 
+def arduino_micro_devices() -> dict:
+    sys.path.insert(0, str(TEMPLATE_PROJECT_DIR))
+    try:
+        import microtvm_api_server
+    finally:
+        sys.path.pop(0)
+
+    return microtvm_api_server.MICRO_DEVICES

Review comment:
       i don't favor doing this. can we use the ProjectOption/choices infrastructure if we want to forward this data? this preserves the API boundary.




-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: tests/micro/arduino/conftest.py
##########
@@ -48,13 +35,23 @@
 ).resolve()
 
 
+def arduino_micro_devices() -> dict:
+    sys.path.insert(0, str(TEMPLATE_PROJECT_DIR))
+    try:
+        import microtvm_api_server
+    finally:
+        sys.path.pop(0)
+
+    return microtvm_api_server.MICRO_DEVICES

Review comment:
       Changed conftest to use choices from project options.




-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -43,6 +43,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, arduino_board).
+MICRO_DEVICES = {

Review comment:
       BTW, the confusion with "platform" in my understanding doesn't happen with the Arduino platform, because `due`, `nano33ble`, etc are indeed termed as boards by the Arduino project, hence one additional reason to s/MICRO_DEVICES/BOARDS/.




-- 
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 #8940: [microTVM] Change platform to device

Posted by GitBox <gi...@apache.org>.
mehrdadh commented on pull request #8940:
URL: https://github.com/apache/tvm/pull/8940#issuecomment-914000441


   @gromero thanks for the feedbacks. I think `micro_board` is a good option too. Initially I tried to avoid using `micro_board` term since Zephyr used board and I wanted to make sure we can differentiate those. But now that I think of it we could have micro_board which maps to (target, zephyr_board) in case of Zephyr and (target, arduino_board) in case of Arduino. Based on my understanding, "board" is unique in terms of TVM and microTVM so it shouldn't be confusing with another thing.
   
   I'll be happy to get more opinion on this before changing it to `micro_board`. cc @areusch @guberti @manupa-arm @leandron @Mousius 


-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: tests/micro/arduino/conftest.py
##########
@@ -48,13 +35,23 @@
 ).resolve()
 
 
+def arduino_micro_devices() -> dict:

Review comment:
       done.




-- 
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] guberti commented on a change in pull request #8940: [microTVM] Change platform to device

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



##########
File path: tests/micro/arduino/conftest.py
##########
@@ -48,13 +35,23 @@
 ).resolve()
 
 
+def arduino_micro_devices() -> dict:

Review comment:
       Can we cache this value? `arduino_micro_devices()` will probably be called several times by our test file.

##########
File path: apps/microtvm/reference-vm/README.md
##########
@@ -72,20 +72,20 @@ For example:
 $ ./base-box-tool.py --provider virtualbox build zephyr
 ```
 
-2. **Run** release tests for each platform:
+2. **Run** release tests for each microTVM device:

Review comment:
       ```suggestion
   2. **Run** release tests for the specified `MICROTVM_DEVICE` (e.g. `nano33ble` for Arduino)
   ```
   I don't actually think `base-box-tool.py` supports testing more than one microTVM device at once.

##########
File path: apps/microtvm/reference-vm/README.md
##########
@@ -72,20 +72,20 @@ For example:
 $ ./base-box-tool.py --provider virtualbox build zephyr
 ```
 
-2. **Run** release tests for each platform:
+2. **Run** release tests for each microTVM device:
 
    A. Connect any needed hardware to the VM host machine;
 
    B. Run tests:
    ```bash
-   $ ./base-box-tool.py [--provider=PROVIDER] test --microtvm-platform=MICROTVM_PLATFORM [--test-device-serial=SERIAL] PLATFORM
+   $ ./base-box-tool.py [--provider=PROVIDER] test --microtvm-device=MICROTVM_DEVICE [--test-device-serial=SERIAL] PLATFORM
    ```
-   where MICROTVM_PLATFORM is one of the options listed in the
+   where MICROTVM_DEVICE is one of the options listed in the
    PLATFORM/base-box/test-config.json file.
 
    For example:
    ```base
-   $ ./base-box-tool.py --provider virtualbox test --microtvm-platform=stm32f746xx_disco zephyr
+   $ ./base-box-tool.py --provider virtualbox test --microtvm-device=stm32f746xx_disco zephyr

Review comment:
       ```suggestion
      $ ./base-box-tool.py --provider virtualbox test zephyr --microtvm-device=stm32f746xx_disco
   ```
   I'd love to specify `microtvm-device` after setting `platform` to Arduino/Zephyr in the example commands, to help reinforce that the options for what `microtvm-device` can be depend on the choice of platform. I'd love to do this for all other example `test` commands in this file as well.

##########
File path: apps/microtvm/zephyr/template_project/microtvm_api_server.py
##########
@@ -57,6 +57,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, zephyr_board).
+MICRO_DEVICES = {
+    "qemu_x86": ("host", "qemu_x86"),

Review comment:
       ^

##########
File path: tests/micro/arduino/conftest.py
##########
@@ -48,13 +35,23 @@
 ).resolve()
 
 
+def arduino_micro_devices() -> dict:
+    sys.path.insert(0, str(TEMPLATE_PROJECT_DIR))
+    try:
+        import microtvm_api_server
+    finally:
+        sys.path.pop(0)
+
+    return microtvm_api_server.MICRO_DEVICES

Review comment:
       I'm with Andrew - is there any way this can be done by reading the choices from `ProjectOption`?

##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -43,6 +43,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, arduino_board).
+MICRO_DEVICES = {

Review comment:
       I agree with @gromero that `BOARDS` is a better name for these than `MICRO_DEVICES`. However, I don't like the idea of having the identifying device string map hard-coded into `microtvm_api_server.py`. 
   
   Could we merge the `MICRO_DEVICES/BOARDS` and `BOARD_PROPERTIES` into a single `boards.json` file? That way, we wouldn't have to edit `microtvm_api_server.py` whenever a new Arduino board is tested and shown to work with TVM (and will also make `microtvm_api_server.py`like 80 lines shorter). 




-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: apps/microtvm/arduino/template_project/microtvm_api_server.py
##########
@@ -43,6 +43,19 @@
 
 IS_TEMPLATE = not (API_SERVER_DIR / MODEL_LIBRARY_FORMAT_RELPATH).exists()
 
+# Maps a short, identifying microtvm device string to (target, arduino_board).
+MICRO_DEVICES = {

Review comment:
       I added the model info for each board to BOARD_PROPERTIES for Arduino and added BOARD_PROPERTIES for zephyr.




-- 
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 #8940: [microTVM] Change platform to device

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



##########
File path: apps/microtvm/reference-vm/README.md
##########
@@ -72,20 +72,20 @@ For example:
 $ ./base-box-tool.py --provider virtualbox build zephyr
 ```
 
-2. **Run** release tests for each platform:
+2. **Run** release tests for each microTVM device:

Review comment:
       revert to platform.




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