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

Refactor FxGraphDrawer to use HTML-like labels #137726

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

exclamaforte
Copy link
Contributor

@exclamaforte exclamaforte commented Oct 10, 2024

Fixes #137499
Testing: Added a new unit test to make sure that the regression case succeeds.
I'm debating about whether to make the borders visible. I'm partial to no borders, but it might make it harder for some people to read?
68a2b0e3-orig_fx_graph_diagram
Vs.
2bfe1c4f-orig_fx_graph_diagram

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov

Copy link

pytorch-bot bot commented Oct 10, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/137726

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit ed565e0 with merge base 889717a (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@weifengpy
Copy link
Contributor

this is fast! took a look. no major concerns except address linters and wait for CIs

Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

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

Nice ! Looks good although not sure how to use it now.. Maybe it would be possible to add a test so it doesnt regress like it did

# to specify the shape attribute for the dot graph. For example, passing
# INDUCTOR_DOT_GRAPH_SHAPE_SVG = "none" would let us generate HTML-like lables
# to workaround the above failure.
dot_graph_shape = os.environ.get("INDUCTOR_DOT_GRAPH_SHAPE_SVG", None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there no longer a way to generate this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My reasoning for removing the config flag is that it was originally added to resolve a bug that is now fixed by this PR.

However, other shapes do work with html-like labels, so leaving it in wouldn't hurt anything. It's definitely a low impact config flag so if we're trying to simplify the config file, it would be a good one to remove.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, didnt realize that this config was just for the bug.

Copy link
Contributor

Choose a reason for hiding this comment

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

Have we ever documented it? If so, it probably should be kept around

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 did a google search and nothing came up except the source code itself, so I don't think it's been documented.

@exclamaforte
Copy link
Contributor Author

exclamaforte commented Oct 10, 2024

Nice ! Looks good although not sure how to use it now.. Maybe it would be possible to add a test so it doesnt regress like it did

I will add a test

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Please commit the suggested changes from pytorch's linter.

test/fx/test_graph_drawer.py Outdated Show resolved Hide resolved
test/fx/test_graph_drawer.py Outdated Show resolved Hide resolved
@exclamaforte exclamaforte force-pushed the exclamaforte/fix-orig-svg branch 3 times, most recently from 3c7c5a9 to 95cda94 Compare October 12, 2024 00:45
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Please commit the suggested changes from pytorch's linter.

test/fx/test_graph_drawer.py Show resolved Hide resolved
@exclamaforte exclamaforte force-pushed the exclamaforte/fix-orig-svg branch 2 times, most recently from 8cf7ac4 to db00a36 Compare October 16, 2024 18:01
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Please commit the suggested changes from pytorch's linter.

test/fx/test_graph_drawer.py Show resolved Hide resolved
@exclamaforte exclamaforte force-pushed the exclamaforte/fix-orig-svg branch 2 times, most recently from 083c170 to c437102 Compare October 16, 2024 19:00
@exclamaforte exclamaforte force-pushed the exclamaforte/fix-orig-svg branch 2 times, most recently from 7422e92 to d6f636e Compare October 18, 2024 16:46
@exclamaforte exclamaforte force-pushed the exclamaforte/fix-orig-svg branch 3 times, most recently from 962184d to e9f7769 Compare October 18, 2024 22:06
@exclamaforte exclamaforte force-pushed the exclamaforte/fix-orig-svg branch 3 times, most recently from 4a64d21 to 35487e6 Compare October 21, 2024 18:43
.ci/docker/common/install_graphviz.sh Show resolved Hide resolved
# to specify the shape attribute for the dot graph. For example, passing
# INDUCTOR_DOT_GRAPH_SHAPE_SVG = "none" would let us generate HTML-like lables
# to workaround the above failure.
dot_graph_shape = os.environ.get("INDUCTOR_DOT_GRAPH_SHAPE_SVG", None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we ever documented it? If so, it probably should be kept around

torch/fx/passes/graph_drawer.py Outdated Show resolved Hide resolved
torch/fx/passes/graph_drawer.py Outdated Show resolved Hide resolved
torch/fx/passes/graph_drawer.py Outdated Show resolved Hide resolved
@exclamaforte exclamaforte force-pushed the exclamaforte/fix-orig-svg branch 5 times, most recently from 94b7ba7 to fa78566 Compare October 23, 2024 21:53
@exclamaforte
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 23, 2024
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 jobs have failed, first few of them are: inductor / linux-jammy-cpu-py3.12-gcc11-inductor-halide / build, trunk / linux-focal-rocm6.2-py3.10 / build

Details for Dev Infra team Raised by workflow job

fixes #137499

Testing Plan: New unit test.
@exclamaforte
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

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.

Failing flag INDUCTOR_ORIG_FX_SVG=1
5 participants