Repository navigation
[docs] Drop the unreachable pytorch_lightning intersphinx target - #65604
Closed
dstrodtman wants to merge 1 commit into
Closed
dstrodtman wants to merge 1 commit into
dstrodtman wants to merge 1 commit into
Conversation
lightning.ai now serves its single-page app shell for every docs path, so objects.inv returns HTML instead of a Sphinx inventory. intersphinx fails to load it and the -W build turns that single warning into a fatal error, which has kept master red since 2026-08-19. No reachable mirror exists: every versioned lightning.ai path, the fabric, torchmetrics and litserve equivalents, and the legacy readthedocs.io domains all redirect into the same shell, and docs.pytorchlightning.ai serves only a meta-refresh stub. Removing the target costs the Bases: and annotation links on the six ray.train.lightning APIs and the two ray.tune.integration.pytorch_lightning callbacks. Those links are dead upstream anyway. No prose cross-reference uses this inventory, and py:class refs are already covered by nitpick_ignore_regex, so nothing starts warning. Signed-off-by: Douglas Strodtman <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the pytorch_lightning entry from the intersphinx mapping in doc/source/conf.py because its documentation site serves a single-page app shell for all paths, causing objects.inv to return HTML and fail the Sphinx build. I have no feedback to provide.
Contributor
Author
|
Superseded by #64977 |
3 of 5 tasks
dstrodtman
added a commit
that referenced
this pull request
Aug 21, 2026
## Why are these changes needed? Eight of the 26 entries in `_intersphinx_targets` resolve **zero** cross-references anywhere in the rendered documentation: `aiohttp`, `composer`, `distributed`, `horovod`, `pydantic`, `pytorch_lightning`, `scipy`, and `torchvision`. Each one still costs a committed `.inv` snapshot in the tree, a slot in the refresh cadence that `doc/source/_intersphinx/README.md` describes, and -- on any branch cut before #64977 -- a network fetch at build startup that can fail the `-W` build outright. Three of the eight (`torchvision`, `scipy`, and `pytorch_lightning`) were implicated in the Read the Docs failures on 2026-08-19/20 while resolving nothing. `pytorch_lightning` is the clearest case: `lightning.ai` serves an SPA shell for `objects.inv`, which #65604 proposed fixing by dropping the target before it was closed as superseded by #64977. Snapshots removed the urgency; nothing linking to it is the reason to drop it anyway. ### How this was measured When intersphinx resolves a cross-reference it stamps the anchor with `title="(in <Project> v<X>)"`. Counting those over a full 4,009-page HTML build gives an exhaustive per-target usage census. The 18 surviving targets: | Target | Refs | | Target | Refs | |---|---:|---|---|---:| | `python` | 10,690 | | `transformers` | 2 | | `pyarrow` | 132 | | `sklearn` | 2 | | `numpy` | 97 | | `nevergrad` | 2 | | `torch` | 96 | | `modin` | 2 | | `tensorflow` | 83 | | `mars` | 2 | | `pandas` | 55 | | `lightgbm` | 2 | | `gymnasium` | 18 | | `datasets` | 2 | | `pyspark` | 3 | | `dask` | 2 | | `grpc` | 3 | | `pymongoarrow` | 1 | The eight dropped targets appear nowhere in that census. ### Why this is safe under `-W` `conf.py` sets `nitpicky = True`, but `nitpick_ignore_regex` blanket-ignores `("py:class", ".*")`. Third-party type annotations resolve as `py:class`, so an unresolved one degrades to plain text instead of failing the build -- which is also what `ray-contribute/docs.md` promises contributors. Verified in addition that no `:external:` role and no explicit `py:obj` / `py:func` / `py:meth` / `py:mod` reference anywhere under `doc/source` targets a dropped namespace, since those reftypes are *not* covered by the blanket ignore. Worth recording the flip side, because it makes a tempting shortcut a non-starter: the `python` target can never be dropped. Sphinx's `parse_reftarget` assigns `reftype = 'obj'` rather than `'class'` for `None` and for every `typing.*` annotation, and nothing ignores `py:obj` generically. That is 2,856 `None` references plus 2,676 `typing.*` references -- 5,532 hard `-W` failures. "Strip intersphinx, then add back what's valuable" does not survive contact with the build. ## Related changes - Drops the `pytorch_lightning` inventory-pinning comment, which documented a workaround for a target that no longer exists. - Corrects the target counts and the now-singular `object-mirror-*` reference in `conf.py` and in `doc/source/_intersphinx/README.md`. - `refresh.py` reads the target list straight out of `conf.py`, so it needs no change. Confirmed it now parses 18 targets, matching the 18 remaining snapshots on disk exactly. Follow-up, not in this PR: 11 of the surviving targets resolve only 1-3 references each and are worth a separate keep-or-drop audit. ## Related issue number Follows #64977, which pre-baked the inventory snapshots. ## Checks - [x] I've signed off every commit (`-s`). - [x] I've included any doc changes needed for the change. - Testing strategy - [ ] Unit tests - [ ] Release tests - [x] Verified by the Read the Docs `-W` build on this PR, which is the gate that exercises `intersphinx_mapping`. Also verified locally that `refresh.py` parses 18 targets matching the 18 snapshots on disk, and that no reference under `doc/source` targets a dropped namespace via a reftype outside the `py:class` blanket ignore. Signed-off-by: Douglas Strodtman <[email protected]>
dstrodtman
added a commit
that referenced
this pull request
Sep 28, 2026
…tion-resolution note (#66211) ## What Two intersphinx-hygiene changes, backed by a fresh usage measurement of the rendered docs corpus: 1. **Drop the `nevergrad` intersphinx target** and its committed inventory snapshot. A per-target census of the rendered master corpus (4,432 pages) shows `nevergrad` resolves **zero** cross-references. Its only mentions in the built site are internal links to Ray's own `NevergradSearch` API and prose, not generated cross-references. It was carrying a committed `.inv` snapshot and a standing refresh obligation for no reader-facing links, which is the same criterion the eight targets dropped in #65644 met. `refresh.py` reads the target list from `_intersphinx_targets` in `conf.py`, so removing the entry also drops it from the refresh cycle with no further change. 2. **Correct an over-general sentence in the contributor docs.** `ray-contribute/docs.md` stated that annotations which don't resolve "render as plain text; they don't fail the build." That is true for third-party types, which resolve as `py:class` and are covered by a blanket `nitpick_ignore_regex` entry, but false for `None` and `typing.*` annotations, which Sphinx emits as `py:obj`. Nothing ignores `py:obj` generically, so those build cleanly only because the `python` intersphinx target resolves them. The added clause prevents the sentence being generalized into "intersphinx is safe to strip," which would fail the `-W` build on thousands of `None`/`typing.*` references. ## Why this isn't a duplicate No open PR drops `nevergrad` or edits this sentence (checked `gh pr list --search` for `intersphinx`, `nevergrad`, and the `ray-contribute` annotations text). #65644 dropped eight other zero-resolution targets; this continues that hygiene on a target that has since regressed to zero. #65604 (dropping `pytorch_lightning`) is closed. ## Why this isn't trivial busywork It removes a committed binary snapshot plus a monthly refresh obligation on measured evidence, and it corrects a documented claim that could lead a contributor into a build-breaking change. The two edits share the intersphinx-resolution surface and land together rather than as separate one-line PRs. ## Tests Faithful local RtD build of this branch, mirroring the Read the Docs `-W` config: ``` python -m sphinx --keep-going -b html -d _build/doctrees -a -E -W -j auto -T -D language=en source _build/html ``` Result: `build succeeded.`, exit 0 (zero Sphinx warnings under `-W`). Post-build grep confirms `nevergrad` now resolves no markers and no `-W` failure was introduced by its removal (it resolved nothing before the drop, so nothing regressed). The Read the Docs PR-preview build is the authoritative gate and runs on this PR. ## AI assistance This change was prepared with AI assistance (Claude Code). The measurement, edits, and local build were reviewed by the submitter. --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…oject#65644) ## Why are these changes needed? Eight of the 26 entries in `_intersphinx_targets` resolve **zero** cross-references anywhere in the rendered documentation: `aiohttp`, `composer`, `distributed`, `horovod`, `pydantic`, `pytorch_lightning`, `scipy`, and `torchvision`. Each one still costs a committed `.inv` snapshot in the tree, a slot in the refresh cadence that `doc/source/_intersphinx/README.md` describes, and -- on any branch cut before ray-project#64977 -- a network fetch at build startup that can fail the `-W` build outright. Three of the eight (`torchvision`, `scipy`, and `pytorch_lightning`) were implicated in the Read the Docs failures on 2026-08-19/20 while resolving nothing. `pytorch_lightning` is the clearest case: `lightning.ai` serves an SPA shell for `objects.inv`, which ray-project#65604 proposed fixing by dropping the target before it was closed as superseded by ray-project#64977. Snapshots removed the urgency; nothing linking to it is the reason to drop it anyway. ### How this was measured When intersphinx resolves a cross-reference it stamps the anchor with `title="(in <Project> v<X>)"`. Counting those over a full 4,009-page HTML build gives an exhaustive per-target usage census. The 18 surviving targets: | Target | Refs | | Target | Refs | |---|---:|---|---|---:| | `python` | 10,690 | | `transformers` | 2 | | `pyarrow` | 132 | | `sklearn` | 2 | | `numpy` | 97 | | `nevergrad` | 2 | | `torch` | 96 | | `modin` | 2 | | `tensorflow` | 83 | | `mars` | 2 | | `pandas` | 55 | | `lightgbm` | 2 | | `gymnasium` | 18 | | `datasets` | 2 | | `pyspark` | 3 | | `dask` | 2 | | `grpc` | 3 | | `pymongoarrow` | 1 | The eight dropped targets appear nowhere in that census. ### Why this is safe under `-W` `conf.py` sets `nitpicky = True`, but `nitpick_ignore_regex` blanket-ignores `("py:class", ".*")`. Third-party type annotations resolve as `py:class`, so an unresolved one degrades to plain text instead of failing the build -- which is also what `ray-contribute/docs.md` promises contributors. Verified in addition that no `:external:` role and no explicit `py:obj` / `py:func` / `py:meth` / `py:mod` reference anywhere under `doc/source` targets a dropped namespace, since those reftypes are *not* covered by the blanket ignore. Worth recording the flip side, because it makes a tempting shortcut a non-starter: the `python` target can never be dropped. Sphinx's `parse_reftarget` assigns `reftype = 'obj'` rather than `'class'` for `None` and for every `typing.*` annotation, and nothing ignores `py:obj` generically. That is 2,856 `None` references plus 2,676 `typing.*` references -- 5,532 hard `-W` failures. "Strip intersphinx, then add back what's valuable" does not survive contact with the build. ## Related changes - Drops the `pytorch_lightning` inventory-pinning comment, which documented a workaround for a target that no longer exists. - Corrects the target counts and the now-singular `object-mirror-*` reference in `conf.py` and in `doc/source/_intersphinx/README.md`. - `refresh.py` reads the target list straight out of `conf.py`, so it needs no change. Confirmed it now parses 18 targets, matching the 18 remaining snapshots on disk exactly. Follow-up, not in this PR: 11 of the surviving targets resolve only 1-3 references each and are worth a separate keep-or-drop audit. ## Related issue number Follows ray-project#64977, which pre-baked the inventory snapshots. ## Checks - [x] I've signed off every commit (`-s`). - [x] I've included any doc changes needed for the change. - Testing strategy - [ ] Unit tests - [ ] Release tests - [x] Verified by the Read the Docs `-W` build on this PR, which is the gate that exercises `intersphinx_mapping`. Also verified locally that `refresh.py` parses 18 targets matching the 18 snapshots on disk, and that no reference under `doc/source` targets a dropped namespace via a reftype outside the `py:class` blanket ignore. Signed-off-by: Douglas Strodtman <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…tion-resolution note (ray-project#66211) ## What Two intersphinx-hygiene changes, backed by a fresh usage measurement of the rendered docs corpus: 1. **Drop the `nevergrad` intersphinx target** and its committed inventory snapshot. A per-target census of the rendered master corpus (4,432 pages) shows `nevergrad` resolves **zero** cross-references. Its only mentions in the built site are internal links to Ray's own `NevergradSearch` API and prose, not generated cross-references. It was carrying a committed `.inv` snapshot and a standing refresh obligation for no reader-facing links, which is the same criterion the eight targets dropped in ray-project#65644 met. `refresh.py` reads the target list from `_intersphinx_targets` in `conf.py`, so removing the entry also drops it from the refresh cycle with no further change. 2. **Correct an over-general sentence in the contributor docs.** `ray-contribute/docs.md` stated that annotations which don't resolve "render as plain text; they don't fail the build." That is true for third-party types, which resolve as `py:class` and are covered by a blanket `nitpick_ignore_regex` entry, but false for `None` and `typing.*` annotations, which Sphinx emits as `py:obj`. Nothing ignores `py:obj` generically, so those build cleanly only because the `python` intersphinx target resolves them. The added clause prevents the sentence being generalized into "intersphinx is safe to strip," which would fail the `-W` build on thousands of `None`/`typing.*` references. ## Why this isn't a duplicate No open PR drops `nevergrad` or edits this sentence (checked `gh pr list --search` for `intersphinx`, `nevergrad`, and the `ray-contribute` annotations text). ray-project#65644 dropped eight other zero-resolution targets; this continues that hygiene on a target that has since regressed to zero. ray-project#65604 (dropping `pytorch_lightning`) is closed. ## Why this isn't trivial busywork It removes a committed binary snapshot plus a monthly refresh obligation on measured evidence, and it corrects a documented claim that could lead a contributor into a build-breaking change. The two edits share the intersphinx-resolution surface and land together rather than as separate one-line PRs. ## Tests Faithful local RtD build of this branch, mirroring the Read the Docs `-W` config: ``` python -m sphinx --keep-going -b html -d _build/doctrees -a -E -W -j auto -T -D language=en source _build/html ``` Result: `build succeeded.`, exit 0 (zero Sphinx warnings under `-W`). Post-build grep confirms `nevergrad` now resolves no markers and no `-W` failure was introduced by its removal (it resolved nothing before the drop, so nothing regressed). The Read the Docs PR-preview build is the authoritative gate and runs on this PR. ## AI assistance This change was prepared with AI assistance (Claude Code). The measurement, edits, and local build were reviewed by the submitter. --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.
Why this change
Ray's docs build on
masterhas been failing since roughly 17:41 UTC on 2026-08-19. Sphinx fails to load the PyTorch Lightning intersphinx inventory, and because the build runs with-W, the single warning is fatal:https://lightning.ai/docs/pytorch/stable/objects.invnow returns HTTP 200 withtext/html— the lightning.ai single-page app shell — instead of a Sphinx inventory. This is upstream hosting, not anything in this repo.Three consecutive
masterbuilds failed with the identical warning (RtD builds 4337531, 4337840, 4337999); the last green one was 4337028 at 17:58 UTC. Thelast-modifiedheader on the lightning.ai docs shell isWed, 19 Aug 2026 17:41:25 GMT, which lines up with the start of the failures.The warning text does not name the failing project, because intersphinx loads inventories concurrently and the adjacent
loading intersphinx inventory ...line belongs to a different project in each build. I identified it by fetching all 26 inventory URLs inconf.pydirectly. Exactly one is broken; the other 25 return valid inventories.There is no working URL to repoint at. All of the following return the same app shell:
/docs/pytorch/{stable,latest}/objects.inv/docs/pytorch/{2.5.5,2.4.0,1.9.5}/objects.inv/docs/pytorch/stable/{_static,api,_downloads}/objects.inv/docs/{fabric,torchmetrics,litserve}/stable/objects.invpytorch-lightning.readthedocs.io/en/{stable,latest,1.9.5,2.6.5}/objects.inv(302 into lightning.ai)docs.pytorchlightning.aiis still a live Read the Docs custom domain, but it serves a 566-byte meta-refresh stub pointing at lightning.ai;objects.inv,searchindex.js, and_static/documentation_options.jsall 404 there. Content pages under lightning.ai are client-rendered too, so this looks site-wide rather than one missing asset.What this removes
The
pytorch_lightningentry inintersphinx_mapping, leaving 25 targets. Nothing else changes.No prose cross-reference depends on it. Grepping
doc/sourcefor Sphinx role xrefs (:class:,:meth:,:func:,:obj:, and the MyST{class}equivalents) targetingpytorch_lightning/lightning.pytorchreturns zero matches. Every mention in the Lightning docs pages and notebooks is prose, a code sample, or a hardcodedhttps://lightning.ai/...htmllink, none of which use intersphinx.The references that do resolve through this inventory are autodoc-generated, from Ray classes that subclass or annotate Lightning types:
ray.train.lightning.RayDDPStrategylightning.pytorch.strategies.DDPStrategy(base)ray.train.lightning.RayFSDPStrategylightning.pytorch.strategies.FSDPStrategy(base)ray.train.lightning.RayDeepSpeedStrategylightning.pytorch.strategies.DeepSpeedStrategy(base)ray.train.lightning.RayLightningEnvironmentlightning.pytorch.plugins.environments.LightningEnvironment(base)ray.train.lightning.RayTrainReportCallbacklightning.pytorch.callbacks.Callback(base)ray.train.lightning.prepare_trainerpl.Trainer(parameter and return annotation)ray.tune.integration.pytorch_lightning.TuneReportCheckpointCallbacklightning.pytorch.callbacks.Callback, via itsTuneCallbackbaseray.tune.integration.pytorch_lightning.TuneReportCallbackOn those eight API pages, the
Bases:line and theprepare_trainerannotations render as plain text instead of links to Lightning's docs. That is the entire user-visible cost, and those links are dead right now anyway, since lightning.ai serves no docs content.Removing the entry does not introduce nitpick warnings. Every reference above resolves as a
py:classref, andconf.pycarries("py:class", ".*")innitpick_ignore_regex, which suppresses that class repo-wide.Relationship to #64977
#64977 (
[docs] Pre-bake intersphinx inventory snapshots, approved 2026-08-14) is the better fix and should make this change unnecessary. It commitsdoc/source/_intersphinx/pytorch_lightning.inv— a valid PyTorch Lightning 2.6.1 inventory with 7,134 entries, captured before lightning.ai broke — and rewritesintersphinx_mappingto read the local snapshot first with the upstream URL only as a fallback. That both unblocks the build and keeps every cross-reference in the table above working, which this PR does not.I'm raising this only as a faster stopgap for a currently red
master. If #64977 lands first, close this one unmerged. If this lands first, #64977 should restore thepytorch_lightningentry alongside its snapshot, and the comment this PR leaves inconf.pyshould go with it.Testing
I did not run a full local Sphinx build. The Read the Docs
-Wbuild on this PR is the real gate, since it reproduces the exact failing configuration.What I ran:
python3 -c "import ast; ast.parse(...)"ondoc/source/conf.py— parses clean;intersphinx_mappinghas 25 targets and nopytorch_lightningkey.doc/sourcefor Sphinx and MyST role xrefs topytorch_lightning/lightning.pytorch/lightning.fabric— 0 matches, confirming no prose reference breaks.("py:class", ".*")is present innitpick_ignore_regex(doc/source/conf.py:293).conf.pyplus the alternate hosts listed above, checking each response for the# Sphinx inventory versionmagic bytes.Duplicate check
gh pr list --state open --search "intersphinx"returns #64977 and two unrelated Dependabot PRs. #64977 is the overlap and is described above; this change is deliberately different in approach and intended lifetime, and I'd rather see #64977 merge than this.AI assistance
AI assistance was used to diagnose the failure and draft this change and description.