Skip to content

Conversation

xush6528
Copy link
Contributor

@xush6528 xush6528 commented May 8, 2020

Stack from ghstack:

It's a followup of #32556, where an error handling boilerplate code path was added to the FutureMessage callback.

However, I noticed that the FutureMessage could never be set with an error, because the FutureMessage is a member in OwnerRRef,

  • OwnerRRef does not have a setError method yet.
  • The FutureMessage is only used for signaling
  • The value of the RRef is contained in the value_ field.

With the Future being generalized, it could contain more value types, not limited to Message.

This PR migrates the OwnerRRef value from the value_ field to the generic Future.

In a later PR, it will be super easy to add a setError method for OwnerRRef, which calls future_.setError(..). (I decide to do it later. I think it's better to migrate the call sites together with adding the new setError method.)

Also, this fixes the issue pointed out by https://github.com/pytorch/pytorch/pull/31086/files#r422256916.

This PR was submitted as #32608.

Differential Revision: D5707692

It's a followup of #32556, where an error handling boilerplate code path was added to the FutureMessage callback.

However, I noticed that the FutureMessage could never be set with an error, because the FutureMessage is a member in OwnerRRef,

- OwnerRRef does not have a setError method yet.
- The FutureMessage is only used for signaling
- The value of the RRef is contained in the `value_` field.

With the Future being generalized, it could contain more value types, not limited to Message.

This PR migrates the OwnerRRef value from the `value_` field to the generic Future.

In a later PR, it will be super easy to add a `setError` method for OwnerRRef, which calls `future_.setError(..)`. (I decide to do it later. I think it's better to migrate the call sites together with adding the new `setError` method.)

Also, this fixes the issue pointed out by https://github.com/pytorch/pytorch/pull/31086/files#r422256916.

This PR was submitted as #32608.

Differential Revision: [D5707692](https://our.internmc.facebook.com/intern/diff/D5707692/)

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request May 8, 2020
It's a followup of #32556, where an error handling boilerplate code path was added to the FutureMessage callback.

However, I noticed that the FutureMessage could never be set with an error, because the FutureMessage is a member in OwnerRRef,

- OwnerRRef does not have a setError method yet.
- The FutureMessage is only used for signaling
- The value of the RRef is contained in the `value_` field.

With the Future being generalized, it could contain more value types, not limited to Message.

This PR migrates the OwnerRRef value from the `value_` field to the generic Future.

In a later PR, it will be super easy to add a `setError` method for OwnerRRef, which calls `future_.setError(..)`. (I decide to do it later. I think it's better to migrate the call sites together with adding the new `setError` method.)

Also, this fixes the issue pointed out by https://github.com/pytorch/pytorch/pull/31086/files#r422256916.

This PR was submitted as #32608.

Differential Revision: [D5707692](https://our.internmc.facebook.com/intern/diff/D5707692/)

ghstack-source-id: 103757743
Pull Request resolved: #38143
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.

LGTM! Thanks for fixing!

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 615235f.

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.

4 participants