Avoid device -> host syncs in load_balancing_loss_func (#50463)
* Use torch.histc instead of torch.bincount in load_balancing_loss_func to avoid unnecessary device -> host sync
* use float for cpu / mps and int for gpu for compatibility / determinstism