add syncBN support for custom device (#104250)
Fixes #ISSUE_NUMBER
there are some hard checks for `cuda`, so I make optimize the check so that we can run it for other device.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/104250
Approved by: https://github.com/albanD