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

Tensor Expression Debug Display (TEDD) #4651

Merged
merged 9 commits into from
Feb 26, 2020
Merged

Conversation

yongfeng-nv
Copy link
Contributor

This is the PR for a Tensor Expression visualization tool (RFC). Any feedback or comment are welcome.

…hedule Tree. 3. Add examples to top level APIs' comments. 4. Top level APIs don't print Dot string by default, unless outputdotstring is True.
@yongfeng-nv
Copy link
Contributor Author

@Hzfengsy, could you help reviewing this PR?

Copy link
Member

@Hzfengsy Hzfengsy left a comment

Choose a reason for hiding this comment

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

Good job! Very impressive work! Can you write a tutorial which may help people to get started with TEDD.



def viz_schedule_tree(sch,
showsvg=False,
Copy link
Member

Choose a reason for hiding this comment

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

Can you please change the argument name to show_svg, dot_file_path and output_dot_string?

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 am making these changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hzfengsy, I have updated the variable names and avoided some lint warnings from the tests. But the test will still fail because of the ci-cpu doesn't have graphviz. I haven't seen response to my question below. Do you have any suggestion? Thanks

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 am also working on a tutorial. How about putting it under tutorial/language?

Copy link
Member

Choose a reason for hiding this comment

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

Sounds great! As for the CI test, I would like to skip this test on the CI until the CI updating.

Also, is there a way to allow contributors to modify the docker image on CI? @tqchen
Many new features depend on different environments. It is difficult to change the CI docker every time by only one person.

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 have disabled TEDD execution and verification and kept TE construction in the test.

@yongfeng-nv
Copy link
Contributor Author

One question about test failure: https://ci.tvm.ai/blue/organizations/jenkins/tvm/detail/PR-4651/2/pipeline

E ModuleNotFoundError: No module named 'graphviz'

It fails, because tedd depends on graphviz, but tvmai/ci-cpu:v0.54 doesn't have it.
How to fix this issue? Let ci-cpu install graphviz as ci-gpu?

@tqchen
Copy link
Member

tqchen commented Jan 12, 2020

Thanks @yongfeng-nv . One thing that I think worth considering, as in many viz tools, is the separation of visualization data schema(in this case the perhaps a dom tree or similar kind) from the visualization itself(graphviz).

We can have a tool that extracts the spec into json, then have a tool to take that spec and visualize it

@tqchen
Copy link
Member

tqchen commented Jan 12, 2020

re CI It would be great to add a testing function to see if graphviz exists, if not skip the test

@yongfeng-nv
Copy link
Contributor Author

Thanks @yongfeng-nv . One thing that I think worth considering, as in many viz tools, is the separation of visualization data source specification(in this case the perhaps a dom tree or similar kind) from the visualization(graphviz).

We can have a tool that extracts the spec into json, then have a tool to take that spec and visualize it

@tqchen, I see your point. Let me spec the data source spec.

@yongfeng-nv
Copy link
Contributor Author

Thanks @yongfeng-nv . One thing that I think worth considering, as in many viz tools, is the separation of visualization data source specification(in this case the perhaps a dom tree or similar kind) from the visualization(graphviz).
We can have a tool that extracts the spec into json, then have a tool to take that spec and visualize it

@tqchen, I see your point. Let me spec the data source spec.

@tqchen, @Hzfengsy, I have posted proposal DOM tree in the RFC thread: https://discuss.tvm.ai/t/visualize-tensor-expression/5174/6. Please leave your comments and suggestions.

@tqchen tqchen self-assigned this Feb 6, 2020
@yongfeng-nv
Copy link
Contributor Author

@tqchen, @Hzfengsy
I have updated this PR with changes listed in the forum:
https://discuss.tvm.ai/t/visualize-tensor-expression/5174/12?u=maplegu

Two questions about the tutorial:

  1. As graphviz is not always available in CI. Shall I use static images in the tutorial? If so, my current submission uses image locations such as https://github.com/dmlc/web-data/raw/master/tvm/tutorial/tedd_st.png. I haven't committed any image yet. Is it a good location?

  2. I would like to inspect the rendered tutorial. How to view it in my repo?

@Hzfengsy
Copy link
Member

Thank you for the update.

I think the location on dmlc/web-data is good, but maybe need others' help to commit.

You can render the tutorial at local by

python3 -m pip install sphinx-gallery
cd tvm_path/docs
make html

…(schedule) to dump a json string for the schedule data for visualization. 2. Update tests. 3. Add a tutorial. 4. Add range information to IterVars.
… for DFG. 2. Update tutorial about the InferBound failure.
… tutorial publishing faliure. 2. Fix test about IPython availability check.
@yongfeng-nv
Copy link
Contributor Author

The PR is clear from building/testing failures, after qualifying with @Hzfengsy's help on tutorial.
I am attaching the three static images used by the tutorial. If there is no more comments for me to address, can someone help uploading them as: https://github.com/dmlc/web-data/raw/master/tvm/tutorial/tedd_itervar_rel.png, https://github.com/dmlc/web-data/raw/master/tvm/tutorial/tedd_dfg.png, and https://github.com/dmlc/web-data/raw/master/tvm/tutorial/tedd_st.png? Thanks

tedd_itervar_rel
tedd_dfg
tedd_st

@yongfeng-nv
Copy link
Contributor Author

@tqchen, this PR has been clear for a week. It still needs uploading three static images for the tutorial. Can you help moving it forward? Thank you.

@tqchen tqchen merged commit b0b1e7d into apache:master Feb 26, 2020
@tqchen
Copy link
Member

tqchen commented Feb 26, 2020

Sorry about the delay. Thanks @yongfeng-nv @Hzfengsy this PR is now merged!

@yongfeng-nv yongfeng-nv deleted the tedd branch February 26, 2020 04:28
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 26, 2020
* Initial TEDD for publishing.

* 1. Fix lint issues. 2. Print intrin.body instead of intrin.name in Schedule Tree.  3. Add examples to top level APIs' comments.  4. Top level APIs don't print Dot string by default, unless outputdotstring is True.

* Fix more lint issues.

* Update top level API argument names and use raw strings to avoid Python lint warnings in the tests.

* Disable TEDD verification, but keep TE construction.

* Stop importing tedd to avoid failure.

* Separate data extraction and visualization. 1. Add API tedd.dump_json(schedule) to dump a json string for the schedule data for visualization.  2. Update tests.  3. Add a tutorial.  4. Add range information to IterVars.

* Update TEDD about InferBound failure.  1. TEDD doesn't call inferbound for DFG. 2. Update tutorial about the InferBound failure.

* 1. Import IPython only if SVG is requested.  This is required to fix a tutorial publishing faliure.  2. Fix test about IPython availability check.
alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 28, 2020
* Initial TEDD for publishing.

* 1. Fix lint issues. 2. Print intrin.body instead of intrin.name in Schedule Tree.  3. Add examples to top level APIs' comments.  4. Top level APIs don't print Dot string by default, unless outputdotstring is True.

* Fix more lint issues.

* Update top level API argument names and use raw strings to avoid Python lint warnings in the tests.

* Disable TEDD verification, but keep TE construction.

* Stop importing tedd to avoid failure.

* Separate data extraction and visualization. 1. Add API tedd.dump_json(schedule) to dump a json string for the schedule data for visualization.  2. Update tests.  3. Add a tutorial.  4. Add range information to IterVars.

* Update TEDD about InferBound failure.  1. TEDD doesn't call inferbound for DFG. 2. Update tutorial about the InferBound failure.

* 1. Import IPython only if SVG is requested.  This is required to fix a tutorial publishing faliure.  2. Fix test about IPython availability check.
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2020
* Initial TEDD for publishing.

* 1. Fix lint issues. 2. Print intrin.body instead of intrin.name in Schedule Tree.  3. Add examples to top level APIs' comments.  4. Top level APIs don't print Dot string by default, unless outputdotstring is True.

* Fix more lint issues.

* Update top level API argument names and use raw strings to avoid Python lint warnings in the tests.

* Disable TEDD verification, but keep TE construction.

* Stop importing tedd to avoid failure.

* Separate data extraction and visualization. 1. Add API tedd.dump_json(schedule) to dump a json string for the schedule data for visualization.  2. Update tests.  3. Add a tutorial.  4. Add range information to IterVars.

* Update TEDD about InferBound failure.  1. TEDD doesn't call inferbound for DFG. 2. Update tutorial about the InferBound failure.

* 1. Import IPython only if SVG is requested.  This is required to fix a tutorial publishing faliure.  2. Fix test about IPython availability check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants