-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] command line driver 'compile' (part 2/4) #6302
Conversation
Also cc @tom-gall who sent a patch on top of my previous PR adding supporting AArch32. Can you send that one again, once this one is merged? |
Sure happy to. |
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.
Reviewed the argument interface only and have some comments. I'd prefer to have consents on the interface before diving into the implementations.
One thing to note is that given we are updating the target convention to use the json as an input, it might be helpful to think about what is the target that can be accepted from the command line. cc @comaniac @junrushao1994 |
@tqchen I am thinking about unifying target creation from legacy string, JSON file and tags. |
Zhi and I had a discussion with ARM folks today and here is a rough proposal:
As a result, the users that know nothing about the target can simply provide a tag. On ther other hand, advance users can still specify targets in any supported formats. |
I updated it removing a skipped test due to #6410, which is now fixed. |
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.
Thanks for the changes. It looks much better now.
cc @masahi @junrushao1994 @tqchen for a final review. |
I recently rebased with the latest changes and un-skipped the test fixed by #6442 @tqchen @comaniac @junrushao1994 would you mind having another look into this PR? |
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. We can merge it after passing the CI.
Thanks for the efforts :)
* Add 'compile' subcommand into tvmc (tvm.driver.tvmc) * Add frontends: Keras, ONNX, TensorFlow, tflite, PyTorch * Add tests for the 'compile' subcommand * Enable command line driver tests as part of integration tests * Skip tests if the cross-compilation toolchain is not installed Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]>
Co-authored-by: Cody Yu <[email protected]>
* [tvmc] command line driver 'compile' (part 2/4) * Add 'compile' subcommand into tvmc (tvm.driver.tvmc) * Add frontends: Keras, ONNX, TensorFlow, tflite, PyTorch * Add tests for the 'compile' subcommand * Enable command line driver tests as part of integration tests * Skip tests if the cross-compilation toolchain is not installed Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> * tvmc: adjust TODOs * tvmc: fix linting errors * Address code-review comments * Adjust pytest fixture to not break when there is no tensorflow * Fix frontend tests, to cope with different frameworks in different images * Apply suggestions from code review Co-authored-by: Cody Yu <[email protected]> * Fix lint and code-review issues * Re-format with black. * tvmc: Move dependencies to extras_requires Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> Co-authored-by: Cody Yu <[email protected]>
* [tvmc] command line driver 'compile' (part 2/4) * Add 'compile' subcommand into tvmc (tvm.driver.tvmc) * Add frontends: Keras, ONNX, TensorFlow, tflite, PyTorch * Add tests for the 'compile' subcommand * Enable command line driver tests as part of integration tests * Skip tests if the cross-compilation toolchain is not installed Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> * tvmc: adjust TODOs * tvmc: fix linting errors * Address code-review comments * Adjust pytest fixture to not break when there is no tensorflow * Fix frontend tests, to cope with different frameworks in different images * Apply suggestions from code review Co-authored-by: Cody Yu <[email protected]> * Fix lint and code-review issues * Re-format with black. * tvmc: Move dependencies to extras_requires Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> Co-authored-by: Cody Yu <[email protected]>
* [tvmc] command line driver 'compile' (part 2/4) * Add 'compile' subcommand into tvmc (tvm.driver.tvmc) * Add frontends: Keras, ONNX, TensorFlow, tflite, PyTorch * Add tests for the 'compile' subcommand * Enable command line driver tests as part of integration tests * Skip tests if the cross-compilation toolchain is not installed Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> * tvmc: adjust TODOs * tvmc: fix linting errors * Address code-review comments * Adjust pytest fixture to not break when there is no tensorflow * Fix frontend tests, to cope with different frameworks in different images * Apply suggestions from code review Co-authored-by: Cody Yu <[email protected]> * Fix lint and code-review issues * Re-format with black. * tvmc: Move dependencies to extras_requires Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> Co-authored-by: Cody Yu <[email protected]>
* [tvmc] command line driver 'compile' (part 2/4) * Add 'compile' subcommand into tvmc (tvm.driver.tvmc) * Add frontends: Keras, ONNX, TensorFlow, tflite, PyTorch * Add tests for the 'compile' subcommand * Enable command line driver tests as part of integration tests * Skip tests if the cross-compilation toolchain is not installed Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> * tvmc: adjust TODOs * tvmc: fix linting errors * Address code-review comments * Adjust pytest fixture to not break when there is no tensorflow * Fix frontend tests, to cope with different frameworks in different images * Apply suggestions from code review Co-authored-by: Cody Yu <[email protected]> * Fix lint and code-review issues * Re-format with black. * tvmc: Move dependencies to extras_requires Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> Co-authored-by: Cody Yu <[email protected]>
* [tvmc] command line driver 'compile' (part 2/4) * Add 'compile' subcommand into tvmc (tvm.driver.tvmc) * Add frontends: Keras, ONNX, TensorFlow, tflite, PyTorch * Add tests for the 'compile' subcommand * Enable command line driver tests as part of integration tests * Skip tests if the cross-compilation toolchain is not installed Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> * tvmc: adjust TODOs * tvmc: fix linting errors * Address code-review comments * Adjust pytest fixture to not break when there is no tensorflow * Fix frontend tests, to cope with different frameworks in different images * Apply suggestions from code review Co-authored-by: Cody Yu <[email protected]> * Fix lint and code-review issues * Re-format with black. * tvmc: Move dependencies to extras_requires Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> Co-authored-by: Cody Yu <[email protected]>
* [tvmc] command line driver 'compile' (part 2/4) * Add 'compile' subcommand into tvmc (tvm.driver.tvmc) * Add frontends: Keras, ONNX, TensorFlow, tflite, PyTorch * Add tests for the 'compile' subcommand * Enable command line driver tests as part of integration tests * Skip tests if the cross-compilation toolchain is not installed Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> * tvmc: adjust TODOs * tvmc: fix linting errors * Address code-review comments * Adjust pytest fixture to not break when there is no tensorflow * Fix frontend tests, to cope with different frameworks in different images * Apply suggestions from code review Co-authored-by: Cody Yu <[email protected]> * Fix lint and code-review issues * Re-format with black. * tvmc: Move dependencies to extras_requires Co-authored-by: Marcus Shawcroft <[email protected]> Co-authored-by: Matthew Barrett <[email protected]> Co-authored-by: Dmitriy Smirnov <[email protected]> Co-authored-by: Luke Hutton <[email protected]> Co-authored-by: Giuseppe Rossini <[email protected]> Co-authored-by: Elen Kalda <[email protected]> Co-authored-by: Ramana Radhakrishnan <[email protected]> Co-authored-by: Jeremy Johnson <[email protected]> Co-authored-by: Ina Dobreva <[email protected]> Co-authored-by: Cody Yu <[email protected]>
tvmc first-run with 'compile' problem |
This is a small issue, that only reproduce because you probably have an |
Thanks a lot @leandron |
It seems it has something to do with the actual string you're sending on the command line. It is not strictly a bug in tvmc at this point. Can you please file an issue so that we can investigate that? |
I didn't change anything, I still used the command: |
@OneIsAll-w please do not use the closed PR for bug reporting and discussion. It would be better to create a post in https://discuss.tvm.apache.org/ and point to this PR. |
This is a follow-up PR on top of #6112, introducing
compile
subcommand ontvmc
orpython -m tvm.driver.tvmc
setup.py
to make TVM python package ready-to-use on installKnown limitations:
There are still 2 patches to be submitted:
tvmc tune
andtvmc run
, both depending on this.In case you want to have a look and test
compile
, you can use the--dump-codegen ll
or--dump-codegen asm
or--dump-codegen relay
to check the output module as source.A sample usage would look like (assumes TVM is built and working):
@tqchen @comaniac @jroesch, can you have a look?