-
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
[TVMC] run: Don't use static path to find model.tar #9712
Merged
Merged
Conversation
This file contains 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
Currently 'tvmc run' when '--device micro' is specified looks for the model in the project directory at <project_dir>/model.tar. That works for Zephyr but fails on Arduino because model.tar is actually located at <project_dir>/src/model/model.tar. As a consequence 'tvmc run' when used to run a model on Arduino exists because model.tar is never found. This commit fixes it by using the MLF path returned by the Project API instead of using a static path. This commit also adds a project_dir attribute to TVMCPackage that can be set when a MLF archive is loaded/imported so the project dir can be conveniently found (similarly to package_path attribute). Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Add test for TVMCPackage when importing a MLF archive and setting a project directory too. Setting a project dir is only supported when a MLF model is imported, so it must fail on Classic format. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
gromero
requested review from
areusch,
comaniac,
icemelon,
jroesch,
junrushao,
jwfromm,
leandron,
merrymercy,
tqchen and
yzhliu
as code owners
December 10, 2021 22:40
leandron
approved these changes
Dec 13, 2021
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 for this fix @gromero!
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 7, 2022
* [TVMC] run: Don't use static path to find model.tar Currently 'tvmc run' when '--device micro' is specified looks for the model in the project directory at <project_dir>/model.tar. That works for Zephyr but fails on Arduino because model.tar is actually located at <project_dir>/src/model/model.tar. As a consequence 'tvmc run' when used to run a model on Arduino exists because model.tar is never found. This commit fixes it by using the MLF path returned by the Project API instead of using a static path. This commit also adds a project_dir attribute to TVMCPackage that can be set when a MLF archive is loaded/imported so the project dir can be conveniently found (similarly to package_path attribute). Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> * [TVMC] test: Add test for importing a MLF with project_dir Add test for TVMCPackage when importing a MLF archive and setting a project directory too. Setting a project dir is only supported when a MLF model is imported, so it must fail on Classic format. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
yangulei
pushed a commit
to yangulei/tvm
that referenced
this pull request
Jan 11, 2022
* [TVMC] run: Don't use static path to find model.tar Currently 'tvmc run' when '--device micro' is specified looks for the model in the project directory at <project_dir>/model.tar. That works for Zephyr but fails on Arduino because model.tar is actually located at <project_dir>/src/model/model.tar. As a consequence 'tvmc run' when used to run a model on Arduino exists because model.tar is never found. This commit fixes it by using the MLF path returned by the Project API instead of using a static path. This commit also adds a project_dir attribute to TVMCPackage that can be set when a MLF archive is loaded/imported so the project dir can be conveniently found (similarly to package_path attribute). Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> * [TVMC] test: Add test for importing a MLF with project_dir Add test for TVMCPackage when importing a MLF archive and setting a project directory too. Setting a project dir is only supported when a MLF model is imported, so it must fail on Classic format. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
yangulei
pushed a commit
to yangulei/tvm
that referenced
this pull request
Jan 12, 2022
* [TVMC] run: Don't use static path to find model.tar Currently 'tvmc run' when '--device micro' is specified looks for the model in the project directory at <project_dir>/model.tar. That works for Zephyr but fails on Arduino because model.tar is actually located at <project_dir>/src/model/model.tar. As a consequence 'tvmc run' when used to run a model on Arduino exists because model.tar is never found. This commit fixes it by using the MLF path returned by the Project API instead of using a static path. This commit also adds a project_dir attribute to TVMCPackage that can be set when a MLF archive is loaded/imported so the project dir can be conveniently found (similarly to package_path attribute). Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> * [TVMC] test: Add test for importing a MLF with project_dir Add test for TVMCPackage when importing a MLF archive and setting a project directory too. Setting a project dir is only supported when a MLF model is imported, so it must fail on Classic format. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
ylc
pushed a commit
to ylc/tvm
that referenced
this pull request
Jan 13, 2022
* [TVMC] run: Don't use static path to find model.tar Currently 'tvmc run' when '--device micro' is specified looks for the model in the project directory at <project_dir>/model.tar. That works for Zephyr but fails on Arduino because model.tar is actually located at <project_dir>/src/model/model.tar. As a consequence 'tvmc run' when used to run a model on Arduino exists because model.tar is never found. This commit fixes it by using the MLF path returned by the Project API instead of using a static path. This commit also adds a project_dir attribute to TVMCPackage that can be set when a MLF archive is loaded/imported so the project dir can be conveniently found (similarly to package_path attribute). Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> * [TVMC] test: Add test for importing a MLF with project_dir Add test for TVMCPackage when importing a MLF archive and setting a project directory too. Setting a project dir is only supported when a MLF model is imported, so it must fail on Classic format. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
qsqqsqqsq-intellif
pushed a commit
to qsqqsqqsq-intellif/tvm
that referenced
this pull request
Apr 29, 2022
* [TVMC] run: Don't use static path to find model.tar Currently 'tvmc run' when '--device micro' is specified looks for the model in the project directory at <project_dir>/model.tar. That works for Zephyr but fails on Arduino because model.tar is actually located at <project_dir>/src/model/model.tar. As a consequence 'tvmc run' when used to run a model on Arduino exists because model.tar is never found. This commit fixes it by using the MLF path returned by the Project API instead of using a static path. This commit also adds a project_dir attribute to TVMCPackage that can be set when a MLF archive is loaded/imported so the project dir can be conveniently found (similarly to package_path attribute). Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org> * [TVMC] test: Add test for importing a MLF with project_dir Add test for TVMCPackage when importing a MLF archive and setting a project directory too. Setting a project dir is only supported when a MLF model is imported, so it must fail on Classic format. Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
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
tvmc run
can't run Arduino models becausemodel.tar
is never found:This happens because Arduino doesn't store
model.tar
in<project_dir>/model.tar
like Zephyr.If this change is applied the MLF path used is taken as returned by the Project API, so
tvmc run
now works for both Zephyr and Arduino and any future platforms: