Skip to content

[docs] Drop the unreachable pytorch_lightning intersphinx target - #65604

Closed
dstrodtman wants to merge 1 commit into
masterfrom
djs-260819-drop-lightning-intersphinx
Closed

dstrodtman wants to merge 1 commit into
masterfrom
djs-260819-drop-lightning-intersphinx

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why this change

Ray's docs build on master has 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:

WARNING: failed to reach any of the inventories with the following issues:
unknown or unsupported inventory version: ValueError('invalid inventory header: <!doctype html>')
build finished with problems, 1 warning (with warnings treated as errors).

https://lightning.ai/docs/pytorch/stable/objects.inv now returns HTTP 200 with text/html — the lightning.ai single-page app shell — instead of a Sphinx inventory. This is upstream hosting, not anything in this repo.

Three consecutive master builds failed with the identical warning (RtD builds 4337531, 4337840, 4337999); the last green one was 4337028 at 17:58 UTC. The last-modified header on the lightning.ai docs shell is Wed, 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 in conf.py directly. 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.inv
  • pytorch-lightning.readthedocs.io/en/{stable,latest,1.9.5,2.6.5}/objects.inv (302 into lightning.ai)

docs.pytorchlightning.ai is 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.js all 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_lightning entry in intersphinx_mapping, leaving 25 targets. Nothing else changes.

No prose cross-reference depends on it. Grepping doc/source for Sphinx role xrefs (:class:, :meth:, :func:, :obj:, and the MyST {class} equivalents) targeting pytorch_lightning / lightning.pytorch returns zero matches. Every mention in the Lightning docs pages and notebooks is prose, a code sample, or a hardcoded https://lightning.ai/...html link, 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 API Lightning target
ray.train.lightning.RayDDPStrategy lightning.pytorch.strategies.DDPStrategy (base)
ray.train.lightning.RayFSDPStrategy lightning.pytorch.strategies.FSDPStrategy (base)
ray.train.lightning.RayDeepSpeedStrategy lightning.pytorch.strategies.DeepSpeedStrategy (base)
ray.train.lightning.RayLightningEnvironment lightning.pytorch.plugins.environments.LightningEnvironment (base)
ray.train.lightning.RayTrainReportCallback lightning.pytorch.callbacks.Callback (base)
ray.train.lightning.prepare_trainer pl.Trainer (parameter and return annotation)
ray.tune.integration.pytorch_lightning.TuneReportCheckpointCallback lightning.pytorch.callbacks.Callback, via its TuneCallback base
ray.tune.integration.pytorch_lightning.TuneReportCallback same, inherited

On those eight API pages, the Bases: line and the prepare_trainer annotations 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:class ref, and conf.py carries ("py:class", ".*") in nitpick_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 commits doc/source/_intersphinx/pytorch_lightning.inv — a valid PyTorch Lightning 2.6.1 inventory with 7,134 entries, captured before lightning.ai broke — and rewrites intersphinx_mapping to 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 the pytorch_lightning entry alongside its snapshot, and the comment this PR leaves in conf.py should go with it.

Testing

I did not run a full local Sphinx build. The Read the Docs -W build on this PR is the real gate, since it reproduces the exact failing configuration.

What I ran:

  • python3 -c "import ast; ast.parse(...)" on doc/source/conf.py — parses clean; intersphinx_mapping has 25 targets and no pytorch_lightning key.
  • Grepped doc/source for Sphinx and MyST role xrefs to pytorch_lightning / lightning.pytorch / lightning.fabric — 0 matches, confirming no prose reference breaks.
  • Confirmed ("py:class", ".*") is present in nitpick_ignore_regex (doc/source/conf.py:293).
  • Fetched all 26 inventory URLs from conf.py plus the alternate hosts listed above, checking each response for the # Sphinx inventory version magic 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.

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]>
@dstrodtman
dstrodtman requested review from a team as code owners August 19, 2026 22:43

@gemini-code-assist gemini-code-assist 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.

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.

@ray-gardener ray-gardener Bot added docs An issue or change related to documentation train Ray Train Related Issue core Issues that should be addressed in Ray Core labels Aug 20, 2026
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Aug 20, 2026
@dstrodtman

Copy link
Copy Markdown
Contributor Author

Superseded by #64977

@dstrodtman dstrodtman closed this Aug 21, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core docs An issue or change related to documentation go add ONLY when ready to merge, run all tests train Ray Train Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant