Repository navigation
[Testcase Refactoring] Use is_backend_available for MultiProcContinuousTest backend check - #192186
PlatformLC wants to merge 1 commit into
Conversation
…usTest backend check
Replace the hardcoded {nccl, gloo, mpi, xccl} availability dict in
MultiProcContinuousTest._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, so the spawn-time check no longer silently passes through
unlisted backends.
This is the prerequisite for subclasses to drop their
@requires_accelerator_dist_backend gate: with the backend availability
check centralized here, the decorator is redundant.
Test Plan:
```
python test/distributed/pipelining/test_stage.py -v
```
is_backend_available is behavior-preserving for the listed backends
(nccl/gloo/mpi/xccl); the out-of-tree/PrivateUse1 coverage it adds is
exercised by the dependent test-file PRs (e.g. test_stage pytorch#192044) once
they drop @requires_accelerator_dist_backend and rebase on top.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/192186
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 11462c9 with merge base 1424eca ( CRCR (non-blocking) - The following CRCR downstream CI jobs failed but are non-blocking:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "module: tests/distributed" |
|
Replacing the hardcoded {nccl,gloo,mpi,xccl} availability dict with is_backend_available correctly covers out-of-tree third-party backends (registered via Backend.register_backend) instead of silently passing them through. Behavior is equivalent for the listed backends. |
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot label "topic: not user facing" |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…usTest backend check (pytorch#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, pytorch#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 (pytorch#185590) to decouple tests from hardcoded CUDA/NCCL assumptions so out-of-tree PrivateUse1 accelerators can run the suite. Split out from pytorch#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 pytorch#185590. Pull Request resolved: pytorch#192186 Approved by: https://github.com/jishuangfeng, https://github.com/fffrog, https://github.com/albanD
…usTest backend check (pytorch#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, pytorch#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 (pytorch#185590) to decouple tests from hardcoded CUDA/NCCL assumptions so out-of-tree PrivateUse1 accelerators can run the suite. Split out from pytorch#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 pytorch#185590. Pull Request resolved: pytorch#192186 Approved by: https://github.com/jishuangfeng, https://github.com/fffrog, https://github.com/albanD
Summary
Replace
MultiProcContinuousTest's hardcoded backend-availability dict in_ensure_processes_spawnedwithc10d.is_backend_available(backend). The generic API covers any backend registered viaBackend.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 inMultiProcContinuousTest._ensure_processes_spawnedwithc10d.is_backend_available(backend). This is the prerequisite for test-file PRs (e.g. test_stage, [Testcase Refactoring] Refactor test_stage with instantiate_device_type_tests and hw-classification #192044) to drop their@requires_accelerator_dist_backendgate: 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.