Fix RPC Python User Function Error Handling (#63406)
authorShen Li <cs.shenli@gmail.com>
Wed, 18 Aug 2021 03:12:51 +0000 (20:12 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 18 Aug 2021 03:14:03 +0000 (20:14 -0700)
commit3fd8e09102c32d47a5af15c86be979eb75008d49
tree2d76ba05d2417a262fb496fe9eb506c67f15cff2
parentf12f667e12d8c6f3356267ec87ae15e7fdd0ed76
Fix RPC Python User Function Error Handling (#63406)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63406

The `RemoteException` will be thrown on the caller side when converting
the response message to IValue. Since it is a Python error, the error
message needs to be extracted explicitly and clear the `PyErr`.

Test Plan: Imported from OSS

Reviewed By: rohan-varma, ngimel

Differential Revision: D30372741

Pulled By: mrshenli

fbshipit-source-id: 1f72a7ee0c39cc2ef070f99884c142f7b3e0543d
torch/csrc/distributed/rpc/python_functions.cpp
torch/testing/_internal/distributed/rpc/rpc_test.py