BAND, BOR and BXOR for NCCL (all_)reduce should throw runtime errors (#42669)
Summary:
cc rohan-varma
Fixes https://github.com/pytorch/pytorch/issues/41362 #39708
# Description
NCCL doesn't support `BAND, BOR, BXOR`. Since the [current mapping](https://github.com/pytorch/pytorch/blob/0642d17efc73041e5209e3be265d9a39892e8908/torch/lib/c10d/ProcessGroupNCCL.cpp#L39) doesn't contain any of the mentioned bitwise operator, a default value of `ncclSum` is used instead.
This PR should provide the expected behaviour where a runtime exception is thrown.
# Notes
- The way I'm throwing exceptions is derived from [ProcessGroupGloo.cpp](https://github.com/pytorch/pytorch/blob/0642d17efc73041e5209e3be265d9a39892e8908/torch/lib/c10d/ProcessGroupGloo.cpp#L101)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42669
Reviewed By: ezyang
Differential Revision: D22996295
Pulled By: rohan-varma
fbshipit-source-id: 83a9fedf11050d2890f9f05ebcedf53be0fc3516