-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[rpc][jit] support rpc_sync in TorchScript #43043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This add the support for rpc_sync in TorchScript in a way similar to rpc_async [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 0565576 (more details on the Dr. CI page):
Extra GitHub checks: 1 failed
ci.pytorch.org: 1 failedcodecov.io: 1 failed
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 or post in the (internal) Dr. CI Users group. This comment has been revised 56 times. |
This add the support for rpc_sync in TorchScript in a way similar to rpc_async [ghstack-poisoned]
This add the support for rpc_sync in TorchScript in a way similar to rpc_async [ghstack-poisoned]
mrshenli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for adding this!
It will be great if we can also cover the case where user function throws, but it can be added in follow up PRs.
| py::module::import("torch.distributed.rpc").attr("rpc_async").ptr()) { | ||
| return SpecialFormValue::create(prim::rpc_async); | ||
| } else if ( | ||
| // RPC module is only avaialble when build flag "USE_DISTRIBUTED" is on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant space after "available"
| } else if ( | ||
| // RPC module is only avaialble when build flag "USE_DISTRIBUTED" is on. | ||
| obj.ptr() == | ||
| py::module::import("torch.distributed.rpc").attr("rpc_sync").ptr()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the indent here intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's formatted by clang-format (and stay aligned with the above rpc_async op)
| futureIValuePtr->wait(); | ||
| auto res = futureIValuePtr->value(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could throw error. Is that OK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch! handled the error.
This add the support for rpc_sync in TorchScript in a way similar to rpc_async [ghstack-poisoned]
This add the support for rpc_sync in TorchScript in a way similar to rpc_async Differential Revision: [D23252039](https://our.internmc.facebook.com/intern/diff/D23252039) [ghstack-poisoned]
This add the support for rpc_sync in TorchScript in a way similar to rpc_async Differential Revision: [D23252039](https://our.internmc.facebook.com/intern/diff/D23252039) [ghstack-poisoned]
This add the support for rpc_sync in TorchScript in a way similar to rpc_async Differential Revision: [D23252039](https://our.internmc.facebook.com/intern/diff/D23252039) [ghstack-poisoned]
This add the support for rpc_sync in TorchScript in a way similar to rpc_async Differential Revision: [D23252039](https://our.internmc.facebook.com/intern/diff/D23252039) [ghstack-poisoned]
This add the support for rpc_sync in TorchScript in a way similar to rpc_async Differential Revision: [D23252039](https://our.internmc.facebook.com/intern/diff/D23252039) [ghstack-poisoned]
This add the support for rpc_sync in TorchScript in a way similar to rpc_async Differential Revision: [D23252039](https://our.internmc.facebook.com/intern/diff/D23252039) [ghstack-poisoned]
Codecov Report
@@ Coverage Diff @@
## gh/wanchaol/121/base #43043 +/- ##
=====================================================
Coverage 68.05% 68.06%
=====================================================
Files 382 382
Lines 49468 49461 -7
=====================================================
Hits 33667 33667
+ Misses 15801 15794 -7
Continue to review full report at Codecov.
|
This add the support for rpc_sync in TorchScript in a way similar to rpc_async Differential Revision: [D23252039](https://our.internmc.facebook.com/intern/diff/D23252039) [ghstack-poisoned]
Summary: Pull Request resolved: #43043 This add the support for rpc_sync in TorchScript in a way similar to rpc_async Test Plan: Imported from OSS Reviewed By: mrshenli Differential Revision: D23252039 Pulled By: wanchaol fbshipit-source-id: 8a05329cb8a24079b2863178b73087d47273914c
Stack from ghstack:
This add the support for rpc_sync in TorchScript in a way similar to
rpc_async
Differential Revision: D23252039