Skip to content

[docs] Move torch.mtia submodule pages under mtia/ and nest them in the sidebar - #201403

Closed
d4l3k wants to merge 2 commits into
gh/d4l3k/290/basefrom
gh/d4l3k/290/head
Closed

d4l3k wants to merge 2 commits into
gh/d4l3k/290/basefrom
gh/d4l3k/290/head

Conversation

@d4l3k

@d4l3k d4l3k commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

mtia.memory and mtia.mtia_graph sit at the docs root and are listed as siblings of torch.mtia in the top-level Python API toctree. This moves them to docs/source/mtia/ and lists them in a toctree at the end of mtia.md, as #200857 and #201160 did for torch.distributed, so the sidebar shows them as children of torch.mtia.

Old URLs redirect via redirects.py. The autosummary toctree in mtia/memory.md points at ../generated so the generated API pages keep their URLs. Content is otherwise unchanged.

Test plan:

lintrunner docs/source/redirects.py docs/source/mtia.md docs/source/mtia/*.md docs/source/pytorch-api.md
cd docs && sphinx-build -M html source build -j 24 -T --keep-going -D katex_prerender=0

Compared warnings and HTML file lists against a build of the base commit: no new warnings; every old page exists or redirects to an existing page.

Authored with an AI assistant (Claude).

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

PR Status: Approved 🚀

Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".

✅ AUTOMATED REVIEW - Ready for human review:

This PR moves docs/source/mtia.memory.md and docs/source/mtia.mtia_graph.md into
docs/source/mtia/, lists them in a "Read More" toctree at the end of mtia.md,
removes them from the top-level Python API toctree in pytorch-api.md, and adds
redirects for the old URLs in redirects.py. Recommendation: Approve. It is a
docs-only restructure that follows the earlier torch.distributed layout, and
every old URL still resolves through a redirect or an unchanged path.

Reviewed commit: cda9438

Review run

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201403

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit cda9438 with merge base ff4f371 (image):
💚 Looks good so far! There are no failures yet. 💚

🟡 GREEN LIGHT - PR requires human review:

  • Never trivial: executable docs build configuration
    • Diff edits docs/source/redirects.py, which docs/source/conf.py imports at line 53 via from redirects import redirects
    • That makes it Python that sphinx runs in the docs job, the same as conf.py itself, so editing it rules out a trivial verdict
  • Change itself looks sound
    • Moves mtia.memory.md and mtia.mtia_graph.md under docs/source/mtia/ and adds a toctree for them at the end of mtia.md
    • mtia/memory.md now points autosummary at ../generated, and the old page names get redirect entries; a human should still confirm before it lands

reason: not_trivial
Reviewed commit: cda9438

Inference job

🐛 Report a wrong verdict

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@d4l3k
d4l3k requested a review from kapilsh as a code owner October 19, 2026 07:00
@d4l3k
d4l3k marked this pull request as draft October 19, 2026 07:01
@pytorchbot pytorchbot added the in progress PR is being worked on by the author, until the automated review accepts it label Oct 19, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review of cda9438: nothing blocking; ready for human review.

This PR moves docs/source/mtia.memory.md and docs/source/mtia.mtia_graph.md into docs/source/mtia/, lists them in a "Read More" toctree at the end of mtia.md, removes them from the top-level Python API toctree in pytorch-api.md, and adds redirects for the old URLs in redirects.py. Recommendation: Approve. It is a docs-only restructure that follows the earlier torch.distributed layout, and every old URL still resolves through a redirect or an unchanged path.

This review is AI-generated and advisory. Each new automated review replaces the previous one.

@pytorch-bot pytorch-bot Bot added ready for review Automated review passed, ready for a final review by a maintainer. and removed in progress PR is being worked on by the author, until the automated review accepts it labels Oct 19, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #201436

2 similar comments
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #201436

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #201436

pytorchmergebot pushed a commit that referenced this pull request Oct 20, 2026
… the sidebar (#201404)

The 11 `torch.utils.*` pages (`data`, `checkpoint`, `benchmark_utils`, `tensorboard`, ...) sit at the docs root and are listed as siblings of `torch.utils` in the top-level Python API toctree. This moves them to `docs/source/utils/` and lists them in a toctree in `utils.md`, as #200857 and #201160 did for `torch.distributed`, so the sidebar shows them as children of `torch.utils`. `benchmark_utils` and `jit_utils` become `utils/benchmark` and `utils/jit`.

Old URLs redirect via `redirects.py`. Autosummary toctrees in the moved pages point at `../generated` so the generated API pages keep their URLs. The only other content change is the relative image path in `utils/tensorboard.md`.

Fixes the tensorboard writer docstring images to use source-absolute `/_static/...` paths so they resolve from the moved page.

Test plan:

```
lintrunner docs/source/redirects.py docs/source/utils.md docs/source/utils/*.md docs/source/pytorch-api.md
cd docs && sphinx-build -M html source build -j 24 -T --keep-going -D katex_prerender=0
```

Compared warnings and HTML file lists against a build of the base commit: no new warnings; every old page exists or redirects to an existing page; the tensorboard figure resolves.

Authored with an AI assistant (Claude).
Pull Request resolved: #201404
Approved by: https://github.com/kapilsh
ghstack dependencies: #201403
pytorchmergebot pushed a commit that referenced this pull request Oct 20, 2026
…01432)

`ProcessGroupNCCLLazy` forwards `mem_allocator` and windows to its primary `ProcessGroupNCCL`, but not `register_mem_pool` / `deregister_mem_pool`, so nccl-lazy users can't register a pool (e.g. as symmetric) or tear its windows down before freeing it. Adds both bindings, forwarding to the primary communicator (pair comms are not registered; windows don't use them).

Test plan:
New `ProcessGroupNCCLLazyMemPoolTest` in `test/distributed/test_c10d_nccl2.py` runs the existing `register_mem_pool` tests on nccl-lazy; run on 2 GB200s.

This PR was authored with the assistance of an AI coding agent.
Pull Request resolved: #201432
Approved by: https://github.com/kapilsh
ghstack dependencies: #201403, #201404
pytorchmergebot pushed a commit that referenced this pull request Oct 20, 2026
)

`dist._new_window` / `Window` had no user docs, and the `Window` pybind class had no docstrings. Adds docstrings to the `Window` bindings and its option/attribute types in `init.cpp`, re-exports `PutOptions`, `SignalOptions`, `WaitSignalOptions`, `WindowAttr` and `WindowAccessType` from `distributed_c10d` (not in `__all__`, matching `Window`), 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 the `register_mem_pool(symm=True)` window flow and teardown the docs recommend.

Review points intentionally not addressed: `nccl2` isn't listed separately since `nccl` resolves to it; only `nccl-legacy` is called out. The out-of-tree, deprecated torchcomms backend and the `TORCH_DISTRIBUTED_DEBUG=DETAIL` wrapper aren't covered, to keep the section to the common cases. `_new_window`/`Window` stay private and outside `__all__` while experimental; this documents them without committing to a public API. `test_symmetric_mem_pool_teardown` has 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 `nccl` and `nccl-lazy` (nightly + NCCL 2.32.3), and `test/distributed/test_c10d_window.py` passes for nccl2 and nccl-lazy. `sphinx-build -M html source build` in 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.
Pull Request resolved: #201405
Approved by: https://github.com/kapilsh
ghstack dependencies: #201403, #201404, #201432
pytorchmergebot pushed a commit that referenced this pull request Oct 20, 2026
…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
pytorchmergebot pushed a commit that referenced this pull request Oct 20, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged ready for review Automated review passed, ready for a final review by a maintainer. release notes: distributed (torchelastic)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants