Make Python RPC handler does not hold module in global variable (#25458)
Summary:
# Problem
ProcessGroupAgent used in test_rpc has SIGSEGV on exiting.
# Solution
It was because the python module was unpexceted destructed twice.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25458
Test Plan: Run prototype tests on top of this diff.
Differential Revision: D17127093
Pulled By: xush6528
fbshipit-source-id: 4b86cd8465e8cca6fce1c163e78160a2386fa9c3