Repository navigation
[Testcase Refactoring] Update requires_accelerator_dist_backend to resolve/enable privateuse1 & enable PrivateUse1 tests in test_stage - #190153
Closed
PlatformLC wants to merge 2 commits into
Closed
PlatformLC wants to merge 2 commits into
PlatformLC wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/190153
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Contributor
Author
|
@pytorchbot label "topic: not user facing" |
Contributor
Author
|
cc @wjlFlyer @pjyFight @FuDdd @fffrog @lyriexs666 @jishuangfeng @JamesD18 @JiasenTian |
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Change `@requires_accelerator_dist_backend(["nccl", "xccl", "hccl"])` to `@requires_accelerator_dist_backend(["nccl", "xccl", "privateuse1"])` in the `_requires_multi_accelerator` helper. Depends on the framework change in the preceding commit (cherry-picked from pytorch#190153). Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_unit_tests.py -v ``` Verified on a PrivateUse1 host (8 devices): all 16 tests pass. On a CPU-only host all 16 are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Change `@requires_accelerator_dist_backend()` (no-args, which uses the default `ACCELERATOR_DIST_BACKENDS = ["nccl", "xccl", "hccl"]` and would enable HPU too) to `@requires_accelerator_dist_backend(["nccl", "xccl", "privateuse1"])` on all 4 tests. With the framework change from pytorch#190153, "privateuse1" is resolved to the actual backend name (e.g., "hccl") at call time — on HPU, `TEST_PRIVATEUSE1` is False so "privateuse1" is filtered out and HPU behavior is unchanged. Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
PlatformLC
force-pushed
the
test/test_stage
branch
from
July 16, 2026 06:27
b1d2ecd to
66722a9
Compare
Update `requires_accelerator_dist_backend` in `common_distributed.py` to resolve `"privateuse1"` to the actual backend name (e.g., "hccl") at call time via `Backend.default_device_backend_map`, then check availability with `c10d.is_backend_available`. On HPU, `TEST_PRIVATEUSE1` is False so `"privateuse1"` is filtered out and behavior is unchanged. Test Plan: ``` python test/distributed/pipelining/test_stage.py -v ``` Verified on a PrivateUse1 host (8 devices): the 8 StageTest/ StageNegativeTest tests run (via "privateuse1" resolved to "hccl") and pass. On a CPU-only host all 8 are skipped.
PlatformLC
force-pushed
the
test/test_stage
branch
from
July 16, 2026 06:33
66722a9 to
6405fa3
Compare
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Change @requires_accelerator_dist_backend(["nccl", "xccl", "hccl"]) to @requires_accelerator_dist_backend(ACCELERATOR_DIST_BACKENDS + ["privateuse1"]) in the _requires_multi_accelerator helper. The test file references the framework's ACCELERATOR_DIST_BACKENDS constant and appends "privateuse1" locally. Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_unit_tests.py -v ``` Verified on a PrivateUse1 host (8 devices): all 16 tests pass. On a CPU-only host all 16 are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Change @requires_accelerator_dist_backend() to @requires_accelerator_dist_backend(ACCELERATOR_DIST_BACKENDS + ["privateuse1"]) on all 4 tests. The test file references the framework's ACCELERATOR_DIST_BACKENDS constant and appends "privateuse1" locally. Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
Change `@requires_accelerator_dist_backend(["nccl", "xccl"])` to `@requires_accelerator_dist_backend(ACCELERATOR_DIST_BACKENDS + ["privateuse1"])` on the 7 StageTest/StageNegativeTest tests, and update the skip message "2+ GPUs" -> "2+ accelerators". The test file references the framework's `ACCELERATOR_DIST_BACKENDS` constant and appends `"privateuse1"` locally — the framework constant itself is unchanged. Depends on the framework change in the preceding commit. Test Plan: ``` python test/distributed/pipelining/test_stage.py -v ``` Verified on a PrivateUse1 host (8 devices): all 8 tests pass. On a CPU-only host all 8 are skipped.
PlatformLC
force-pushed
the
test/test_stage
branch
from
July 16, 2026 06:53
6405fa3 to
8357455
Compare
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Change `@requires_accelerator_dist_backend()` (no-args, which uses the default `ACCELERATOR_DIST_BACKENDS = ["nccl", "xccl", "hccl"]` and would enable HPU too) to `@requires_accelerator_dist_backend(["nccl", "xccl", "privateuse1"])` on all 4 tests. With the framework change from pytorch#190153, "privateuse1" is resolved to the actual backend name (e.g., "hccl") at call time — on HPU, `TEST_PRIVATEUSE1` is False so "privateuse1" is filtered out and HPU behavior is unchanged. Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Update requires_accelerator_dist_backend in common_distributed.py to resolve "privateuse1" to the actual backend name (e.g., "hccl") at call time via Backend.default_device_backend_map, then check availability with c10d.is_backend_available. On HPU, TEST_PRIVATEUSE1 is False so "privateuse1" is filtered out and behavior is unchanged. Cherry-picked from pytorch#190153. Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
- Change @requires_accelerator_dist_backend() to @requires_accelerator_dist_backend(ACCELERATOR_DIST_BACKENDS + ["privateuse1"]) on all 4 tests. Originally used () (no-args, default list), now references ACCELERATOR_DIST_BACKENDS constant and appends "privateuse1" locally. - Replace @skip_if_lt_x_gpu(8) with @skip_if_lt_x_devices(8) (from pytorch#187650). - Replace at_least_x_gpu(8) with at_least_x_device(8) and "GPUs" -> "accelerators". Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Update requires_accelerator_dist_backend in common_distributed.py to resolve "privateuse1" to the actual backend name (e.g., "hccl") at call time via Backend.default_device_backend_map, then check availability with c10d.is_backend_available. On HPU, TEST_PRIVATEUSE1 is False so "privateuse1" is filtered out and behavior is unchanged. Cherry-picked from pytorch#190153. Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_unit_tests.py -v ``` Verified on a PrivateUse1 host (8 devices): all 16 tests pass. On a CPU-only host all 16 are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
- Change @requires_accelerator_dist_backend(["nccl", "xccl", "hccl"]) to @requires_accelerator_dist_backend(["nccl", "xccl", "privateuse1"]) in the _requires_multi_accelerator helper. - init_pg: if device_type == "cuda": torch.cuda.set_device(self.device) -> if torch.accelerator.is_available(): torch.accelerator.set_device_index(self.device). - Rename _requires_multi_gpu -> _requires_multi_accelerator and the skip message "4+ GPUs" -> "4+ accelerators". Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_unit_tests.py -v ``` Verified on a PrivateUse1 host (8 devices): all 16 tests pass. On a CPU-only host all 16 are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Update `requires_accelerator_dist_backend` in `common_distributed.py` to resolve the PrivateUse1 entry in the backends list to the host's actual communication backend for the PrivateUse1 device type at call time via `Backend.default_device_backend_map`, then check availability with `c10d.is_backend_available`. On HPU, `TEST_PRIVATEUSE1` is False so the PrivateUse1 entry is filtered out and existing behavior is unchanged. Cherry-picked from pytorch#190153. Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
- Change `@requires_accelerator_dist_backend()` to `@requires_accelerator_dist_backend(ACCELERATOR_DIST_BACKENDS + ["privateuse1"])` on all 4 tests. The list was originally `()` (no-args, default), so it now references the `ACCELERATOR_DIST_BACKENDS` constant and appends `"privateuse1"` locally — the framework constant itself is unchanged. - Replace `@skip_if_lt_x_gpu(8)` with `@skip_if_lt_x_devices(8)` (from pytorch#187650). - Replace `at_least_x_gpu(8)` with `at_least_x_device(8)` (added to `common_distributed.py` in this commit) and the skip message `"8+ GPUs"` -> `"8+ accelerators"`. Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Update `requires_accelerator_dist_backend` in `common_distributed.py` to resolve the PrivateUse1 entry in the backends list to the host's actual communication backend for the PrivateUse1 device type at call time via `Backend.default_device_backend_map`, then check availability with `c10d.is_backend_available`. On HPU, `TEST_PRIVATEUSE1` is False so the PrivateUse1 entry is filtered out and existing behavior is unchanged. Cherry-picked from pytorch#190153. Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_unit_tests.py -v ``` Verified on a PrivateUse1 host (8 devices): all 16 tests pass. On a CPU-only host all 16 are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
- In the `_requires_multi_accelerator` helper, change `@requires_accelerator_dist_backend(["nccl", "xccl"])` to `@requires_accelerator_dist_backend(["nccl", "xccl", "privateuse1"])`. The list was originally explicit, so it stays explicit (it does not reference `ACCELERATOR_DIST_BACKENDS`). - `init_pg`: `if device_type == "cuda": torch.cuda.set_device(self.device)` -> `if torch.accelerator.is_available(): torch.accelerator.set_device_index(self.device)`. - Rename `_requires_multi_gpu` -> `_requires_multi_accelerator` and the skip message `"4+ GPUs"` -> `"4+ accelerators"`. Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_unit_tests.py -v ``` Verified on a PrivateUse1 host (8 devices): all 16 tests pass. On a CPU-only host all 16 are skipped.
This was referenced Jul 16, 2026
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Update `requires_accelerator_dist_backend` in `common_distributed.py` to resolve the PrivateUse1 entry in the backends list to the host's actual communication backend for the PrivateUse1 device type at call time via `Backend.default_device_backend_map`, then check availability with `c10d.is_backend_available`. On HPU, `TEST_PRIVATEUSE1` is False so the PrivateUse1 entry is filtered out and existing behavior is unchanged. Cherry-picked from pytorch#190153. Test Plan: ``` python test/distributed/pipelining/test_schedule.py -v ``` Verified on a PrivateUse1 host (8 devices): all 56 tests pass, including the 2 gated tests (previously skipped). On a CPU-only host the 2 gated tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 16, 2026
Change `@requires_accelerator_dist_backend(["nccl", "xccl"])` to `@requires_accelerator_dist_backend(["nccl", "xccl", "privateuse1"])` on the `test_grad_with_v_schedule` and `test_grad_with_split_b_w` tests. The list was originally explicit, so it stays explicit (it does not reference `ACCELERATOR_DIST_BACKENDS`). Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/pipelining/test_schedule.py -v ``` Verified on a PrivateUse1 host (8 devices): all 56 tests pass, including the 2 gated tests (previously skipped). On a CPU-only host the 2 gated tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 17, 2026
Update `requires_accelerator_dist_backend` in `common_distributed.py` to resolve the PrivateUse1 entry in the backends list to the host's actual communication backend for the PrivateUse1 device type at call time via `Backend.default_device_backend_map`, then check availability with `c10d.is_backend_available`. On HPU, `TEST_PRIVATEUSE1` is False so the PrivateUse1 entry is filtered out and existing behavior is unchanged. Cherry-picked from pytorch#190153. Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_integration.py -v ``` On a CPU-only host all tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 17, 2026
- In the `_requires_multi_accelerator` helper, change the `@requires_accelerator_dist_backend` backend list to `["nccl", "xccl", "privateuse1"]` (was hardcoded to a specific vendor backend; now uses privateuse1, resolved by the framework to the actual backend). - `init_pg`: `if device_type == "cuda": torch.cuda.set_device(self.device)` -> `if torch.accelerator.is_available(): torch.accelerator.set_device_index(self.device)`. - Rename `_requires_multi_gpu` -> `_requires_multi_accelerator` and the skip message "4+ GPUs" -> "4+ accelerators". Depends on the framework change in the preceding commit (from pytorch#190153). Test Plan: ``` python test/distributed/pipelining/test_dtensor_pp_integration.py -v ``` On a CPU-only host all tests are skipped.
Collaborator
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 21, 2026
Update `requires_accelerator_dist_backend` in `common_distributed.py` to resolve the PrivateUse1 entry in the backends list to the host's actual communication backend for the PrivateUse1 device type at call time via `Backend.default_device_backend_map`, then check availability with `c10d.is_backend_available`. On HPU, `TEST_PRIVATEUSE1` is False so the PrivateUse1 entry is filtered out and existing behavior is unchanged. Cherry-picked from pytorch#190153. Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices): test_pp_and_dcp passes. On a CPU-only host all tests are skipped.
PlatformLC
added a commit
to PlatformLC/pytorch
that referenced
this pull request
Jul 21, 2026
- Change `@requires_accelerator_dist_backend()` to `@requires_accelerator_dist_backend(ACCELERATOR_DIST_BACKENDS + ["privateuse1"])` on all 4 tests (the default list doesn't include PrivateUse1). - Extend `at_least_x_gpu` in `common_distributed.py` to be hardware-agnostic (uses `torch.accelerator.is_available()` and `torch.accelerator.device_count()`). The naming retains "gpu" for backward compatibility, consistent with pytorch#187650's approach to `skip_if_lt_x_gpu`. - No changes to `skip_if_lt_x_gpu` (extended by pytorch#187650 to be hardware-agnostic) or the skip message `"8+ GPUs"` (kept for backward compatibility). Depends on the framework change in the preceding commit (from pytorch#190153) and pytorch#187650 (skip_if_lt_x_gpu hardware-agnostic). Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` On a CPU-only host all tests are skipped.
Contributor
Author
|
@pytorchbot label "module: tests/distributed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates
requires_accelerator_dist_backendincommon_distributed.pyto dynamically resolve"privateuse1"to the actual backend name at call time, and enables theStageTest/StageNegativeTesttests intest_stage.pyto run on out-of-tree PrivateUse1 accelerators.This is a step toward making pipelining distributed tests device-agnostic for PrivateUse1 backends.
Changes
common_distributed.py(Commit 1): Updatedrequires_accelerator_dist_backendto resolve"privateuse1"to the actual backend name viaBackend.default_device_backend_mapat call time, then check availability withc10d.is_backend_available. AddedTEST_PRIVATEUSE1andTEST_PRIVATEUSE1_DEVICE_TYPEimports. On HPU,TEST_PRIVATEUSE1isFalse, so"privateuse1"is filtered out and HPU behavior is unchanged.test_stage.py(Commit 2): Changed@requires_accelerator_dist_backend(["nccl", "xccl"])to@requires_accelerator_dist_backend(["nccl", "xccl", "privateuse1"])on the 7StageTest/StageNegativeTesttests, and updated the skip message "2+ GPUs" -> "2+ accelerators".Motivation
requires_accelerator_dist_backend(["nccl", "xccl"])excluded PrivateUse1, so the 7 tests were skipped on PrivateUse1 accelerators even when the backend was available. Adding"privateuse1"(resolved dynamically to the actual backend name) lets the tests run on PrivateUse1 (and still run on CUDA via nccl, still skip on CPU with no accelerator backend). HPU is unaffected —"privateuse1"is not resolved on HPU (TEST_PRIVATEUSE1isFalse).Notes
common_distributed.pyframework change) is standalone and can be cherry-picked by other PRs that depend onrequires_accelerator_dist_backend. After it merges, those PRs rebase onto main and can merge directly.