Skip to content
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] micro, run: Disable micro support when USE_MICRO=OFF #9632

Conversation

gromero
Copy link
Contributor

@gromero gromero commented Dec 1, 2021

Do not generate 'tvmc micro' subcommand and disable micro device option
in 'tvmc run' when TVM is built without support for microTVM, i.e. with
set(USE_MICRO OFF).

Otherwise tvmc will crash on importing any tvm.micro module / class. For instance:

gromero@amd:~/git/tvm/build$ tvmc -h 
Traceback (most recent call last):
  File "/home/gromero/git/tvm/python/tvm/micro/session.py", line 35, in <module>
    from .base import _rpc_connect
ImportError: cannot import name '_rpc_connect' from 'tvm.micro.base' (/home/gromero/git/tvm/python/tvm/micro/base.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 188, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib/python3.9/runpy.py", line 147, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib/python3.9/runpy.py", line 111, in _get_module_details
    __import__(pkg_name)
  File "/home/gromero/git/tvm/python/tvm/driver/tvmc/__init__.py", line 22, in <module>
    from . import micro
  File "/home/gromero/git/tvm/python/tvm/driver/tvmc/micro.py", line 26, in <module>
    import tvm.micro.project as project
  File "/home/gromero/git/tvm/python/tvm/micro/__init__.py", line 28, in <module>
    from .session import (
  File "/home/gromero/git/tvm/python/tvm/micro/session.py", line 37, in <module>
    raise ImportError("micro tvm is not enabled. Set USE_MICRO to ON in config.cmake")
ImportError: micro tvm is not enabled. Set USE_MICRO to ON in config.cmake
gromero@amd:~/git/tvm/build$ 

For any user, which is bad specially for the ones not interested in using tvmc for micro targets.

@gromero
Copy link
Contributor Author

gromero commented Dec 1, 2021

cc @areusch @leandron @mehrdadh for reviews.

Do not generate 'tvmc micro' subcommand and disable micro device option
in 'tvmc run' when TVM is built without support for microTVM, i.e. with
set(USE_MICRO OFF).

Signed-off-by: Gustavo Romero <[email protected]>
@gromero gromero force-pushed the tvmc-disable-micro-support-if-not-build-with-microtvm branch from 818b36f to 2ed59eb Compare December 2, 2021 02:54
Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leandron
Copy link
Contributor

leandron commented Dec 2, 2021

So given @ZQPei agreement in #9619, let merge this one.

@leandron leandron merged commit 724f35e into apache:main Dec 2, 2021
@leandron
Copy link
Contributor

leandron commented Dec 2, 2021

Thanks @gromero @ZQPei and @mehrdadh!

ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
)

Do not generate 'tvmc micro' subcommand and disable micro device option
in 'tvmc run' when TVM is built without support for microTVM, i.e. with
set(USE_MICRO OFF).

Signed-off-by: Gustavo Romero <[email protected]>
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 11, 2022
)

Do not generate 'tvmc micro' subcommand and disable micro device option
in 'tvmc run' when TVM is built without support for microTVM, i.e. with
set(USE_MICRO OFF).

Signed-off-by: Gustavo Romero <[email protected]>
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 12, 2022
)

Do not generate 'tvmc micro' subcommand and disable micro device option
in 'tvmc run' when TVM is built without support for microTVM, i.e. with
set(USE_MICRO OFF).

Signed-off-by: Gustavo Romero <[email protected]>
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
)

Do not generate 'tvmc micro' subcommand and disable micro device option
in 'tvmc run' when TVM is built without support for microTVM, i.e. with
set(USE_MICRO OFF).

Signed-off-by: Gustavo Romero <[email protected]>
qsqqsqqsq-intellif pushed a commit to qsqqsqqsq-intellif/tvm that referenced this pull request Apr 29, 2022
)

Do not generate 'tvmc micro' subcommand and disable micro device option
in 'tvmc run' when TVM is built without support for microTVM, i.e. with
set(USE_MICRO OFF).

Signed-off-by: Gustavo Romero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants