[rpc][jit] support rpc_sync in TorchScript (#43043)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/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
This commit is contained in:
Wanchao Liang
2020-09-11 14:48:45 -07:00
committed by Facebook GitHub Bot
parent 8bec7cfa91
commit 3e5df5f216
9 changed files with 220 additions and 184 deletions

View File

@ -230,7 +230,8 @@ struct PythonPrintImpl {
return false;
// subgraph may use this more than once, so disable inlining
if (use.user->kind() == prim::fork || use.user->kind() == prim::rpc_async)
if (use.user->kind() == prim::fork || use.user->kind() == prim::rpc_async ||
use.user->kind() == prim::rpc_sync)
return false;
// isinstance appearing in an if expression