[tvmc] tvmc first-run issues

I’m trying out tvmc with the new tutorial that was recently merged. A few things I’ve noticed:

  • Running tvmc without any arguments produces a stack trace, rather than usage help.
  • I’m attempting to tune the resnet-50-v2.7.onnx model using the command tvmc tune --target llvm --output autotuner_records.json resnet-50-v2.7.onnx, and I’m running into an error:

[Task 1/24] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (160/1000) | 117.97 sWARNING:autotvm:Too many errors happen in the tuning. Now is in debug mode DEBUG:autotvm:No: 161 GFLOPS: 0.00/0.00 result: MeasureResult(costs=(RuntimeError('The function of this task is not found. Possibly the function of this task is registered in another python file which is not imported in this run'),), error_no=2, all_cost=0.0001361370086669922, timestamp=1601682630.652663) [('tile_y', [-1, 1]), ('tile_x', [-1, 50]), ('tile_k', [-1, 128])],None,121

I’m running from the latest as of this writing. Where might I be going wrong?

Thanks for having a shot :slight_smile:

@leandron could you take a look at thees issues? The first one seems straightforward, and I guess the second one is due to missing topi import or something like that.

Sure, I’ll have a look.

Halo, I could’t even know how to call tvmc correctly .

I try to remake tvm stack with my MacOS, then type python -m tvm.driver.tvmc in the command , error reported

promote at ~/tvm/build ±(master) ✗ ❯ python -m tvm.driver.tvmc
Traceback (most recent call last):
  File "/Users/wanglei/opt/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/wanglei/opt/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/wanglei/tvm/python/tvm/driver/tvmc/__main__.py", line 24, in <module>
  File "/Users/wanglei/tvm/python/tvm/driver/tvmc/main.py", line 95, in main
  File "/Users/wanglei/tvm/python/tvm/driver/tvmc/main.py", line 86, in _main
    assert hasattr(args, "func"), "Error: missing 'func' attribute for subcommand {0}".format(argv)
AssertionError: Error: missing 'func' attribute for subcommand []

When i type -h

promote at ~/tvm/build ±(master) ✗ ❯ python -m tvm.driver.tvmc -h
usage: tvmc [-h] [-v] [--version] {} ...

TVM compiler driver

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  increase verbosity
  --version      print the version and exit


TVMC - TVM driver command-line interface

You can see no compile, no tune, etc.

The first error you mention was already reported by @hogepodge and I just submitted a PR to address that.

Now, the second error, when you see no sub-commands, it is a bit puzzling. Can you provide more context? Are you running it from a particular hash in git?

Also, can you give me the output of the command line below?

python -c "from tvm.driver.tvmc import compiler, autotuner, runner; print(compiler.__file__)"
1 Like

Thank you for reply, I just figure out the second error, it was caused by my failed git pull operation(i changed some files and did not commit then i didn’t notice the error of git pull op).

:grinning:And thank you again.

1 Like

I’m still investigating this one.

Hey, is that tvmc the omission of python -m tvm.driver.tvmc ? cause i didn’t find command tvmc, as substitute, i append

alias tvmc='python -m tvm.driver.tvmc'

to my shell profile.

it is only created when you install it using setuptools, like python setup.py install or pip install ....

1 Like

That is what I’m doing, installing to a local virtualenv using setuptools.

A quick update on this, it turns out this is part of a larger issue with Python threading on macOS. I don’t think it impacts Linux users.

Oh I see. I think it would be good to have an issue on GitHub to discuss that around AutoTVM?

This PR should fix these issues: https://github.com/apache/incubator-tvm/pull/6671

1 Like