-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[microTVM] Add platform version check to template project #9274
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
Conversation
| def generate_project(self, model_library_format_path, standalone_crt_dir, project_dir, options): | ||
| # Check Arduino version | ||
| version = self._get_platform_version(options["arduino_cli_cmd"]) | ||
| if version != ARDUINO_CLI_VERSION: |
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'm not sure we should do an exact match check. cc @guberti do you have a better suggestion as to how loose we should be? i could even just be okay with a warning
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 think two levels of version, Major + Minor, is enough. We don't need to check the patch level version since they usually don't change interfaces. I discussed this with @gromero and that seems to be the case for Zephyr. For Arduino I got the same impression based on their release messages: https://github.com/arduino/arduino-cli/releases
@guberti probably has more info here.
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.
Yea the Arduino CLI seems to be relatively stable - this looks fine to me.
gromero
left a comment
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 @mehrdadh Only regarding the Zephyr platform changes and considering the nit pointed by Andrew is fixed, LGTM! I think that's a nice enhancement and that it's right for now to match exactly against Zephyr MAJOR and MINOR versions and so treat the version as a string. In the future if 2.5 becomes the minimum version supported on microTVM (not an exact match) we can easily adapt the code to match against, for instance, a float, like it's done in https://github.com/apache/tvm/blob/main/python/tvm/topi/arm_cpu/arm_utils.py#L24
Thanks!
8c73aed to
1b0077c
Compare
|
@gromero thanks for the review. |
gromero
left a comment
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 missed these two typos on my last review. Could you please fix them?
Otherwise LGTM!
gromero
left a comment
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 can't comment on Arduino versioning, but since we now just warn when versions don't match rather than abort by default I'm ok with it. Plus the versioning mechanism can now be used for non exact matches, so LGTM. Thanks.
|
@areusch PTAL when you have time. |
areusch
left a comment
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 sorry for delay--mostly small things here.
guberti
left a comment
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.
Looks good to me! Sorry about the delay caused by my midterms and being sick.
| def generate_project(self, model_library_format_path, standalone_crt_dir, project_dir, options): | ||
| # Check Arduino version | ||
| version = self._get_platform_version(options["arduino_cli_cmd"]) | ||
| if version != ARDUINO_CLI_VERSION: |
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.
Yea the Arduino CLI seems to be relatively stable - this looks fine to me.
| def _get_platform_version(self, arduino_cli_path: str) -> float: | ||
| version_output = subprocess.check_output([arduino_cli_path, "version"], encoding="utf-8") | ||
| version_output = ( | ||
| version_output.replace("\n", "").replace("\r", "").replace(":", "").lower().split(" ") |
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.
What exactly is this line stripping out? Can we use a regex or .strip()? I'd love to see a comment here with the standard output of arduino-cli version so I can better understand what's happening here.
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.
thanks for the review. I will add the format as a comment and change it to use regex in the following PR which is waiting for this:
#9309
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'm not an expert in microTVM, but the other parts LGTM
|
@junrushao1994 sounds good to me. thanks! |
* add platform version to project template * fix arduino cli version on qemu * specify arduino/zephyr version everywhere * cleanup * address comments * fix warning message * fix typo * trigger * trigger * address comments * trigger * trigger
* add platform version to project template * fix arduino cli version on qemu * specify arduino/zephyr version everywhere * cleanup * address comments * fix warning message * fix typo * trigger * trigger * address comments * trigger * trigger
This PR: