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] run: Fix call to non-existing method #9608

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

gromero
Copy link
Contributor

@gromero gromero commented Nov 29, 2021

'path' has no method 'dirname' and so currently will throw an invalid
attribute exception when a 'model.tar' file can not be found in the
project directory:

gromero@amd:~/git/tvm$ tvmc run --device micro /tmp/x9584 --project-option arduino_board=due
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:191: Warning: Unable to detect CUDA version, default to "-mcpu=sm_20" instead
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:217: Warning: Unable to detect ROCm compute arch, default to "-mcpu=gfx900" instead
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:231: Warning: Unable to detect ROCm version, assuming >= 3.5
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:163: Warning: Unable to detect CUDA version, default to "-arch=sm_20" instead
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:191: Warning: Unable to detect CUDA version, default to "-mcpu=sm_20" instead
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:217: Warning: Unable to detect ROCm compute arch, default to "-mcpu=gfx900" instead
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:231: Warning: Unable to detect ROCm version, assuming >= 3.5
[19:29:25] /home/gromero/git/tvm/src/target/target_kind.cc:163: Warning: Unable to detect CUDA version, default to "-arch=sm_20" instead
Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/gromero/git/tvm/python/tvm/driver/tvmc/__main__.py", line 24, in <module>
    tvmc.main.main()
  File "/home/gromero/git/tvm/python/tvm/driver/tvmc/main.py", line 100, in main
    sys.exit(_main(sys.argv[1:]))
  File "/home/gromero/git/tvm/python/tvm/driver/tvmc/main.py", line 93, in _main
    return args.func(args)
  File "/home/gromero/git/tvm/python/tvm/driver/tvmc/runner.py", line 189, in drive_run
    f"Could not find model (model.tar) in the specified project dir {path.dirname()}."
AttributeError: 'PosixPath' object has no attribute 'dirname'

This commit fixes it by using 'path' var only when raising the TVMCException.

@gromero
Copy link
Contributor Author

gromero commented Nov 29, 2021

cc @leandron @areusch @mehrdadh @guberti for reviews.

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

Copy link
Member

@mehrdadh mehrdadh 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 1, 2021

There is a small code formatting issue that made CI to crash, happy to take this once CI is green.

@gromero gromero force-pushed the tvmc-fix-wrong-attribute-dirname branch from 0a0534b to d55e018 Compare December 1, 2021 21:37
@gromero
Copy link
Contributor Author

gromero commented Dec 1, 2021

@leandron @mehrdadh Thanks a lot for the reviews. I've re-triggered the CI and it must get green in ~5h from now :)

'path' has no method 'dirname' and so currently will throw an invalid
attribute exception when a 'model.tar' file can not be found in the
project directory. This commit fixes it by using 'path' var only when
raising the TVMCException.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
@gromero gromero force-pushed the tvmc-fix-wrong-attribute-dirname branch from d55e018 to a6cc1de Compare December 2, 2021 20:21
@jroesch jroesch merged commit 1d55350 into apache:main Dec 3, 2021
@gromero
Copy link
Contributor Author

gromero commented Dec 3, 2021

@jroesch Hi. Thanks for merging it!

I see here it landed without any commit message body. Do you see the same there? If so, any idea why?

ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 11, 2022
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 12, 2022
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
qsqqsqqsq-intellif pushed a commit to qsqqsqqsq-intellif/tvm that referenced this pull request Apr 29, 2022
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.

None yet

4 participants