[microTVM] Arduino: Fix MLF archive filename in generated project dir#9320
Merged
Merged
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 <gustavo.romero@linaro.org>
Contributor
Author
Contributor
Author
|
Found when reviewing #9289 |
Member
|
@gromero is it possible to replicate the scenario in a test? |
Contributor
Author
@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...). |
guberti
approved these changes
Oct 22, 2021
guberti
left a comment
Member
There was a problem hiding this comment.
LGTM, but we should add a test. LMK if you want me to take a crack at writing the test!
Contributor
Author
|
@guberti Thanks for the review. Yes, please, if you can |
Contributor
Author
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 7, 2022
…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 <gustavo.romero@linaro.org> * Retrigger CI
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 13, 2022
…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 <gustavo.romero@linaro.org> * Retrigger CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 gustavo.romero@linaro.org
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.