[reland] torch/lib/c10d: Use torch_check instead of throwing runtime_error (#59918)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/59918
Reland of https://github.com/pytorch/pytorch/pull/59684
ghstack-source-id: 131303057
Test Plan: ci
Reviewed By: cbalioglu
Differential Revision: D29081452
fbshipit-source-id: 419df79341f702e796f7adf5f1071a6cd1dcd8d1