-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[microTVM] Refactor platform
used as board name in microTVM
#8940
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. Thanks for the change. The first time I crossed with the option --microtvm-platforms
and found it was actually listing the boards it stroke me with a certain oddness, so I think it makes sense to change it, yeah.
On microTVM world that overload of what a platform means is imho understandable. I believe it happens because Zephyr and Arduino are regarded (correctly in my opinion) as platforms for microTVM and at the same time a board (for instance mps2_an521, among others) is considered a platform for the Zephyr project, thus since Zephyr was the first platform widely experimented on microTVM what is considered a platform by microTVM was the same what was considered by Zephyr, hence the confusion with board and platform I believe.
But as you said now there is the Arduino platform and it makes sense to review the terms.
That said, on various contexts, like on the USB vid and pid in base-tool-box.py where the USB ids are actually tied to a dev board (like the disco board), but mainly because I think that the devices in MICRO_DEVICES
must become the same in the list returned by the Project API query info method as choices
for the platform board option ( optionzephyr_board
and arduino_board
more precisely) I think the best fit here would be to replace "platform" by "board" in all cases I can think of now. Wdyt of s/MICRO_DEVICES/BOARDS/?
@gromero thanks for the feedbacks. I think I'll be happy to get more opinion on this before changing it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mehrdadh thanks for raising this. I think we have several concepts here. here's how i think of them:
platform
-- which RTOS we are usingdevice
-- which hardware is being tested againsttarget
-- the TVM target string, which for now means the whole system but in the future (e.g. with heterogenous execution) may mean just e.g. the CPU or accelerator- this flag, which kind of does double-duty
what do you think about --test-setting
or --test-environment
? i think that might be a bit more accurate for the test_zephyr.py
and base_box_tool.py
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of changing microtvm-platforms
to microtvm-device
, but we need to settle on a better solution is passed between the client and the server - see above comments.
apps/microtvm/reference-vm/README.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ ./base-box-tool.py --provider virtualbox test --microtvm-device=stm32f746xx_disco zephyr | |
$ ./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.
@areusch @gromero @guberti Thanks for the reviews. As a result of using zephyr-board directly for zephyr tests, we have to remove Same thing for |
platform
used as board name in microTVM
71a8cd3
to
3af0e93
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps we should make a helper for this, can be a follow-on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks Mehrdad!
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 platform to (arduino/zephyr)_board.
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