RPC Backend Registry#26919
Conversation
Make the name more systematic Differential Revision: [D17262797](https://our.internmc.facebook.com/intern/diff/D17262797/) [ghstack-poisoned]
Make the name more systematic Differential Revision: [D17262797](https://our.internmc.facebook.com/intern/diff/D17262797/) [ghstack-poisoned]
mrshenli
left a comment
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
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]
Pull Request resolved: #26919 Make the names more systematic ghstack-source-id: 90870882 Differential Revision: [D17262797](https://our.internmc.facebook.com/intern/diff/D17262797/)
|
This pull request has been merged in f01ae84. |
| 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Pull Request resolved: #26997 Reverting accidental change in #26919 ghstack-source-id: 90955970 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Pull Request resolved: #26997 Reverting accidental change in #26919 ghstack-source-id: 90998862 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Pull Request resolved: #26997 Reverting accidental change in #26919 ghstack-source-id: 91003067 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Pull Request resolved: #26997 Reverting accidental change in #26919 ghstack-source-id: 91033024 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Pull Request resolved: #26997 Reverting accidental change in #26919 ghstack-source-id: 91071519 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Pull Request resolved: #26997 Reverting accidental change in #26919 ghstack-source-id: 91086987 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Reverting accidental change in #26919 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/) [ghstack-poisoned]
Pull Request resolved: #26997 Reverting accidental change in #26919 ghstack-source-id: 91126906 Differential Revision: [D17637468](https://our.internmc.facebook.com/intern/diff/D17637468/)
Summary: Pull Request resolved: pytorch#26919 Make the names more systematic ghstack-source-id: 90870882 Differential Revision: D17262797 fbshipit-source-id: 5a2e513a0d0cca5b699b40cbf530f51776392a2a
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
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
Summary: Pull Request resolved: pytorch#26919 Make the names more systematic ghstack-source-id: 90870882 Differential Revision: D17262797 fbshipit-source-id: 5a2e513a0d0cca5b699b40cbf530f51776392a2a
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
Stack from ghstack:
Make the names more systematic
Differential Revision: D17262797