Support rpc_async call with timeout in JIT#37884
Closed
rohan-varma wants to merge 9 commits intogh/rohan-varma/119/basefrom
Closed
Support rpc_async call with timeout in JIT#37884rohan-varma wants to merge 9 commits intogh/rohan-varma/119/basefrom
rohan-varma wants to merge 9 commits intogh/rohan-varma/119/basefrom
Conversation
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 10a6ac7 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 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 24 times. |
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
rohan-varma
added a commit
that referenced
this pull request
May 5, 2020
Pull Request resolved: #37884 Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. ghstack-source-id: 103534616 Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)!
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
xush6528
reviewed
May 7, 2020
| auto& kwargsDictIValue = | ||
| num_inputs >= 4 ? *stackIter++ : emptyDict; | ||
|
|
||
| // IValue corresponding to placeholder for RPC timeout. Used if no |
xush6528
reviewed
May 7, 2020
Comment on lines
+2793
to
+2798
| TreeList args_kwargs_trees( | ||
| input_trees.begin() + 2, | ||
| apply.inputs().size() == rpcMaxInputs ? input_trees.end() - 1 : input_trees.end()); | ||
|
|
||
| // Parse timeout, if applicable | ||
| Value* timeout = apply.inputs().size() == rpcMaxInputs ? emitExpr(Expr(input_trees[4])) : nullptr; |
Contributor
There was a problem hiding this comment.
I think you don't need to change this part.
Only need to rename args_kwargs_trees to args_kwargs_timeout_trees.
rohan-varma
commented
May 7, 2020
| // The RPC C++ entry API can take c10::Function directly. | ||
| if (apply.inputs().size() < 2 || apply.inputs().size() > 4) { | ||
| auto rpcMinInputs = 2; | ||
| auto rpcMaxInputs = 5; |
Contributor
Author
There was a problem hiding this comment.
Hmm not sure how to fix this clang-tidy error, or why it's erroring for 5 and not 2...
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
rohan-varma
added a commit
that referenced
this pull request
May 7, 2020
Pull Request resolved: #37884 Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. ghstack-source-id: 103640544 Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)!
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
rohan-varma
added a commit
that referenced
this pull request
May 7, 2020
Pull Request resolved: #37884 Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. ghstack-source-id: 103692764 Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)!
xush6528
approved these changes
May 7, 2020
Contributor
xush6528
left a comment
There was a problem hiding this comment.
Glad to see unified API!
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
rohan-varma
added a commit
that referenced
this pull request
May 12, 2020
Pull Request resolved: #37884 Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. ghstack-source-id: 103963030 Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)!
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in `jit/rpc_test_faulty`. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
rohan-varma
added a commit
that referenced
this pull request
May 13, 2020
Pull Request resolved: #37884 Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. ghstack-source-id: 104030322 Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)!
Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in `jit/rpc_test_faulty`. Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)! [ghstack-poisoned]
rohan-varma
added a commit
that referenced
this pull request
May 14, 2020
Pull Request resolved: #37884 Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. ghstack-source-id: 104083031 Differential Revision: [D21268895](https://our.internmc.facebook.com/intern/diff/D21268895/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D21268895/)!
Contributor
|
This pull request has been merged in f178bf1. |
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Pull Request resolved: pytorch#37884 Adds support to use rpc_timeout param in rpc_async call from jit for parity with eager mode. Done by: 1) Add timeout as an input in ir_emitter.cpp if it is specified 2) Parse float IValue from inputs in `prim::rpc_async` operator. Give the default if needed. Added UTs in jit/rpc_test. ghstack-source-id: 104083031 Test Plan: Added UTs in jit/rpc_test. Differential Revision: D21268895 fbshipit-source-id: 34bb10a2ac08b67dd6b789121ab43e2c0e696229
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
Adds support to use rpc_timeout param in rpc_async call from jit for
parity with eager mode. Done by:
prim::rpc_asyncoperator. Give the default if needed.Added UTs in
jit/rpc_test_faulty.Differential Revision: D21268895
NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!