-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Modernize LoggingTensorMode #77667
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
Modernize LoggingTensorMode #77667
Conversation
[ghstack-poisoned]
🔗 Helpful links
❌ 2 New FailuresAs of commit 60b4ec8 (more details on the Dr. CI page): Expand to see more
🕵️ 2 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
See #77544 [ghstack-poisoned]
This PR: - updates LoggingTensorMode to use the new PythonDispatchMode - updates some tests that use LoggingTensorMode to properly use the new version Open questions: - why is the old python mode still working? Do we intend to keep it? (a small bit of additional logic is necessary to support it) See #77544 [ghstack-poisoned]
IMO we should just dump old python mode |
|
||
@contextlib.contextmanager | ||
def capture_logs_with_logging_tensor_mode(): | ||
with push_torch_dispatch_mode(LoggingTensorMode(inner=None)), capture_logs(True) as logs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: shouldn't don't need inner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samdow yeah this looks like we should just support direct constructor lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add a test for this function
I'm pretty sure that as written this will error for the inner reason. Also flags to me that I really dislike that the argument for push_torch_dispatch_mode
is going to be a constructor for a Mode while enable_torch_dispatch_mode
is going to be the Mode instance. TODO (@samdow): fix that
This PR: - updates LoggingTensorMode to use the new PythonDispatchMode - updates some tests that use LoggingTensorMode to properly use the new version Open questions: - why is the old python mode still working? Do we intend to keep it? (a small bit of additional logic is necessary to support it) - This PR updates some of the tests that test old python mode behavior (e.g., all outputs are wrapped). If we intend to support old python mode long term we should bring it back, and just add new tests instead. TODO (this PR): - Test nesting behavior See #77544 [ghstack-poisoned]
This PR: - updates LoggingTensorMode to use the new PythonDispatchMode - updates some tests that use LoggingTensorMode to properly use the new version Open questions: - why is the old python mode still working? Do we intend to keep it? (a small bit of additional logic is necessary to support it) - This PR updates some of the tests that test old python mode behavior (e.g., all outputs are wrapped). If we intend to support old python mode long term we should bring it back, and just add new tests instead. TODO (this PR): - Test nesting behavior See #77544 [ghstack-poisoned]
This PR: - updates LoggingTensorMode to use the new PythonDispatchMode - updates some tests that use LoggingTensorMode to properly use the new version Open questions: - why is the old python mode still working? Do we intend to keep it? (a small bit of additional logic is necessary to support it) - This PR updates some of the tests that test old python mode behavior (e.g., all outputs are wrapped). If we intend to support old python mode long term we should bring it back, and just add new tests instead. TODO (this PR): - Test nesting behavior See #77544 [ghstack-poisoned]
@pytorchbot merge this on green |
Merge failed due to Matched rule superuser, but PR has not been reviewed yet |
@pytorchbot merge this |
Merge failed due to Matched rule superuser, but PR has not been reviewed yet |
Merge failed due to Matched rule superuser, but PR has not been reviewed yet |
When merging stack, it could be confusing to see which PRs are missing reviews as one can observe in #77667 (comment) Print PR number in needs-review message
@pytorchbot merge this |
Hey @soulitzer. |
When merging stack, it could be confusing to see which PRs are missing reviews as one can observe in #77667 (comment) Print PR number in needs-review message Pull Request resolved: #78219 Approved by: https://github.com/atalman, https://github.com/kit1980, https://github.com/seemethere
Summary: Pull Request resolved: #77667 Approved by: https://github.com/malfet Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/f3af51069d758bee2a68f35ae9491a2e13f7b63e Reviewed By: mehtanirav Differential Revision: D36668817 Pulled By: soulitzer fbshipit-source-id: 0547ef32f770ee82abf4a04b3d8fb9943c97635f
Summary: When merging stack, it could be confusing to see which PRs are missing reviews as one can observe in #77667 (comment) Print PR number in needs-review message Pull Request resolved: #78219 Approved by: https://github.com/atalman, https://github.com/kit1980, https://github.com/seemethere Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/357707b9f9b09eef2e50d2ba035f1c694be6018e Reviewed By: mehtanirav Differential Revision: D36668860 Pulled By: malfet fbshipit-source-id: fb08f0b747f75ef4bdd9d49a52a33b7ed0022877
This PR:
Open questions:
TODO (this PR):
Stack from ghstack:
See #77544