Skip to content

chore(inductor): Simplify will_fusion_create_cycle and cleanup to node.ancestors #109976

Closed
jon-chuang wants to merge 3 commits intopytorch:mainfrom
jon-chuang:jon-chuang/simplify-create-cycle-check
Closed

chore(inductor): Simplify will_fusion_create_cycle and cleanup to node.ancestors #109976
jon-chuang wants to merge 3 commits intopytorch:mainfrom
jon-chuang:jon-chuang/simplify-create-cycle-check

Conversation

@jon-chuang
Copy link
Copy Markdown
Collaborator

@jon-chuang jon-chuang commented Sep 24, 2023

recursive_predecessors == ancestors so rename.

Improve comments

Simplify will_fusion_create_cycle - make it easier to read and add detailed comments.

Diagram to illustrate clarification of shortcut.
Inductor Deep Dive

CC: @ngimel

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Sep 24, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 756553b with merge base 0d3db10 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@jon-chuang
Copy link
Copy Markdown
Collaborator Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Sep 24, 2023
@jon-chuang jon-chuang changed the title chore(inductor): Cleanup scheduler node ancestors and will_fusion_create_cycle chore(inductor): Simplify will_fusion_create_cycle and cleanup scheduler node.ancestors Sep 24, 2023
@jon-chuang jon-chuang changed the title chore(inductor): Simplify will_fusion_create_cycle and cleanup scheduler node.ancestors chore(inductor): Simplify will_fusion_create_cycle and cleanup to node.ancestors Sep 24, 2023

if shortcut:
return cond0
if node.get_names().issubset(combined_ancestors):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note to reviewer: this just reorders things.

bool(combined_names & node.ancestors) should be similar cost to node.get_names().issubset(combined_ancestors)

Copy link
Copy Markdown
Collaborator Author

@jon-chuang jon-chuang Sep 27, 2023

Choose a reason for hiding this comment

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

Further afterthought: combined_ancestors is also likely to be in cache for hashset lookup, as opposed to node.ancestors

@albanD albanD requested a review from jansel September 26, 2023 10:43
@albanD albanD added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Sep 26, 2023
@jon-chuang
Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 27, 2023
@pytorchmergebot
Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants