[pytorch][fakepg] enhance fakepg: broadcast and scatter (#107480)
Summary:
Add support for broadcast and scatter in FakeProcessGroup.
As a side note, we can't easily support broadcast_object_list or
scatter_object_list since they rely on actual broadcasted/scattered
values for pickle object deserialization. We could add support for rank 0, but
other to support ranks may need additional changes outside of
FakeProcessGroup.
Test Plan:
`buck2 run mode/dev-nosan -c fbcode.enable_gpu_sections=true
//caffe2/test/distributed:fake_pg`, on of TARGETS diff: D48481513
`python test/distributed/test_fake_pg.py` after github sync
Differential Revision: D48481512
Pull Request resolved: https://github.com/pytorch/pytorch/pull/107480
Approved by: https://github.com/wanchaol