Support TorchScript call over remote API (RRef)#32466
Support TorchScript call over remote API (RRef)#32466xush6528 wants to merge 10 commits intogh/xush6528/62/basefrom
Conversation
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` supports taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by make `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
💊 CircleCI build failures summary and remediationsAs of commit 1633a86: None of the build failures appear to be your fault.
Detailed failure analysisOne may explore the probable reasons each build failed interactively on the Dr. CI website. 🚧 1 upstream failure recognized by patterns:These builds matched patterns, but were probably caused by upstream breakages:
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 29 times. |
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
Pull Request resolved: #32466 It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. ghstack-source-id: 97007290 Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/)
zhaojuanmao
left a comment
There was a problem hiding this comment.
overall looks good! thanks for working on this. also, would you please add a test in rpc_test.py that can show the remote script call can receive remote exception?
| return futPtr; | ||
| } | ||
|
|
||
| PyRRef remoteTorchscript( |
There was a problem hiding this comment.
could we refactor pyRemoteBuiltin and make it to be used by both builtin and torchscript call?
There was a problem hiding this comment.
I tried, the inheritance setup about ScripCall, RemoteCall, ScriptCall makes it hard to consolidate in this PR. It's could be another PR's work to streamline them.
We want to consolidation
pyRpcBuiltinandrpcTorchscript.pyRemoteBuiltinandremoteTorchscript.
Maybe after removing template on RRef classes is a good time to re-visit this wish.
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
Pull Request resolved: #32466 It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. ghstack-source-id: 97137716 Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/)
|
Update to resolve comments. Will wait for and rebase after #30630. |
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
Pull Request resolved: #32466 It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. ghstack-source-id: 97192240 Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/)
zhaojuanmao
left a comment
There was a problem hiding this comment.
lgtm, please address inline comments and make sure all tests are green before landing
|
test failures are real |
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
Pull Request resolved: #32466 It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. ghstack-source-id: 97207196 Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/)
It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/) [ghstack-poisoned]
Pull Request resolved: #32466 It's a follow-up work of #32197. In #32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. ghstack-source-id: 97211168 Differential Revision: [D19440633](https://our.internmc.facebook.com/intern/diff/D19440633/)
|
The 2 failures are irrelevant to distributed module. |
|
This pull request has been merged in 6ad9e5c. |
Summary: Pull Request resolved: pytorch#32466 It's a follow-up work of pytorch#32197. In pytorch#32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. ghstack-source-id: 97211168 Test Plan: # Unit tests ``` buck test mode/dev-nosan //caffe2/test/distributed/rpc:rpc_fork -- test_script_function_exception buck build mode/dev-nosan //caffe2/test/distributed/rpc:rpc_fork buck-out/gen/caffe2/test/distributed/rpc/rpc_fork\#binary.par -r test_script_function_exception ``` ``` buck test mode/dev-nosan //caffe2/test/distributed/rpc:dist_autograd_fork -- test_backward_simple_script_call buck build mode/dev-nosan //caffe2/test/distributed/rpc:dist_autograd_fork buck-out/gen/caffe2/test/distributed/rpc/dist_autograd_fork\#binary.par -r test_backward_simple_script_call ``` Differential Revision: D19440633 fbshipit-source-id: d37f6dcdc0b80d35ac7bcba46ad6f9b831c3779b
Summary: Pull Request resolved: pytorch#32466 It's a follow-up work of pytorch#32197. In pytorch#32197, `rpc.sync_rpc(..) `and `rpc.rpc_async(..)` support taking a TorchScript annotated Python function as the user function for RPC. This PR extend along this direction by making `rpc.remote(..)` support taking a TorchScript annotated Python function as well. ghstack-source-id: 97211168 Test Plan: # Unit tests ``` buck test mode/dev-nosan //caffe2/test/distributed/rpc:rpc_fork -- test_script_function_exception buck build mode/dev-nosan //caffe2/test/distributed/rpc:rpc_fork buck-out/gen/caffe2/test/distributed/rpc/rpc_fork\#binary.par -r test_script_function_exception ``` ``` buck test mode/dev-nosan //caffe2/test/distributed/rpc:dist_autograd_fork -- test_backward_simple_script_call buck build mode/dev-nosan //caffe2/test/distributed/rpc:dist_autograd_fork buck-out/gen/caffe2/test/distributed/rpc/dist_autograd_fork\#binary.par -r test_backward_simple_script_call ``` Differential Revision: D19440633 fbshipit-source-id: d37f6dcdc0b80d35ac7bcba46ad6f9b831c3779b
Pull Request resolved: #36266 RecordFunction starts but never ends at an appropriate location. Might be recording wrong time numbers. This is following up on #32197 and #32466 ghstack-source-id: 101798149 Differential Revision: [D7857991](https://our.internmc.facebook.com/intern/diff/D7857991/)
Stack from ghstack:
It's a follow-up work of #32197.
In #32197,
rpc.sync_rpc(..)andrpc.rpc_async(..)support taking a TorchScript annotated Python function as the user function for RPC.This PR extend along this direction by making
rpc.remote(..)support taking a TorchScript annotated Python function as well.Differential Revision: D19440633