Repository navigation
Conversation
[ghstack-poisoned]
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". 🟡 AUTOMATED REVIEW - Changes requested:
Findings (3): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201405
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit fca0b72 with merge base ff4f371 ( 🟡 GREEN LIGHT - OUTDATED (earlier commit) - PR requires human review:
reason: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
…pe gitignore [ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
… clean; forward nccl-lazy mem pool [ghstack-poisoned]
…ated [ghstack-poisoned]
Withdrawn: the automated review of 1a62483 found nothing blocking.
[ghstack-poisoned]
[ghstack-poisoned]
…; legacy symm NCCL note [ghstack-poisoned]
…ing=False; tests for SEPARATE and shared signals [ghstack-poisoned]
[ghstack-poisoned]
There was a problem hiding this comment.
Automated review of fca0b72: changes requested before human review.
The PR documents the experimental one-sided window API (_new_window / Window) in distributed.md and the pybind docstrings, re-exports the window option types, and adds nccl-lazy plus two new tests to test_c10d_window.py. Most of it matches the nccl2 code, but one docstring overstates when registration is collective, one new test can't tell apart the two behaviors it is meant to separate, and two assertions tie the backend-agnostic test class to NCCL. Recommendation: Request Changes.
🔴 3 blocking findings are attached to the code below.
Please address the findings and push; a new commit normally gets a fresh automated review.
This review is AI-generated and advisory. Each new automated review replaces the previous one.
| py::arg("pool"), | ||
| py::arg("symm") = false) | ||
| py::arg("symm") = false, | ||
| R"(Register ``pool``'s segments with this communicator. With ``symm=True``, unregistered segments are registered as NCCL symmetric windows instead; already registered segments are left as is. This is collective, as are later allocations from the pool. ``symm`` is ignored when PyTorch is built against NCCL older than 2.27.)") |
There was a problem hiding this comment.
🔴 The legacy ProcessGroupNCCL.register_mem_pool docstring says registration is always collective: "This is collective, as are later allocations from the pool", with no condition. That only holds for symm=True. NCCLComm::registerSegment calls the collective ncclCommWindowRegister(..., NCCL_WIN_COLL_SYMMETRIC) only when window is true (NCCLUtils.cpp:484-494). Otherwise it calls ncclCommRegister, which each rank does on its own (NCCLUtils.cpp:496-497). The allocator hook passes window=symm, so later allocations are also collective only with symm=True. Users of the default `symm=Fals
| self._probe_window_support(pool) | ||
| with torch.cuda.use_mem_pool(pool): | ||
| buf_a = torch.zeros(self.world_size, device=self.device) | ||
| buf_b = torch.zeros(1, device=self.device) |
There was a problem hiding this comment.
🔴 test_signal_shared_across_windows passes whether signal counts are per process group or per window. buf_a (world_size floats) and buf_b (1 float) are small allocations from the pool that _probe_window_support has already given a small segment, so both end up in that same segment. WindowNCCL::tensor_register takes the window handle from the segment (pg_->lookupSegmentWindow(...), nccl2/WindowNCCL.cpp:102), so win_a and win_b get the same ncclWindow_t. The test would pass even if signal counts were tracked per window, so it doesn't check the property its comment and the `w
|
|
||
| attr = win.get_attr((self.rank + 1) % self.world_size) | ||
| self.assertIsInstance(attr.access_type, WindowAccessType) | ||
| self.assertEqual(attr.access_type, WindowAccessType.SEPARATE) |
There was a problem hiding this comment.
🔴 NCCL-only assertions sit in the backend-agnostic AbstractWindowTest. The file header says new backends are covered by adding them to WINDOW_BACKENDS. assertEqual(attr.access_type, WindowAccessType.SEPARATE) replaces the old assertIsInstance and pins the hardcoded SEPARATE in WindowNCCL.cpp:328. test_signal_shared_across_windows (line 156) assumes counts are shared per process group, which the PR's own docstring calls NCCL-specific ("With NCCL, counts are shared"). A backend with UNIFIED access, or with per-window signal counts, would fail or hang on these tests even though it fo
|
Starting merge as part of PR stack under #201436 |
|
Starting merge as part of PR stack under #201436 |
1 similar comment
|
Starting merge as part of PR stack under #201436 |
…ctory (#201413) `distributed/elastic/run.md` was the only subdirectory page using a bare `:toctree: generated`, so a docs build wrote stubs to `docs/source/distributed/elastic/generated/`, which isn't ignored, isn't removed by `make clean`, and isn't recognized by the `generated/` checks in conf.py (edit button, last-updated date). Point it at `../../generated` like the other subdirectory pages, add redirects from the old URLs, exclude `distributed/elastic/generated/` from the build so stale local stubs don't clash with the redirects, and drop the stale `docs/source/compile/generated/` `.gitignore` entries (`docs/source/compile/` no longer exists). Test plan: Built docs locally; the torchrun stubs land in `docs/source/generated/`, `git status` is clean, and the redirect pages for the old URLs are generated. This PR was authored with the assistance of an AI coding agent. Pull Request resolved: #201413 Approved by: https://github.com/kapilsh ghstack dependencies: #201403, #201404, #201432, #201405
ProcessGroup pre/post/abort hooks, their argument types, and the built-in FlightRecorderHook/NanCheckHook/HealthCheckHook had one-line or no docstrings and no docs page. This adds docstrings to the pybind bindings (semantics: issue-time vs completion, op_id pairing, hook_id ordering/replacement, exception behavior, abort hook idempotence, auto-attach env vars), re-exports HookOpName/PreHookArgs/PostHookArgs from torch.distributed.distributed_c10d like the window types, and adds a "Hooks" section to distributed.md. Review points intentionally not addressed: exhaustive per-op hook coverage and HookOpName mapping exceptions (monitored_barrier, coalesced Work, sparse allreduce, gather_into_tensor, barrier tensor lists), split_group not attaching NanCheckHook, and TORCH_NCCL_NAN_CHECK; docs are kept to common cases. Test plan: ``` pip install -e . -v --no-build-isolation python test/test_public_bindings.py cd docs && sphinx-build -M html source build -j 24 -T --keep-going -D katex_prerender=0 ``` Also ran the docs example on a single-rank gloo group and checked the rendered docstrings. This PR was authored with an AI assistant (Claude). Pull Request resolved: #201436 Approved by: https://github.com/kapilsh ghstack dependencies: #201403, #201404, #201432, #201405, #201413
…ed comments, link nearby threads (#201479) minimizing obsolete automatic reviews did not hide their review comments, meaning the identical comments from different review iterations could pile up on the same line. this PR deletes obsolete comments (that don't have maintainer replies), and also edits the obsolete review to wrap them in `<details>` so they render better on mobile (which doesn't currently support minimization). --- ✴️ iz2: On PRs with many re-reviews (e.g. #201405: 24 automated reviews, 67 open inline threads), minimizing a replaced review hides only its body. Its inline comments stay listed on the Files tab and in GitHub Mobile, because `GITHUB_TOKEN` can't resolve threads here. When a newer automated review replaces an earlier one, this change: - folds the earlier review's body into a collapsed `<details>` section (the marker stays the first line; no cross-links) - deletes its inline comments that nobody replied to or reacted to. A comment is deleted only if its review thread, read by GraphQL cursor, holds that one comment. Answered comments and their replies stay. - posts a new blocking finding within 3 lines of an earlier comment someone replied to in the review body, with a link to that thread, instead of opening another inline thread. The match is by position only, so the link text says only that the thread is nearby. Reviews hidden by earlier runs get the same fold and delete from a backfill. The backfill runs after any clean-verdict dismissal and is capped at 50 writes, 1 second apart, and 90 seconds per run, so a PR like #201405 is cleaned over a few runs. A change request that may still stand is never folded or emptied. Known limits: - A reply that isn't visible yet, because it was posted after the threads were read or is still pending in someone's unsubmitted review, does not protect its root comment. The API shows neither, so a maintainer who is mid-reply when a new push is reviewed can lose the comment they were answering. - Throttled deletes on the takedown path, before a clean verdict's dismissal, are not time-bounded. Test plan: `python3 -m unittest discover -s scripts/pr_review -t .` passes all 472 tests, including new cases for overlapping runs, reply, reaction and thread-count protection, retraction, and the backfill's budget, pacing, clock and change-request gate. Pull Request resolved: #201479 Approved by: https://github.com/huydhn, https://github.com/albanD
Stack from ghstack (oldest at bottom):
dist._new_window/Windowhad no user docs, and theWindowpybind class had no docstrings. Adds docstrings to theWindowbindings and its option/attribute types ininit.cpp, re-exportsPutOptions,SignalOptions,WaitSignalOptions,WindowAttrandWindowAccessTypefromdistributed_c10d(not in__all__, matchingWindow), and an experimental "One-sided communication" section to distributed.md: backend/NCCL requirements, the memory-pool requirement, a ring put/wait_signal example, and autodoc entries. Adds nccl-lazy to the window tests, plus a test for theregister_mem_pool(symm=True)window flow and teardown the docs recommend.Review points intentionally not addressed:
nccl2isn't listed separately sincencclresolves to it; onlynccl-legacyis called out. The out-of-tree, deprecated torchcomms backend and theTORCH_DISTRIBUTED_DEBUG=DETAILwrapper aren't covered, to keep the section to the common cases._new_window/Windowstay private and outside__all__while experimental; this documents them without committing to a public API.test_symmetric_mem_pool_teardownhas no try/finally: an earlier review asked to drop it, and cleanup after a failure would itself run collectives that can hang when ranks diverge.Test plan:
Built torch from source and checked the docstrings. Ran the docs ring example on 2 GB200s with
ncclandnccl-lazy(nightly + NCCL 2.32.3), andtest/distributed/test_c10d_window.pypasses for nccl2 and nccl-lazy.sphinx-build -M html source buildin docs/; the section renders, cross-references resolve, and no new warnings vs main.This PR was authored with the assistance of an AI coding agent.