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 python tutorial #9633

Merged
merged 32 commits into from
Jan 19, 2022
Merged

Tvmc python tutorial #9633

merged 32 commits into from
Jan 19, 2022

Conversation

CircleSpin
Copy link
Contributor

Finally putting up the doc :')

Let me know of thoughts/feedback.

@mbrookhart @hogepodge @jwfromm

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.

Thanks for this tutorial @CircleSpin! I had a first read and just spotted some minor changes in upper case acronyms and some sections that need a bit of more context to be added.

I'm happy with the sequence of steps you propose in this tutorial. I suggest we just adapt them using a real case that the user can reproduce on their own machine.

gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mbrookhart mbrookhart left a comment

Choose a reason for hiding this comment

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

LGTM. Looks like you hit a flaky test?

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.

Thanks for the fixes!

Copy link
Contributor

@hogepodge hogepodge left a comment

Choose a reason for hiding this comment

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

Should this tutorial supercede the other Python tutorial? I'm worried that people might get confused with two ways of doing things. If it shouldn't, we should clearly explain why there are two ways and what the intended outcome of each method is.

gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
################################################################################
# Step 2: Compile
# ----------------
# Now that our model is in relay, our next step is to compile it to a desired
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking out loud here, for documentation we should starting thinking about a style guide for named parts of TVM. Should it be Relay or relay? Our choice should be consistently applied throughout the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've capitalized the instances here to be "Relay".

gallery/how_to/use_tvms_python_api/tvmc_python.py Outdated Show resolved Hide resolved
@CircleSpin
Copy link
Contributor Author

Hi @hogepodge,

By all means if there's another ordering of the tutorials you prefer let's go with that. This tutorial seems to do the same thing as this one https://tvm.apache.org/docs/tutorial/autotvm_relay_x86.html#sphx-glr-tutorial-autotvm-relay-x86-py but instead uses the Tvmc python API. This API shares the same backend as the command line tool and is intended to be simple and new-user friendly.

@CircleSpin
Copy link
Contributor Author

Changed the location of this doc to be in the tutorial section after tvmc command line tutorial and before the autotvm python tutorial.

@leandron
Copy link
Contributor

@CircleSpin just a friendly ping on this one. Can we rebase and re-run CI?

Context: we got a question in the forum, that could be helped by this tutorial, then I remembered about this PR.

CircleSpin and others added 13 commits January 18, 2022 15:01
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
Copy link
Contributor

@hogepodge hogepodge left a comment

Choose a reason for hiding this comment

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

Aside from the redirect, we should merge this.

@@ -255,6 +255,7 @@ def git_describe_version(original_version):
"introduction.py",
"install.py",
"tvmc_command_line_driver.py",
"tvmc_python.py",
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to this, thanks!

[
"tutorials/get_started/tvmc_python.html",
"../../tutorial/tvmc_python.html",
],
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this a new page, a redirect isn't necessary.

@jroesch
Copy link
Member

jroesch commented Jan 19, 2022

@CircleSpin will you follow up with Chris's suggestion on redirect? I am going to merge as is

@jroesch jroesch merged commit 14d0187 into apache:main Jan 19, 2022
@hogepodge
Copy link
Contributor

The redirect does no harm, and this PR has been sitting for too long. Thanks for merging @jroesch and especially thanks to @CircleSpin for writing up this doc.

yuanfz98 pushed a commit to yuanfz98/tvm that referenced this pull request Jan 24, 2022
* finish rpc and shape_dict in tut

* added more to rpc

* tutorial edits

* added tutorial to docs in howto

* accidentally had two copies of tutorial

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Apply suggestions from code review

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* added Leandro's suggestions

* added example model at top

* added example model, blacked it

* trying to get docs to build

* underline too short for title

* forgot Jetson info, added Chris H comments

* reformatting text

* black

* hitting code block issue, trying to debug

* added spaces after the python codeblock

* black

* changing formatting

* touching up more edits'

* more touchups

* changed location of file to tutorial section

* changing doc location

* broke the order of the docs somehow

* fixed it yayy

* added additional indentation

* black'd

Co-authored-by: CircleSpin <jocelyn@pop-os.localdomain>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
crazydemo pushed a commit to crazydemo/tvm that referenced this pull request Jan 27, 2022
* finish rpc and shape_dict in tut

* added more to rpc

* tutorial edits

* added tutorial to docs in howto

* accidentally had two copies of tutorial

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Apply suggestions from code review

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* added Leandro's suggestions

* added example model at top

* added example model, blacked it

* trying to get docs to build

* underline too short for title

* forgot Jetson info, added Chris H comments

* reformatting text

* black

* hitting code block issue, trying to debug

* added spaces after the python codeblock

* black

* changing formatting

* touching up more edits'

* more touchups

* changed location of file to tutorial section

* changing doc location

* broke the order of the docs somehow

* fixed it yayy

* added additional indentation

* black'd

Co-authored-by: CircleSpin <jocelyn@pop-os.localdomain>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
* finish rpc and shape_dict in tut

* added more to rpc

* tutorial edits

* added tutorial to docs in howto

* accidentally had two copies of tutorial

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Apply suggestions from code review

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* Update gallery/how_to/use_tvms_python_api/tvmc_python.py

Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>

* added Leandro's suggestions

* added example model at top

* added example model, blacked it

* trying to get docs to build

* underline too short for title

* forgot Jetson info, added Chris H comments

* reformatting text

* black

* hitting code block issue, trying to debug

* added spaces after the python codeblock

* black

* changing formatting

* touching up more edits'

* more touchups

* changed location of file to tutorial section

* changing doc location

* broke the order of the docs somehow

* fixed it yayy

* added additional indentation

* black'd

Co-authored-by: CircleSpin <jocelyn@pop-os.localdomain>
Co-authored-by: Leandro Nunes <leandro.nunes@arm.com>
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.

5 participants