[Testcase Refactoring] Use is_backend_available for MultiProcContinuousTest backend check (#192186)
## Summary
Replace `MultiProcContinuousTest`'s hardcoded backend-availability dict in `_ensure_processes_spawned` with `c10d.is_backend_available(backend)`. The generic API covers any backend registered via `Backend.register_backend`, including out-of-tree PrivateUse1 accelerators' backends, so the spawn-time check no longer silently passes through unlisted backends.
## Changes
- `torch/testing/_internal/common_distributed.py`: Replaced the hardcoded `{nccl, gloo, mpi, xccl}` backend-availability dict in `MultiProcContinuousTest._ensure_processes_spawned` with `c10d.is_backend_available(backend)`. This is the prerequisite for test-file PRs (e.g. test_stage, #192044) to drop their `@requires_accelerator_dist_backend` gate: with the backend availability check centralized here, the decorator becomes redundant.
## Motivation
Part of the test-case refactoring initiative (#185590) to decouple tests from hardcoded CUDA/NCCL assumptions so out-of-tree PrivateUse1 accelerators can run the suite. Split out from #192044 per review so the base-class/tooling change lands first and the test-file changes rebase on top.
## Notes
This is part of the test case refactoring initiative tracked in #185590.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/192186
Approved by: https://github.com/jishuangfeng, https://github.com/fffrog, https://github.com/albanD P
PlatformLC committed
373d69099688d895d2c45387e570c0b5099e8988
Parent: 8b1669d
Committed by PyTorch MergeBot <pytorchmergebot@users.noreply.github.com>
on 8/24/2026, 5:38:16 AM