Skip to content

Fix usages of contextmanager without finally#96170

Closed
Chillee wants to merge 5 commits intogh/chillee/193/basefrom
gh/chillee/193/head
Closed

Fix usages of contextmanager without finally#96170
Chillee wants to merge 5 commits intogh/chillee/193/basefrom
gh/chillee/193/head

Conversation

@Chillee
Copy link
Collaborator

@Chillee Chillee commented Mar 7, 2023

@pytorch-bot
Copy link

pytorch-bot bot commented Mar 7, 2023

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit c3e05ca:
💚 Looks good so far! There are no failures yet. 💚

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

yield
finally:
for _ in range(-offset):
self.writeline("{")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Some of these don't really make sense. If there's an exception why would we keep doing codegen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm... in my rush I was thinking that you might throw an exception during codegen on purpose and then catch it. But that should already be covered by a try/except I think, and otherwise we shouldn't expect it to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

so you're going to undo this right

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually I'm not totally sure on which ones of these I should undo 🤔 What about like, the changes to set_current_node?

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Mostly good

@albanD albanD removed their request for review March 7, 2023 18:53
cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
Chillee added a commit that referenced this pull request Mar 7, 2023
ghstack-source-id: af37e6a
Pull Request resolved: #96170
import colorama

info_str = f"{kernel_name}\t {ms:.3f}ms\t{num_gb:.3f} GB \t {gb_per_s:.2f}GB/s"
info_str = f"{ms:.3f}ms \t{num_gb:.3f} GB \t {gb_per_s:.2f}GB/s \t {kernel_name}"
Copy link
Collaborator Author

@Chillee Chillee Mar 7, 2023

Choose a reason for hiding this comment

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

Also sneaking in some random fixes to TORCHINDUCTOR_PROFILE. Will add a test for this stuff in next commit.

cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire

[ghstack-poisoned]
Chillee added a commit that referenced this pull request Mar 7, 2023
ghstack-source-id: b103e0c
Pull Request resolved: #96170
@Chillee
Copy link
Collaborator Author

Chillee commented Mar 8, 2023

@pytorchbot merge

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

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.

6 participants