Skip to content

Support rpc_async call with timeout in JIT#37884

Closed
rohan-varma wants to merge 9 commits intogh/rohan-varma/119/basefrom
gh/rohan-varma/119/head
Closed

Support rpc_async call with timeout in JIT#37884
rohan-varma wants to merge 9 commits intogh/rohan-varma/119/basefrom
gh/rohan-varma/119/head

Conversation

@rohan-varma
Copy link
Copy Markdown
Contributor

@rohan-varma rohan-varma commented May 5, 2020

Stack from ghstack:

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

NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!

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]
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label May 5, 2020
@rohan-varma rohan-varma requested a review from xush6528 May 5, 2020 21:44
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented May 5, 2020

💊 CI failures summary and remediations

As 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.

See how this bot performed.

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]
auto& kwargsDictIValue =
num_inputs >= 4 ? *stackIter++ : emptyDict;

// IValue corresponding to placeholder for RPC timeout. Used if no
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.

Missed a leading space?

Comment thread torch/csrc/jit/frontend/ir_emitter.cpp Outdated
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;
Copy link
Copy Markdown
Contributor

@xush6528 xush6528 May 7, 2020

Choose a reason for hiding this comment

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

I think you don't need to change this part.

Only need to rename args_kwargs_trees to args_kwargs_timeout_trees.

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.

Good point!

Comment thread torch/csrc/jit/frontend/ir_emitter.cpp Outdated
// 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;
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.

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/)!
@rohan-varma rohan-varma requested a review from xush6528 May 7, 2020 20:56
Copy link
Copy Markdown
Contributor

@xush6528 xush6528 left a comment

Choose a reason for hiding this comment

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

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/)!
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in f178bf1.

@facebook-github-bot facebook-github-bot deleted the gh/rohan-varma/119/head branch May 18, 2020 14:16
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants