-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Ensure initializedContextIds_ map is cleaned up appropriately in DistEngine. #29787
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
Ensure initializedContextIds_ map is cleaned up appropriately in DistEngine. #29787
Conversation
…Engine. The initializedContextIds_ map was never cleaned up in DistEngine and kept on growing as we continue to run backward passes. To fix this, in this PR we ensure that the context id is cleaned up from this map once we are done with the backward pass. Closes #29083 Differential Revision: [D18498937](https://our.internmc.facebook.com/intern/diff/D18498937/) [ghstack-poisoned]
…Engine. The initializedContextIds_ map was never cleaned up in DistEngine and kept on growing as we continue to run backward passes. To fix this, in this PR we ensure that the context id is cleaned up from this map once we are done with the backward pass. Closes #29083 Differential Revision: [D18498937](https://our.internmc.facebook.com/intern/diff/D18498937/) ghstack-source-id: 93889304 Pull Request resolved: #29787
pietern
left a comment
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.
Not a fan of including the gtest header...
Otherwise the change LGTM.
| @@ -1,5 +1,6 @@ | |||
| #pragma once | |||
|
|
|||
| #include <gtest/gtest_prod.h> | |||
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.
I don't like this... I know it's for making protected functions testable, but isn't there another way to achieve the same? For example, do the functions you're calling into need to be protected?
…ely in DistEngine." The initializedContextIds_ map was never cleaned up in DistEngine and kept on growing as we continue to run backward passes. To fix this, in this PR we ensure that the context id is cleaned up from this map once we are done with the backward pass. Closes #29083 Differential Revision: [D18498937](https://our.internmc.facebook.com/intern/diff/D18498937/) [ghstack-poisoned]
…Engine. Pull Request resolved: #29787 The initializedContextIds_ map was never cleaned up in DistEngine and kept on growing as we continue to run backward passes. To fix this, in this PR we ensure that the context id is cleaned up from this map once we are done with the backward pass. Closes #29083 ghstack-source-id: 93947857 Differential Revision: [D18498937](https://our.internmc.facebook.com/intern/diff/D18498937/)
|
|
||
| // Mark the autograd context id as initialized and unlock. | ||
| initializedContextIds_.insert(autogradContext.contextId()); | ||
| ClearContextIdGuard guard(autogradContext.contextId()); |
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.
why this needs to be before the unlock?
mrshenli
left a comment
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.
This LGTM, just a minor comment on where to create the guard.
…ely in DistEngine." The initializedContextIds_ map was never cleaned up in DistEngine and kept on growing as we continue to run backward passes. To fix this, in this PR we ensure that the context id is cleaned up from this map once we are done with the backward pass. Closes #29083 Differential Revision: [D18498937](https://our.internmc.facebook.com/intern/diff/D18498937/) [ghstack-poisoned]
…Engine. Pull Request resolved: #29787 The initializedContextIds_ map was never cleaned up in DistEngine and kept on growing as we continue to run backward passes. To fix this, in this PR we ensure that the context id is cleaned up from this map once we are done with the backward pass. Closes #29083 ghstack-source-id: 94161770 Differential Revision: [D18498937](https://our.internmc.facebook.com/intern/diff/D18498937/)
|
This pull request has been merged in 63f4b60. |
1 similar comment
|
This pull request has been merged in 63f4b60. |
Stack from ghstack:
The initializedContextIds_ map was never cleaned up in DistEngine and
kept on growing as we continue to run backward passes. To fix this, in this PR
we ensure that the context id is cleaned up from this map once we are done with
the backward pass.
Closes #29083
Differential Revision: D18498937