Skip to content

Conversation

@chunit-quic
Copy link
Contributor

@chunit-quic chunit-quic commented Sep 1, 2021

Add a before/after example of realy pass

Hi communities, I am wondering perhaps it might be good to have an example to see immediately for each (or most) relay pass in the transform document.
Therefore I create this example here.
image

Since the document is generated from the comments of python. I simply add more contents in its comments.
I would like to have your comments, and if it is fine I will add more before/after examples and submit request again.
@hogepodge @tqchen May I have your advices please? :D

Thank you!

Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.

Add a before/after example of realy pass
@chunit-quic
Copy link
Contributor Author

@hogepodge @tqchen Just a gentle ping. :)

Thanks!

@YuchenJin
Copy link
Contributor

Hi @chunit-quic, I like the idea of adding simple before/after examples to passes to help users understand the passes! :) Let's wait for others' comments.

@chunit-quic
Copy link
Contributor Author

Thank you @YuchenJin for like this idea. :D

@hogepodge @tqchen @comaniac Just a gentle ping. It will be a big help with your advice. :) Thank you!

@comaniac
Copy link
Contributor

comaniac commented Sep 9, 2021

I agree with the idea that it would be great to have examples for each pass. I'm just thinking whether we could have a more systematic way to do so instead of manually adding before/after examples to comments. For example, we could have a specific doc section showing pass examples, and we just need to write examples in Python, apply the pass, and print the result. In this way, when building documents, the Python file will be executed and the result of each pass will be generated automatically.

A more specific example is like this: https://github.com/apache/tvm/blob/main/tutorials/optimize/opt_gemm.py
And it becomes https://tvm.apache.org/docs/tutorials/optimize/opt_gemm.html. As you can see, all print in the Python file will be displayed in the generated document.

@chunit-quic
Copy link
Contributor Author

Thank you @comaniac, it is a good suggestion!
Automatically generate these results are much more decent.
Perhaps it will take longer time but I would like to try the way of generating the outputs and compiling it to html in the end, like your example.

Just one more question, where the final output page could be in?
would it be a good idea if we put it in the Developer Tutorials section? Currently tutorials in this section are all about pass.
image

Thank you.

@comaniac
Copy link
Contributor

This RFC is discussing doc formalization: apache/tvm-rfcs#27

Perhaps you can chime in, or @hogepodge do you have any suggestion?

@hogepodge
Copy link
Contributor

I think it's useful to have the inline documentation that's automatically generated as part of the documentation system. Since the mentioned RFC is largely concerned with organization rather than content per-se, I think it's useful to write this up as an independent RFC for discussion.

@hogepodge
Copy link
Contributor

I've updated the documentation RFC to reference this. Once that lands, let's work up a formal proposal for inline documentation for Relay passes.

@chunit-quic
Copy link
Contributor Author

Hi @hogepodge,

Thank you for like this idea!
I am thinking that, because now this feature is tracked via the RFC apache/tvm-rfcs#27, I would like to close this pull request, and track the RFC above.
Perhaps I could also help to do something on it if there is a conclusion.

Would it be fine to you? :D

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.

4 participants