Skip to content

Use enable_tracing flag for ProxyTorchDispatchMode instead of modifying torch dispatch mode stack inner attributes#82643

Closed
IvanYashchuk wants to merge 3 commits intopytorch:masterfrom
IvanYashchuk:proxy-isolated
Closed

Use enable_tracing flag for ProxyTorchDispatchMode instead of modifying torch dispatch mode stack inner attributes#82643
IvanYashchuk wants to merge 3 commits intopytorch:masterfrom
IvanYashchuk:proxy-isolated

Conversation

@IvanYashchuk
Copy link
Collaborator

Description

This PR removes fiddling with the mode stack using copies and ExitStack in favor of a simpler and more straightforward approach.

Issue

#81764 (comment)

Testing

No new tests are needed.

@IvanYashchuk IvanYashchuk added the better-engineering Relatively self-contained tasks for better engineering contributors label Aug 2, 2022
@IvanYashchuk IvanYashchuk requested a review from ezyang August 2, 2022 11:34
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Aug 2, 2022

🔗 Helpful links

✅ No Failures (4 Pending)

As of commit 9d7de52 (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

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.

Thank you. You'll also need the mode object stored on tensors PR because otherwise non-context manager use of ProxyTensor will still end up tracing even if you disable.

@IvanYashchuk
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Merge failed due to Refusing to merge as mandatory check(s) pull failed for rule superuser
Raised by https://github.com/pytorch/pytorch/actions/runs/2784245585

@IvanYashchuk
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Merge failed due to Refusing to merge as mandatory check(s) pull failed for rule superuser
Raised by https://github.com/pytorch/pytorch/actions/runs/2788006900

@IvanYashchuk
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Hey @IvanYashchuk.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

facebook-github-bot pushed a commit that referenced this pull request Aug 4, 2022
…ng torch dispatch mode stack inner attributes (#82643) (#82643)

Summary:
### Description
This PR removes fiddling with the mode stack using copies and ExitStack in favor of a simpler and more straightforward approach.

### Issue
#81764 (comment)

### Testing
No new tests are needed.

Pull Request resolved: #82643
Approved by: https://github.com/ezyang

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/8092cf60c6d5985f88ab2c4ceceac75b83c428ff

Reviewed By: kit1980

Differential Revision: D38395117

fbshipit-source-id: 0d0dcc9fb7c663181b82fed6bcb048bbd0ffc88c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

better-engineering Relatively self-contained tasks for better engineering contributors cla signed fx Merged open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants