Add RPC internal helper that overrides the default pickler. (#30185)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30185
To enable share_memory over RPC, add an internal helper that overrides the default RPC pickler.
Replace D18598974
ghstack-source-id: 94299660
Test Plan:
`python test/test_rpc_spawn RpcTestWithSpawn.test_use_rpc_pickler`
`buck test mode/dev-nosan //caffe2/test:rpc_spawn -- test_use_rpc_pickler`
Reviewed By: mrshenli
Differential Revision: D18621372
fbshipit-source-id: c680ef711b2c42524c47a5266e911fa8e0cd45ae