Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/193080
Note: Links to docs will display an error until the docs builds have been completed.
|
This PR needs a
|
Contributor
Author
|
@pytorchbot label "module: tests/distributed" |
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 14, 2026
…ty gating Summary: - Replace @requires_nccl() with @requires_capabilities(Capability.distributed.backend) - Replace .cuda(self.rank) with .to(device) - Replace hardcoded placement with dynamic device_type - Add hw_classification = HardwareClassification.ACCELERATOR - Add instantiate_device_type_tests for device-variant generation Part of pytorch#185590. Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#192417, pytorch#193080
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 14, 2026
…ty gating Summary: - Replace @requires_nccl() with @requires_capabilities(Capability.distributed.backend) - Replace .cuda(self.rank) with .to(device) - Replace hardcoded placement with dynamic device_type - Add hw_classification = HardwareClassification.ACCELERATOR - Add instantiate_device_type_tests for device-variant generation Part of pytorch#185590. Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#192417, pytorch#193080
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 14, 2026
…on label Summary: - Refactor to instantiate_device_type_tests + spawn combination with framework-injected device parameter - Replace implicit CUDA device-index moves (.to(rank)) with explicit torch.device(device_type, rank); bare device type derived from injected device via torch.device(device).type - Switch backend admission to @requires_capabilities(Capability.distributed.backend) - Add hw_classification = HardwareClassification.ACCELERATOR Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#193080 Test Plan: - NPU (PrivateUse1, Ascend 910B3, 4 devices): 2 tests x 4 procs pass (Ran 2 tests - OK), both with PR-CI env vars and full run - CPU: no variant generated (except_for="cpu"), NO TESTS RAN (expected, same as only_for precedent) - CUDA: TODO - A100 regression run to be confirmed in PR thread
This was referenced Aug 14, 2026
Draft
Draft
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 20, 2026
…ators via capability gates Replace @requires_accelerator_dist_backend(["nccl", "xccl"]) with @requires_capabilities(Capability.distributed.backend) for capability-based admission. Add hw_classification = ACCELERATOR and instantiate_device_type_tests(except_for="cpu"). Keeps ShardedTensorTestBase + with_comms(backend=backend) + TEST_GPU_NUM + module-level device_type/backend globals unchanged. Depends on: pytorch#191919, pytorch#193080, pytorch#190528, pytorch#187650
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 20, 2026
…ators via capability gates Replace @requires_accelerator_dist_backend(["nccl", "xccl"]) with @requires_capabilities(Capability.distributed.backend) for capability-based admission. Add hw_classification = ACCELERATOR and instantiate_device_type_tests(except_for="cpu"). Keeps ShardedTensorTestBase + with_comms(backend=backend) + TEST_GPU_NUM + module-level device_type/backend globals unchanged. Depends on: pytorch#191919, pytorch#193080, pytorch#190528, pytorch#187650
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 20, 2026
…ators via capability gates Replace @requires_accelerator_dist_backend(["nccl", "xccl"]) with @requires_capabilities(Capability.distributed.backend) for capability-based admission. Add hw_classification = ACCELERATOR and instantiate_device_type_tests(except_for="cpu"). Keeps ShardedTensorTestBase + with_comms(backend=backend) + TEST_GPU_NUM + module-level device_type/backend globals unchanged. Depends on: pytorch#191919, pytorch#193080, pytorch#190528, pytorch#187650
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 21, 2026
…ators via capability gates Replace @requires_accelerator_dist_backend(["nccl", "xccl"]) with @requires_capabilities(Capability.distributed.backend) for capability-based admission. Add hw_classification = ACCELERATOR and instantiate_device_type_tests(except_for="cpu"). Keeps ShardedTensorTestBase + with_comms(backend=backend) + TEST_GPU_NUM + module-level device_type/backend globals unchanged. Depends on: pytorch#191919, pytorch#193080, pytorch#190528, pytorch#187650
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 24, 2026
…on label Summary: - Refactor to instantiate_device_type_tests + spawn combination with framework-injected device parameter - Replace implicit CUDA device-index moves (.to(rank)) with explicit torch.device(device_type, rank); bare device type derived from injected device via torch.device(device).type - Switch backend admission to @requires_capabilities(Capability.distributed.backend) - Add hw_classification = HardwareClassification.ACCELERATOR Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#193080 Test Plan: - NPU (PrivateUse1, Ascend 910B3, 4 devices): 2 tests x 4 procs pass (Ran 2 tests - OK), both with PR-CI env vars and full run - CPU: no variant generated (except_for="cpu"), NO TESTS RAN (expected, same as only_for precedent) - CUDA: TODO - A100 regression run to be confirmed in PR thread
kerer-ai
pushed a commit
to kerer-ai/pytorch-nv
that referenced
this pull request
Aug 26, 2026
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 28, 2026
…on label Summary: - Refactor to instantiate_device_type_tests + spawn combination with framework-injected device parameter - Replace implicit CUDA device-index moves (.to(rank)) with explicit torch.device(device_type, rank); bare device type derived from injected device via torch.device(device).type - Switch backend admission to @requires_capabilities(Capability.distributed.backend) - Add hw_classification = HardwareClassification.ACCELERATOR Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#193080 Test Plan: - NPU (PrivateUse1, Ascend 910B3, 4 devices): 2 tests x 4 procs pass (Ran 2 tests - OK), both with PR-CI env vars and full run - CPU: no variant generated (except_for="cpu"), NO TESTS RAN (expected, same as only_for precedent) - CUDA: TODO - A100 regression run to be confirmed in PR thread
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 29, 2026
…on label Summary: - Refactor to instantiate_device_type_tests + spawn combination with framework-injected device parameter - Replace implicit CUDA device-index moves (.to(rank)) with explicit torch.device(device_type, rank); bare device type derived from injected device via torch.device(device).type - Switch backend admission to @requires_capabilities(Capability.distributed.backend) - Add hw_classification = HardwareClassification.ACCELERATOR Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#193080 Test Plan: - NPU (PrivateUse1, Ascend 910B3, 4 devices): 2 tests x 4 procs pass (Ran 2 tests - OK), both with PR-CI env vars and full run - CPU: no variant generated (except_for="cpu"), NO TESTS RAN (expected, same as only_for precedent) - CUDA: TODO - A100 regression run to be confirmed in PR thread
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 29, 2026
…ators via capability gates Replace @requires_accelerator_dist_backend(["nccl", "xccl"]) with @requires_capabilities(Capability.distributed.backend) for capability-based admission. Add hw_classification = ACCELERATOR and instantiate_device_type_tests(except_for="cpu", allow_xpu=True). Add device parameter to all 5 test methods; extract bare device type via torch.device(device).type for ChunkShardingSpec placements. Remove module-level device_type/backend globals; use @with_comms(init_rpc=False) relying on ShardedTensorTestBase.backend property for dynamic backend resolution. Depends on: pytorch#194992, pytorch#191919, pytorch#193080, pytorch#187650
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 31, 2026
…on label Summary: - Refactor to instantiate_device_type_tests + spawn combination with framework-injected device parameter - Replace implicit CUDA device-index moves (.to(rank)) with explicit torch.device(device_type, rank); bare device type derived from injected device via torch.device(device).type - Switch backend admission to @requires_capabilities(Capability.distributed.backend) - Add hw_classification = HardwareClassification.ACCELERATOR Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#193080 Test Plan: - NPU (PrivateUse1, Ascend 910B3, 4 devices): 2 tests x 4 procs pass (Ran 2 tests - OK), both with PR-CI env vars and full run - CPU: no variant generated (except_for="cpu"), NO TESTS RAN (expected, same as only_for precedent) - CUDA: TODO - A100 regression run to be confirmed in PR thread
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 31, 2026
…on label Summary: - Refactor to instantiate_device_type_tests + spawn combination with framework-injected device parameter - Replace implicit CUDA device-index moves (.to(rank)) with explicit torch.device(device_type, rank); bare device type derived from injected device via torch.device(device).type - Switch backend admission to @requires_capabilities(Capability.distributed.backend) - Add hw_classification = HardwareClassification.ACCELERATOR Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#193080 Test Plan: - NPU (PrivateUse1, Ascend 910B3, 4 devices): 2 tests x 4 procs pass (Ran 2 tests - OK), both with PR-CI env vars and full run - CPU: no variant generated (except_for="cpu"), NO TESTS RAN (expected, same as only_for precedent) - CUDA: TODO - A100 regression run to be confirmed in PR thread
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Aug 31, 2026
…on label Summary: - Refactor to instantiate_device_type_tests + spawn combination with framework-injected device parameter - Replace implicit CUDA device-index moves (.to(rank)) with explicit torch.device(device_type, rank); bare device type derived from injected device via torch.device(device).type - Switch backend admission to @requires_capabilities(Capability.distributed.backend) - Add hw_classification = HardwareClassification.ACCELERATOR Depends on: pytorch#187650, pytorch#190528, pytorch#191919, pytorch#193080 Test Plan: - NPU (PrivateUse1, Ascend 910B3, 4 devices): 2 tests x 4 procs pass (Ran 2 tests - OK), both with PR-CI env vars and full run - CPU: no variant generated (except_for="cpu"), NO TESTS RAN (expected, same as only_for precedent) - CUDA: TODO - A100 regression run to be confirmed in PR thread
This was referenced Sep 1, 2026
This was referenced Sep 7, 2026
youlituao
marked this pull request as ready for review
October 8, 2026 01:41
youlituao
added a commit
to youlituao/pytorch
that referenced
this pull request
Oct 20, 2026
…ators via capability gates Replace @requires_accelerator_dist_backend(["nccl", "xccl"]) with @requires_capabilities(Capability.distributed.backend) for capability-based admission. Add hw_classification = ACCELERATOR and instantiate_device_type_tests(except_for="cpu", allow_xpu=True). Add device parameter to all 5 test methods; extract bare device type via torch.device(device).type for ChunkShardingSpec placements. Remove module-level device_type/backend globals; use @with_comms(init_rpc=False) relying on ShardedTensorTestBase.backend property for dynamic backend resolution. Depends on: pytorch#194992, pytorch#191919, pytorch#193080, pytorch#187650
Add a flat _capabilities() override to PrivateUse1TestBase declaring Capability.distributed.backend via _distributed_backend_available(), resolving the real registered backend name with torch._C._get_privateuse1_backend_name(). Depends on pytorch#191919 for the Capability mechanism.
youlituao
force-pushed
the
test/common_device_type_capabilities
branch
from
November 14, 2026 03:08
99f62b3 to
7225cac
Compare
youlituao
marked this pull request as draft
November 17, 2026 09:07
This branch was previously deployed
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.
Linked issue or supporting maintainer
Part of #185590
BC-breaking
No
Summary
Add a
_capabilities()override toPrivateUse1TestBaseso that PrivateUse1 backends can participate in the device-typeCapabilitygating introduced in #191919. Without it, tests decorated with@requires_capabilities(Capability.distributed.backend)are silently skipped on out-of-tree PrivateUse1 backends even when the device's default distributed backend is available.Changes
PrivateUse1TestBase._capabilities()override intorch/testing/_internal/common_device_type.py, following the flatidentifier -> predicatemapping convention established in [Testcase Refactoring] Add distributed test capability gates #191919 (super()._capabilities()then.update(...)).Capability.distributed.backendvia_distributed_backend_available(...), resolving the real registered backend name withtorch._C._get_privateuse1_backend_name()so the check reflects the actual out-of-tree device rather than the literal"privateuse1"._distributed_backend_available()helper and theCapability.distributed.backendidentifier added by [Testcase Refactoring] Add distributed test capability gates #191919; no new capability identifiers are introduced here.Not changed
distributed.dtensor/distributed.fsdpidentifiers are declared. [Testcase Refactoring] Add distributed test capability gates #191919 currently defines onlyCapability.distributed.backend; declaring the other distributed identifiers (and their predicates) is left as a follow-up once they exist upstream.CPUTestBase/CUDATestBase/XPUTestBase/MPSTestBase/HPUTestBasecapability declarations.Depends on
This PR relies on the following upstream PR (submitted but not yet merged):
Capabilitymechanism, theCapability.distributed.backendidentifier, and the_distributed_backend_available()helper.Without it,
Capability.distributed.backendand_distributed_backend_available()do not exist and this override fails to import/resolve.Test plan
@requires_capabilities(Capability.distributed.backend)tests run on a PrivateUse1 backend whose default distributed backend is available, and skip otherwise.