pytorch - 💡(How to fix) Fix [Docathon-TEST] Document `distributed.elastic.events.api` public APIs (2)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example

"Event",
    "RdzvEvent",

---

.. autoclass:: Event
  :members:

.. autoclass:: RdzvEvent
  :members:

---

cd docs
pip install -r requirements.txt  # first time only
make coverage   # Confirm your APIs no longer show as undocumented
make html       # Build the docs and check rendering
RAW_BUFFERClick to expand / collapse

Document torch.distributed.elastic.events.api Public APIs

Difficulty: 🟢 Easy APIs to document: 2 (0 functions, 2 classes) Doc file: docs/source/elastic/events.rst Config file: docs/source/conf.py

Background

PyTorch's documentation coverage skip lists in docs/source/conf.py contain public APIs that are not yet surfaced in the official docs. This issue tracks adding Sphinx autodoc directives for the torch.distributed.elastic.events.api APIs so they appear in the rendered documentation.

APIs to Document

Classes:

  • Event
  • RdzvEvent

Where to Make Changes

1. Remove entries from docs/source/conf.py

Find the # torch.distributed.elastic.events.api comment section and remove these entries:

From coverage_ignore_classes in docs/source/conf.py:

    "Event",
    "RdzvEvent",

2. Add Sphinx directives to docs/source/elastic/events.rst

Placement: Find the line containing .. autoclass:: torch.distributed.elastic.events.api.EventMetadataValue (line 28) and add your directives immediately after it (this is the last entry in the torch.distributed.elastic.events.api section).

Add the following directives:

.. autoclass:: Event
  :members:

.. autoclass:: RdzvEvent
  :members:

How to Verify

cd docs
pip install -r requirements.txt  # first time only
make coverage   # Confirm your APIs no longer show as undocumented
make html       # Build the docs and check rendering

Open docs/build/html/ in a browser and navigate to your newly documented APIs.

PR Requirements

  • Entries removed from skip list(s) in docs/source/conf.py
  • Sphinx directives added to docs/source/elastic/events.rst
  • make coverage passes with no new undocumented warnings for these APIs
  • Screenshot(s) of the rendered documentation included in the PR description

Tips & Pitfalls

  • .rst vs .md files: RST files use directives directly. Markdown (.md) files need each directive wrapped in a ```{eval-rst} fence.
  • currentmodule scope: Every .. autofunction:: name resolves against the most recent .. currentmodule:: above it. Make sure your directive is under the correct one.
  • :members: for classes: Add :members: to autoclass directives to include documented methods.
  • PR preview: After pushing, your docs render at https://docs-preview.pytorch.org/pytorch/pytorch/<pr_number>/index.html

🤖 Optional: Claude Code Skill

This repo includes a Claude skill at .claude/skills/document-public-apis/SKILL.md that can assist with this workflow.

References

extent analysis

TL;DR

To fix the documentation issue, remove the Event and RdzvEvent classes from the coverage_ignore_classes list in docs/source/conf.py and add Sphinx directives to docs/source/elastic/events.rst to include these classes in the documentation.

Guidance

  • Remove the specified entries from the coverage_ignore_classes list in docs/source/conf.py to ensure the classes are included in the documentation coverage.
  • Add the provided Sphinx directives to docs/source/elastic/events.rst to document the Event and RdzvEvent classes.
  • Verify the changes by running make coverage and make html to confirm the APIs are no longer listed as undocumented and to check the rendering of the documentation.
  • Include a screenshot of the rendered documentation in the PR description to demonstrate the changes.

Example

No specific code example is needed beyond what is provided in the issue, but the Sphinx directives to be added are:

.. autoclass:: Event
  :members:

.. autoclass:: RdzvEvent
  :members:

Notes

The provided steps should resolve the documentation issue for the specified APIs. Ensure that the directives are added in the correct location within docs/source/elastic/events.rst to maintain proper documentation structure.

Recommendation

Apply the workaround by following the provided steps to remove the classes from the ignore list and add the necessary Sphinx directives. This approach directly addresses the issue by ensuring the classes are properly documented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix [Docathon-TEST] Document `distributed.elastic.events.api` public APIs (2)