-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] Arduino: Fix MLF archive filename in generated project dir #9320
[microTVM] Arduino: Fix MLF archive filename in generated project dir #9320
Conversation
Currently generate_project API method is copying the input MLF archive filename without renaming it to "model.tar" - hence not in accordance with the specification. As a consequence when the server looks for that file to determine if it's a project dir or a template dir it always determines it is a template dir since "model.tar" can never be found, so a TemplateProjectError() exception is thrown when instantiating a GeneratedProject class. This commit fixes that by correctly copying the input MLF archive to the newly generated project dir as "model.tar" so the server can find it. It also takes the chance to change the MLF path returned by server_info_query method: only if it's not a template dir the MLF path is returned, otherwise an empty string is returned (it doesn't make sense to return a MLF path when it's a template dir because there isn't any model associated to a template dir). Signed-off-by: Gustavo Romero <[email protected]>
Found when reviewing #9289 |
@gromero is it possible to replicate the scenario in a test? |
@Mousius Yes, below is a repro. So all a test needs to do is generate a project dir based on Arduino default template. I haven't looked closely why current tests don't catch it (I tried to run them for Arduino "due" board and they pass, afaics they are not flashing anything to the board as we do on Zephyr tests...).
|
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, but we should add a test. LMK if you want me to take a crack at writing the test!
@guberti Thanks for the review. Yes, please, if you can |
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 - I assume @guberti will send a test case in a separate PR, so we can merge this for now to fix the issue.
…apache#9320) * [microTVM] Arduino: Fix MLF archive filename in generated project dir Currently generate_project API method is copying the input MLF archive filename without renaming it to "model.tar" - hence not in accordance with the specification. As a consequence when the server looks for that file to determine if it's a project dir or a template dir it always determines it is a template dir since "model.tar" can never be found, so a TemplateProjectError() exception is thrown when instantiating a GeneratedProject class. This commit fixes that by correctly copying the input MLF archive to the newly generated project dir as "model.tar" so the server can find it. It also takes the chance to change the MLF path returned by server_info_query method: only if it's not a template dir the MLF path is returned, otherwise an empty string is returned (it doesn't make sense to return a MLF path when it's a template dir because there isn't any model associated to a template dir). Signed-off-by: Gustavo Romero <[email protected]> * Retrigger CI
…apache#9320) * [microTVM] Arduino: Fix MLF archive filename in generated project dir Currently generate_project API method is copying the input MLF archive filename without renaming it to "model.tar" - hence not in accordance with the specification. As a consequence when the server looks for that file to determine if it's a project dir or a template dir it always determines it is a template dir since "model.tar" can never be found, so a TemplateProjectError() exception is thrown when instantiating a GeneratedProject class. This commit fixes that by correctly copying the input MLF archive to the newly generated project dir as "model.tar" so the server can find it. It also takes the chance to change the MLF path returned by server_info_query method: only if it's not a template dir the MLF path is returned, otherwise an empty string is returned (it doesn't make sense to return a MLF path when it's a template dir because there isn't any model associated to a template dir). Signed-off-by: Gustavo Romero <[email protected]> * Retrigger CI
Currently generate_project API method is copying the input MLF archive
filename without renaming it to "model.tar" - hence not in accordance
with the specification. As a consequence when the server looks for that
file to determine if it's a project dir or a template dir it always
determines it is a template dir since "model.tar" can never be found, so
a TemplateProjectError() exception is thrown when instantiating a
GeneratedProject class.
This commit fixes that by correctly copying the input MLF archive to
the newly generated project dir as "model.tar" so the server can find
it.
It also takes the chance to change the MLF path returned by
server_info_query method: only if it's not a template dir the MLF path
is returned, otherwise an empty string is returned (it doesn't make
sense to return a MLF path when it's a template dir because there isn't
any model associated to a template dir).
Signed-off-by: Gustavo Romero [email protected]
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.