Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/187650
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit b3468b1 with merge base 6b1f3af ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
628b95d to
8f79852
Compare
The 4 multi-process tests in `ComposabilityTest` were skipped on out-of-tree PrivateUse1 accelerators: `@skip_if_lt_x_gpu(8)` and `at_least_x_gpu(8)` only check cuda/hpu/xpu, not PrivateUse1. Replace `@skip_if_lt_x_gpu(8)` with `@skip_if_lt_x_devices(8)` (the device-agnostic decorator from pytorch#187650), and `not at_least_x_gpu(8)` with `not at_least_x_device(8)` (the device-agnostic helper from the separate `at_least_x_device` framework PR), and "GPUs" -> "accelerators" in the skip message. Pattern B (`requires_accelerator_dist_backend()`, already no-args) and the `torch.accelerator.set_device_index` init_pg are unchanged. Depends on pytorch#187650 (`skip_if_lt_x_devices`) and the `at_least_x_device` framework helper (separate PR); rebase onto main after they merge. Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices, world_size 8): the tests now run (previously skipped by `skip_if_lt_x_gpu`); each test passes in isolation.
The 4 multi-process tests in `ComposabilityTest` were skipped on out-of-tree PrivateUse1 accelerators: `@skip_if_lt_x_gpu(8)` and `at_least_x_gpu(8)` only check cuda/hpu/xpu, not PrivateUse1. - Add `at_least_x_device(x)` to `common_distributed.py` (device-agnostic replacement for `at_least_x_gpu`, using `torch.accelerator.device_count()`) and use `not at_least_x_device(8)` in the `@skip_but_pass_in_sandcastle_if` guard. - Replace `@skip_if_lt_x_gpu(8)` with `@skip_if_lt_x_devices(8)` (the device-agnostic decorator from pytorch#187650), and "GPUs" -> "accelerators" in the skip message. - Pattern B (`requires_accelerator_dist_backend()`, already no-args) and the `torch.accelerator.set_device_index` init_pg are unchanged. Depends on pytorch#187650 (`skip_if_lt_x_devices`); rebase onto main after it merges. Test Plan: ``` python test/distributed/_composable/test_composability/test_pp_composability.py -v ``` Verified on a PrivateUse1 host (8 devices, world_size 8): the tests now run (previously skipped by `skip_if_lt_x_gpu`); each test passes in isolation.
- 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.
- 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.
|
Hi @weifengpy, could you take a look at this PR and approve it if it looks |
|
@claude review this pr with pr review skill |
|
Claude finished @can-gaa-hou's task in 24m 40s —— View job PyTorch PR review complete — the Full reviewPR Review: #187650SummaryReplaces the hard-coded Backward Compatibility
Infrastructure
Testing
Code Quality
RecommendationRequest Changes The HPU |
|
@can-gaa-hou Thanks for running the review! Regarding the HPU point: The hpu:0 → hpu change of DEVICE_TYPE here is intentional and was already discussed with @fffrog during the earlier review rounds. fffrog explicitly asked us to stop special-casing HPU and to treat it like other standard accelerators (see comment): I knew, but I still think we should Regard hpu as an accelerator that will follow the thing other standard accelerator will do. He then suggested the current form (DEVICE_TYPE = acc.type) in a follow-up comment and approved the PR with it in place. So we'd prefer to keep DEVICE_TYPE = acc.type (no device index, consistent with cuda/xpu) rather than reintroducing the hpu:0 special case. |
| DEVICE_COUNT = torch.xpu.device_count() | ||
| if torch.accelerator.is_available(): | ||
| acc = torch.accelerator.current_accelerator() | ||
| DEVICE_TYPE = acc.type |
There was a problem hiding this comment.
We should add special logic for MPS here to keep BC
|
@fffrog Fixed per Claude's review comments — removed the TEST_WITH_ROCM special case, added the MPS fallback, and fixed the HPU DDP device_ids. Tests passed. Please re-review. Thanks! |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 0 checks: Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (default, 13, 14, mt-l-x86aavx2-29-113-l4) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (default, 13, 14, mt-l-x86aavx2-29-113-l4) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Makes the FSDP test infrastructure in common_fsdp.py device-agnostic so it works
for any accelerator supported by torch.accelerator (CUDA, XPU, HPU, and
PrivateUse1-based out-of-tree backends such as NPU).
torch.accelerator.current_accelerator() instead of being hard-coded per
TEST_CUDA / TEST_HPU / TEST_XPU, using the backend registered in
Backend.default_device_backend_map for the accelerator type.
FSDPTestContinuous) now gate on torch.accelerator.is_available() instead of
TEST_CUDA or TEST_XPU, so HPU is treated like any other accelerator.
Test Plan
python test/distributed/_composable/fsdp/test_fully_shard_autograd.pypython test/distributed/_composable/fsdp/test_fully_shard_clip_grad_norm_.pypython test/distributed/_composable/fsdp/test_fully_shard_comm.pypython test/distributed/_composable/fsdp/test_fully_shard_compile.pypython test/distributed/_composable/fsdp/test_fully_shard_dtensor.pypython test/distributed/_composable/fsdp/test_fully_shard_extensions.pypython test/distributed/_composable/fsdp/test_fully_shard_frozen.pypython test/distributed/_composable/fsdp/test_fully_shard_grad_scaler.pypython test/distributed/_composable/fsdp/test_fully_shard_ignore_params.pypython test/distributed/_composable/fsdp/test_fully_shard_init.pypython test/distributed/_composable/fsdp/test_fully_shard_logging.pypython test/distributed/_composable/fsdp/test_fully_shard_memory.pypython test/distributed/_composable/fsdp/test_fully_shard_mixed_precision.pypython test/distributed/_composable/fsdp/test_fully_shard_overlap.pypython test/distributed/_composable/fsdp/test_fully_shard_state.pypython test/distributed/_composable/fsdp/test_fully_shard_state_dict.pypython test/distributed/_composable/fsdp/test_fully_shard_training.py