Skip to content

Conversation

@pritamdamania87
Copy link
Contributor

@pritamdamania87 pritamdamania87 commented Nov 14, 2019

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

…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]
pritamdamania87 pushed a commit that referenced this pull request Nov 14, 2019
…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
Copy link
Contributor

@pietern pietern left a 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>
Copy link
Contributor

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]
pritamdamania87 pushed a commit that referenced this pull request Nov 14, 2019
…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());
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 needs to be before the unlock?

Copy link
Contributor

@mrshenli mrshenli left a 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]
pritamdamania87 pushed a commit that referenced this pull request Nov 19, 2019
…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/)
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 63f4b60.

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 63f4b60.

@facebook-github-bot facebook-github-bot deleted the gh/pritamdamania87/26/head branch November 22, 2019 15:17
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.

6 participants