[sharded_tensor] support gloo/mpi backend in tests (#65855)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65855
This adjusted our test base to support non-nccl backend like gloo/mpi, so that we could test sharding on CPU with gloo/mpi backend.
ghstack-source-id: 140840866
Test Plan: wait for the CI for existing tests, also adding tests in the stacked diff above.
Reviewed By: pritamdamania87, bowangbj
Differential Revision: D31287162
fbshipit-source-id: d48dfc8ef886a4d34b1de42f3ce6b600b5c9a617