Repository navigation
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Findings (7): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/205548
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit af60be0 with merge base 0965f09 ( 🟡 GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:
reason: BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@d4l3k has exported this pull request. If you are a Meta employee, you can view the originating Diff in D132952445. |
255ab88 to
8456cc8
Compare
8456cc8 to
83ac3ba
Compare
Summary: D132669166 makes legacy ProcessGroupNCCL internal only, but legacy-only tests still live in OSS files. Fix: - `test_c10d_nccl.py` stays in place. Without nccl-legacy (OSS CUDA), only an allowlist of 5 default-backend tests is kept. The rest are hidden (set to None), not skipped, so `run_test.py --subprocess` does not spawn a process per test. The allowlist asserts every name exists. `CollectiveAnnotationTest` is excluded: its worker exits with 1 under nccl2. Internal builds keep the full file with legacy. - `fb/test_c10d_nccl_single_rank.py` (moved) gets an H100 RE target. On NCCL < 2.29.7, non-fp32 `reduce_scatter` premul cases are xfail (NVIDIA/nccl#1950: single-rank PreMulSum leaves the tail unwritten). Output is zero-initialized so the bug is caught deterministically. - `fb/test_c10d_nccl2_legacy.py`: legacy variants of the nccl2 CommPtr/Nonblocking suites and the PSK rejection tests from `test_c10d_nccl2.py`. - `fb/test_c10d_backend_entry_points.py`: legacy registration and default timeout tests from `test_c10d_common.py`. - The AMD `c10_collectives_checker` registers the `nccl-legacy` BackendConfig itself; that config is removed from `c10d_backend_common.py`. - Removed: nccl-legacy entries in suspend/resume, two device mesh tests, `TEST_NCCL_LEGACY` and `requires_nccl_legacy`. These duplicate nccl2 coverage. - Coverage dropped with no replacement (these had no GPU CI target): - multi-device ZeRO+DDP (`test_zero_model_parallel`); - `test_2d_mesh_non_eager_init_subgroup`; - the legacy FR hook tests (stock-nccl self-recording); - the nccl-legacy `test_nccl.py` symmem parametrizations, including the legacy pre-invalidate retire path; - nccl-legacy in the internal `test_c10d_collectives` / `test_c10d_cuda_graphs` backend lists. Lines (fbcode; xplat mirrors): impl +16/-1, tests +283/-352. Test Plan: - fb `test_c10d_nccl_single_rank` on RE H100: 49 pass. Non-fp32 cases pass as expected failures on NCCL < 2.29.7. - OSS sim (`test_c10d_nccl.py` with `_NCCL_LEGACY_MISSING` forced True and `TORCH_DIST_USE_NCCL2=1`, temporary RE H100 target): the 4 allowlisted 2-GPU tests pass; `test_send_recv_non_dense_tensor` skips (needs 3 GPUs); hidden tests are not collected. `test_c10d_common` in the same target: 184 pass; `ThreadLocalSafetyLintTest` fails on RE before and after this change (source dir absent). `test_captured_collective_is_annotated` failed in 2 of 2 full nccl2 runs (worker exit 1), hence excluded. - Legacy build: fb `test_c10d_backend_entry_points` 3 pass; fb `test_c10d_nccl2_legacy` on RE H100 6 pass; `c10d_nccl2` CommPtr/Nonblocking/encryption subset 9 pass. - AMD checker unit tests: 19 pass. - `arc lint` clean. Reviewed By: kapilsh Differential Revision: D132952445
83ac3ba to
af60be0
Compare
There was a problem hiding this comment.
Automated review of af60be0: nothing blocking; ready for human review.
This PR removes the nccl-legacy-only tests and helpers from OSS, lets test_c10d_nccl.py run five default-backend tests on OSS CUDA instead of exiting at import, and hides every other test in that file. Recommendation: Approve. Every point the review raises is labeled non-blocking: two gaps in the description's coverage accounting, an untracked nccl2 failure, and a fragile test-hiding mechanism.
⚪ 7 non-blocking findings
pytorch/test/distributed/test_c10d_nccl.py
Line 8189 in af60be0
(Non-blocking) The name allowlist hides tests at import time. Silent hiding: on OSS, any test added to this file above the block disappears with no signal, even one written against the default nccl backend. The _found assertion only catches allowlisted names that are renamed or removed. Bare-name matching: entries match across all classes, not per class. Coupling: ProcessGroupNCCLGroupTest.setUp (:482-495) now has to tolerate None methods. Inaccurate comment: it says "only the tests using the default nccl backend run", but NcclProcessGroupWithDispatchedCollectivesTests (:5586-5601) builds its group with dist.get_default_backend_for_device(...), and its test_collectives, test_allreduce_coalesced and test_all_to_all_single are hidden too, as is the inherited test_init_process_group_optional_backend (test_c10d_common.py:3328). Suggested fix: move the five tests into test_c10d_nccl2.py and keep the sys.exit(0) guard. At minimum, qualify entries by class and correct the comment.
(Non-blocking, test/REVIEW.md Rule 6) Coverage loss from C10D_BACKENDS is not documented. Dropping the nccl-legacy BackendConfig also removes the generated NcclLegacyP2PTest and NcclLegacyIsolatedP2PTest (test_c10d_p2p.py:156-161), NcclLegacyNanCheckHookTest (test_c10d_nan_check.py:151-153) and NcclLegacyProcessGroupTest (test_c10d_process_group.py:263-269). The description lists only the collectives and cuda_graphs suites. It also contradicts itself: test_2d_mesh_non_eager_init_subgroup appears both under "Removed duplicate nccl2 coverage" and under "Coverage dropped with no replacement". Only test_device_mesh_preserve_rank_order_eager_nccl_legacy has an nccl2 twin (test_device_mesh.py:250). Please update the description.
pytorch/test/distributed/test_c10d_nccl.py
Line 8191 in af60be0
(Non-blocking) A known nccl2 failure is hidden without tracking. CollectiveAnnotationTest uses backend_str() == "nccl", and the Test Plan says test_captured_collective_is_annotated fails deterministically under nccl2, the default OSS backend. Internal builds resolve nccl to legacy, so after this PR no configuration runs this test on nccl2. There is no issue link or xfail. Hiding the whole class also hides test_cuspy_collective_is_annotated (:8157), which was not reported failing. Please file an issue and reference it in the comment. If the shared-worker setup allows it, hide or xfail only the failing method.
(Non-blocking) test_zero_model_parallel could use the default backend instead of being deleted. The only legacy-specific part of the removed test was backend="nccl-legacy" in create_pg. The file runs under --distributed-tests on trunk's 4-GPU T4 distributed config, which meets its skip_if_lt_x_gpu(4). Switching to "nccl" would keep the ZeRO+DDP model-parallel coverage in OSS, so "no GPU CI target" holds only for the legacy variant. Low confidence: the reviewer did not verify that nccl2 handles DDP over a multi-device module.
pytorch/test/distributed/test_c10d_nccl.py
Line 8193 in af60be0
(Non-blocking) This adds empty pytest runs on OSS multigpu CI. run_nccl_test in test/run_test.py:1185-1191 launches separate -k runs for DistributedDataParallelTest, CommTest, NCCLTraceTest and WorkHookTest, and all four classes are now fully hidden on OSS. Each run imports and collects the ~8200-line module, finds nothing, and exits 5, which counts as success. Before, these runs exited at import. The cost is small but recurs on every run, and a class that silently drops to zero tests still shows green. Moving the five tests to test_c10d_nccl2.py avoids this.
pytorch/test/distributed/test_c10d_common.py
Line 634 in af60be0
(Non-blocking) Leftover from the removed legacy tests: the "NCCL-LEGACY" entry in BackendEntryPointTest.setUp (test_c10d_common.py:431) only cleaned up after the removed test_nccl_legacy_backend_registration.
pytorch/test/distributed/test_c10d_nccl2.py
Line 1004 in af60be0
(Non-blocking) Leftover from the removed legacy tests: the comment at test_c10d_nccl2.py:991, "The legacy backend returns the communicator of the current device.", describes the removed ProcessGroupNCCLLegacyCommPtrTest.
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
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 |
Merge failedReason: Command Details for Dev Infra teamRaised by workflow job |
…evice_type` and `backend_str` for distributed test-related files (#205504)" This reverts commit 9e983c5. Reverted #205504 on behalf of https://github.com/izaitsevfb due to Land race with D132952445 (export #205548): both change test/distributed/test_c10d_nccl2.py, so neither the export nor this PR's internal import applies. Reverting so the export can merge; this PR needs a rebase and reland. ([comment](#205504 (comment)))
…pe` and `backend_str` for distributed test-related files (#205504) This PR focuses on standardizing the usage of device_type and backend_str across distributed test-related files. This is a prerequisite for refactoring these files to use instantiate_device_type_tests. In addition, none of the changes involve any logic modifications. They were made with the assistance of Claude Code. **Note:** All changes have been reviewed line by line by a human. Pull Request resolved: #205504 Approved by: https://github.com/albanD
|
✴️ iz2: (AI-generated) |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ackend (#16613) JIRA ID: AICOMRCCL-4001 ## Summary Upstream PyTorch made the legacy `ProcessGroupNCCL` internal-only on 2026-11-20: - **pytorch/pytorch#205374:** in OSS builds, `ProcessGroupNCCL` is now an alias of `ProcessGroupNCCL2`, so `_NCCL_LEGACY_AVAILABLE` is False and `nccl-legacy` no longer exists. `TORCH_DIST_USE_NCCL2=0` cannot bring it back. - **pytorch/pytorch#205548:** without legacy, `test_c10d_nccl.py` hides every test except five default-backend tests. The legacy tests moved to internal files that are not published. Since the 2026-11-22 nightly ([45125244674](https://github.com/ROCm/rocm-systems/actions/runs/45125244674/job/137572525376)), our c10d smoke collects 1 of its 22 tests and fails. The weekly `all` run would collect 5, against its floor of 200. The default `nccl` backend was already nccl2 before this, so OSS PyTorch now reaches RCCL only through nccl2. This PR moves the c10d job onto the OSS tests that still reach RCCL through the default backend. It also judges a run on what actually ran, so an upstream change like this fails loudly instead of quietly shrinking the run. ## Changes - **`test_pytorch_c10d.py`** - **Targets** (paths under `test/distributed`): | Scope | Tests | |---|---| | smoke | the five remaining `test_c10d_nccl.py` tests, and a core-collective subset of `test_c10d_ops_nccl.py` (allreduce, broadcast, reduce, allgather, gather, scatter, reduce_scatter and its `_v` form, all_gather_v, alltoall, barrier, send/recv, premul_sum) | | all | `test_c10d_nccl.py` and `test_c10d_ops_nccl.py` in full, plus `test_c10d_functional_native.py::TestWithNCCL`, `test_c10d_spawn_nccl.py` and `test_c10d_object_collectives.py` | - **Verdict.** A pure `judge()` function now decides the result. - Every smoke test must run under its exact name. `-k` matches substrings, and a test skipped after an earlier failure gives no coverage. - In the `all` scope, each file has a floor on the number of tests that ran (`ALL_MIN_RAN`). - pytest exits other than 0 or 1, and "exit 1 with nothing failed", fail the run. - **pytest flags.** - `-o junit_family=xunit1` records each testcase's file. - `-p no:prune_skips_plugin` reports tests skipped at collection, as PyTorch's conftest asks JUnit runs to do. - `--continue-on-collection-errors` keeps the other files running when one fails to import. - **Smoke timeouts.** - `DISTRIBUTED_TESTS_DEFAULT_TIMEOUT=120` with `--timeout=300`. - In `MultiProcContinuousTest` classes, the main process waits that long for its workers. If pytest-timeout fired first, the workers would keep running the stuck test, and the next test would receive its result. - **Known failures.** They may now be keyed `Class.test` where a name occurs in more than one file. Bare names still match. The legacy entries stay; they only apply if those tests run again. - **Report.** It now says what `nccl` resolves to, lists tests run per file, lists verdict errors, and names the known failures. The job name, artifact name, file names and the `Collected: X/Y` line are unchanged, so the CI dashboard keeps working. - **`rccl_ci_utils.parse_junit_xml`** also returns per-testcase records. This is the same change as in #15864, so that PR rebases cleanly. - **`tests/test_pytorch_c10d_targets.py`** (CPU) covers the targets, smoke presence, per-file floors, known-failure keys, and JUnit parsing, including a file that fails to import. ## Relationship to #15864 #15864 (AICOMRCCL-3652) adds the `c10d_nccl2`, symmetric-memory and FSDP/DTensor suites. It will rebase onto this PR and adopt these targets for its `c10d_nccl` suite. `test_c10d_nccl2.py` stays in #15864. ## Test plan - [x] `python3 -m unittest discover -s tests` in `projects/rccl/ci/scripts`: 157 tests pass. - [x] First GPU runs on gfx94X with artifacts from 45125244674, at 4b3b4cd: - smoke [45316083399](https://github.com/ROCm/rocm-systems/actions/runs/45316083399) - all [45316091632](https://github.com/ROCm/rocm-systems/actions/runs/45316091632) - [x] Floors set from those runs; `test_extend_nccl_pg_timeout_backend0` removed from the known failures because it now passes (f071e52). - [x] Confirmation runs at f071e52, all passed: - smoke ×2: [45319122715](https://github.com/ROCm/rocm-systems/actions/runs/45319122715), [45319135965](https://github.com/ROCm/rocm-systems/actions/runs/45319135965) - all ×1: [45319148800](https://github.com/ROCm/rocm-systems/actions/runs/45319148800) ## Test result All five runs passed on 8x MI300X (smoke ×3, all ×2), with the same results each time, with torch 2.16.0a0+rocm10.3.0a20261123. The report shows `ProcessGroupNCCL is ProcessGroupNCCL2: True, _NCCL_LEGACY_AVAILABLE: False`. **Smoke:** 4.5 min. - 22 passed. All 19 smoke names ran; the 3 extra tests are `-k` substring matches. - Per file: 4 from `test_c10d_nccl.py`, 18 from `test_c10d_ops_nccl.py`. **All:** 10.5 min. - 78 passed, 2 skipped. - The skips are `test_allreduce_float8` and `test_reduce_scatter_float8`, which PyTorch skips upstream (pytorch/pytorch#157879, #157897). | File | Tests run | |---|---| | `test_c10d_nccl.py` | 5 | | `test_c10d_ops_nccl.py` | 30 | | `test_c10d_functional_native.py::TestWithNCCL` | 18 (including the `torch.compile` tests) | | `test_c10d_spawn_nccl.py` | 10 | | `test_c10d_object_collectives.py` | 15 | `test_extend_nccl_pg_timeout_backend0`, previously a known failure, passed. The old `all` scope took up to about two hours.
Summary:
D132669166 makes legacy ProcessGroupNCCL internal only, but legacy-only tests still live in OSS files.
Fix:
test_c10d_nccl.pystays in place. Without nccl-legacy (OSS CUDA), only an allowlist of 5 default-backend tests is kept. The rest are hidden (set to None), not skipped, sorun_test.py --subprocessdoes not spawn a process per test. The allowlist asserts every name exists.CollectiveAnnotationTestis excluded: its worker exits with 1 under nccl2. Internal builds keep the full file with legacy.fb/test_c10d_nccl_single_rank.py(moved) gets an H100 RE target. On NCCL < 2.29.7, non-fp32reduce_scatterpremul cases are xfail ([Issue]: One-rank avg reduction missing elements NVIDIA/nccl#1950: single-rank PreMulSum leaves the tail unwritten). Output is zero-initialized so the bug is caught deterministically.fb/test_c10d_nccl2_legacy.py: legacy variants of the nccl2 CommPtr/Nonblocking suites and the PSK rejection tests fromtest_c10d_nccl2.py.fb/test_c10d_backend_entry_points.py: legacy registration and default timeout tests fromtest_c10d_common.py.c10_collectives_checkerregisters thenccl-legacyBackendConfig itself; that config is removed fromc10d_backend_common.py.TEST_NCCL_LEGACYandrequires_nccl_legacy. These duplicate nccl2 coverage.test_zero_model_parallel);test_2d_mesh_non_eager_init_subgroup;test_nccl.pysymmem parametrizations, including the legacy pre-invalidate retire path;test_c10d_collectives/test_c10d_cuda_graphsbackend lists.Lines (fbcode; xplat mirrors): impl +16/-1, tests +283/-352.
Test Plan:
test_c10d_nccl_single_rankon RE H100: 49 pass. Non-fp32 cases pass as expected failures on NCCL < 2.29.7.test_c10d_nccl.pywith_NCCL_LEGACY_MISSINGforced True andTORCH_DIST_USE_NCCL2=1, temporary RE H100 target): the 4 allowlisted 2-GPU tests pass;test_send_recv_non_dense_tensorskips (needs 3 GPUs); hidden tests are not collected.test_c10d_commonin the same target: 184 pass;ThreadLocalSafetyLintTestfails on RE before and after this change (source dir absent).test_captured_collective_is_annotatedfailed in 2 of 2 full nccl2 runs (worker exit 1), hence excluded.test_c10d_backend_entry_points3 pass; fbtest_c10d_nccl2_legacyon RE H100 6 pass;c10d_nccl2CommPtr/Nonblocking/encryption subset 9 pass.arc lintclean.Reviewed By: kapilsh
Differential Revision: D132952445