Skip to content

RPC Backend Registry#26919

Closed
xush6528 wants to merge 3 commits intogh/xush6528/1/basefrom
gh/xush6528/1/head
Closed

RPC Backend Registry#26919
xush6528 wants to merge 3 commits intogh/xush6528/1/basefrom
gh/xush6528/1/head

Conversation

@xush6528
Copy link
Copy Markdown
Contributor

@xush6528 xush6528 commented Sep 26, 2019

Stack from ghstack:

Make the names more systematic

Differential Revision: D17262797

Make the name more systematic

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

[ghstack-poisoned]
@pytorchbot pytorchbot added the oncall: distributed Add this issue/PR to distributed oncall triage queue label Sep 26, 2019
Make the name more systematic

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

[ghstack-poisoned]
@xush6528 xush6528 requested a review from satgera September 26, 2019 20:29
@xush6528 xush6528 added the module: rpc Related to RPC, distributed autograd, RRef, and distributed optimizer label Sep 26, 2019
Copy link
Copy Markdown
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!

nit: this can be done in a followup PR. Shall we add some dummy backend implementation for testing? I believe right now we only have tests for invalid backend names.

Comment thread torch/distributed/rpc.py Outdated
from . import WorkerId
from .internal_rpc_utils import serialize, PythonUDF
from .rpc_backend_handler import is_backend_registered, registered_init_rpc
from .rpc_init_handler_registry import is_backend_registered, rpc_init
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense if we call this rpc_backend_registery and init_backend? Because we already have a init_rpc API in rpc.py.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating

@xush6528
Copy link
Copy Markdown
Contributor Author

LGTM!

nit: this can be done in a followup PR. Shall we add some dummy backend implementation for testing? I believe right now we only have tests for invalid backend names.

Agree. Each component should have corresponding tests.

We shouldn't make them get coverage brought by upper-level code.

Make the name more systematic

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 26, 2019
Pull Request resolved: #26919

Make the names more systematic

ghstack-source-id: 90870882

Differential Revision: [D17262797](https://our.internmc.facebook.com/intern/diff/D17262797/)
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in f01ae84.

Comment thread torch/distributed/rpc.py
from . import WorkerId
from .internal_rpc_utils import serialize, PythonUDF
from .rpc_backend_handler import is_backend_registered, registered_init_rpc
from .rpc_backend_registry import is_rpc_backend_registered, init_rpc_backend
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, these functions will now be available on the torch.distributed.rpc module.

Can you add an __all__ to make sure only the functions we want are available on the module?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xush6528 Can you ack this comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pietern

Sorry.

Will it be better if we don't use from "something" import *?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

I agree, but that puts the burden on the user. I think it's good practice to define the interface and define what should be exported and what not. This is not done everywhere consistently, but still there are plenty hits for both __all__ and import * in the entire code base.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rpc should create a folder like distributed/autograd does.
Maintain the names want to expose to users in torch/distributed/autograd/__init__.py.
Do the actual implmentation in torch/distributed/rpc/rpc_api.py.

xush6528 added a commit that referenced this pull request Sep 27, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 27, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 27, 2019
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 90955970

Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
xush6528 added a commit that referenced this pull request Sep 29, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 29, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 29, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 29, 2019
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 90998862

Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
xush6528 added a commit that referenced this pull request Sep 29, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 29, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 29, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 29, 2019
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 91003067

Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
xush6528 added a commit that referenced this pull request Sep 30, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Sep 30, 2019
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 91033024

Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
xush6528 added a commit that referenced this pull request Oct 1, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Oct 1, 2019
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 91071519

Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
xush6528 added a commit that referenced this pull request Oct 1, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Oct 1, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Oct 1, 2019
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 91086987

Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
xush6528 added a commit that referenced this pull request Oct 1, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Oct 1, 2019
Reverting accidental change in #26919

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

[ghstack-poisoned]
xush6528 added a commit that referenced this pull request Oct 1, 2019
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 91126906

Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
facebook-github-bot pushed a commit that referenced this pull request Oct 1, 2019
Summary:
Pull Request resolved: #26997

Reverting accidental change in #26919
ghstack-source-id: 91126906

Reviewed By: zhaojuanmao

Differential Revision: D17637468

fbshipit-source-id: 9ffcf4b15b37effe6b5d5f82338ff89298c82a52
@facebook-github-bot facebook-github-bot deleted the gh/xush6528/1/head branch October 28, 2019 22:22
pdlive215 pushed a commit to pdlive215/pytorch that referenced this pull request Nov 27, 2019
Summary:
Pull Request resolved: pytorch#26919

Make the names more systematic

ghstack-source-id: 90870882

Differential Revision: D17262797

fbshipit-source-id: 5a2e513a0d0cca5b699b40cbf530f51776392a2a
pdlive215 pushed a commit to pdlive215/pytorch that referenced this pull request Nov 27, 2019
Summary:
Pull Request resolved: pytorch#26997

Reverting accidental change in pytorch#26919
ghstack-source-id: 91126906

Reviewed By: zhaojuanmao

Differential Revision: D17637468

fbshipit-source-id: 9ffcf4b15b37effe6b5d5f82338ff89298c82a52
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
Summary:
Pull Request resolved: pytorch#26997

Reverting accidental change in pytorch#26919
ghstack-source-id: 91126906

Reviewed By: zhaojuanmao

Differential Revision: D17637468

fbshipit-source-id: 9ffcf4b15b37effe6b5d5f82338ff89298c82a52
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#26919

Make the names more systematic

ghstack-source-id: 90870882

Differential Revision: D17262797

fbshipit-source-id: 5a2e513a0d0cca5b699b40cbf530f51776392a2a
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#26997

Reverting accidental change in pytorch#26919
ghstack-source-id: 91126906

Reviewed By: zhaojuanmao

Differential Revision: D17637468

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

Labels

Merged module: rpc Related to RPC, distributed autograd, RRef, and distributed optimizer oncall: distributed Add this issue/PR to distributed oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants