There is torch.distributed.is_available() API to check if distributed package is available. APIs from distributed package is only available when is_available returns true. Let me add that to our docs.