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

Make TORCH_COMPILE_DEBUG=1 work again #112917

Closed
wants to merge 3 commits into from
Closed

Make TORCH_COMPILE_DEBUG=1 work again #112917

wants to merge 3 commits into from

Conversation

ipiszy
Copy link
Contributor

@ipiszy ipiszy commented Nov 3, 2023

ATT. After the fix, self.node is Optional[ir.Buffer] in FusedSchedulerNode and ForeachKernelSchedulerNode, but ir.Buffer in BaseSchedulerNode. Using ir.Buffer for BaseSchedulerNode.node avoids all mypy complaints about Optionals.

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

Copy link

pytorch-bot bot commented Nov 3, 2023

🔗 Helpful Links

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 2e8bff9 with merge base 132cb57 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

@ipiszy
Copy link
Contributor Author

ipiszy commented Nov 3, 2023

topic: not user facing

Copy link
Contributor

@davidberard98 davidberard98 left a comment

Choose a reason for hiding this comment

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

thanks Ying!

@facebook-github-bot
Copy link
Contributor

@ipiszy has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@int3 int3 left a comment

Choose a reason for hiding this comment

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

Surprised there are no new type errors. Thanks for the fix!

@@ -3111,6 +3111,7 @@ def forward(self, l_input_: torch.Tensor):
o2 = torch.compile(mod)(inp)
self.assertEqual(o1, o2)

@patch.object(config.trace, "enabled", True)
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To add a test with "TORCH_COMPILE_DEBUG=1". It seems that we don't have any test coverage for "TORCH_COMPILE_DEBUG=1" for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably just make a separate sanity test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Chillee Where do you suggest to put this sanity test?

@ipiszy
Copy link
Contributor Author

ipiszy commented Nov 3, 2023

Surprised there are no new type errors. Thanks for the fix!

Yeah, I'm surprised, too...

@ipiszy
Copy link
Contributor Author

ipiszy commented Nov 3, 2023

Surprised there are no new type errors. Thanks for the fix!

There is actually a mypy error, for some reason my local run doesn't show this error:

Incompatible types in assignment (expression has type "Optional[Buffer]",
2023-11-03T22:55:19.6640685Z     base class "BaseSchedulerNode" defined the type as "Buffer")

So need to fix it properly..

@facebook-github-bot
Copy link
Contributor

@ipiszy has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@aakhundov
Copy link
Contributor

I think, self.node: ir.Buffer = None --> self.node: Optional[ir.Buffer] = None should fix the mypy error?

@facebook-github-bot
Copy link
Contributor

@ipiszy has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@ipiszy
Copy link
Contributor Author

ipiszy commented Nov 7, 2023

I think, self.node: ir.Buffer = None --> self.node: Optional[ir.Buffer] = None should fix the mypy error?

It will introduce other mypy errors lol. I'm just going to add "type: ignore" here.

@facebook-github-bot
Copy link
Contributor

@ipiszy has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@ipiszy
Copy link
Contributor Author

ipiszy commented Nov 7, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 7, 2023
@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

Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
ATT. After the fix, self.node is `Optional[ir.Buffer]` in `FusedSchedulerNode` and `ForeachKernelSchedulerNode`, but `ir.Buffer` in `BaseSchedulerNode`. Using `ir.Buffer` for `BaseSchedulerNode.node` avoids all mypy complaints about Optionals.

Pull Request resolved: pytorch#112917
Approved by: https://github.com/davidberard98, https://github.com/int3, https://github.com/leslie-fang-intel, https://github.com/aakhundov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inductor compile failed with enabling debug log
8 participants