[device mesh] only check when world size > num_devices per host (#111091)
as titled
Pull Request resolved: https://github.com/pytorch/pytorch/pull/111091
Approved by: https://github.com/awgu, https://github.com/wz337
ghstack dependencies: #110898, #110900