Skip to content

Comments

Fix docs build: update Triton/Gluon mocks in conf.py#382

Merged
mawad-amd merged 2 commits intomainfrom
copilot/fix-documentation-generation
Feb 19, 2026
Merged

Fix docs build: update Triton/Gluon mocks in conf.py#382
mawad-amd merged 2 commits intomainfrom
copilot/fix-documentation-generation

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

Sphinx autodoc was silently failing to import all iris.* modules, producing empty API reference pages. The root cause: TritonMock and GluonMock in docs/conf.py were missing constexpr_function, which is used as a decorator in iris/tracing/events.py and iris/experimental/iris_gluon.py.

Changes

  • TritonMock / GluonMock: Add constexpr_function = PreserveDocstringMock() to both mock classes
  • PreserveDocstringMock: Handle decorator factory pattern (@triton.jit() with empty parens) in addition to the direct form (@triton.jit) — used extensively in iris/ops/ and iris/x/
  • autodoc_mock_imports: Add "tritonblas"iris.ops imports from it and it's unavailable in the docs build environment

The import failure chain: iris/__init__.pyiris/iris.pyiris/tracing/__init__.pyiris/tracing/events.py@triton.constexpr_functionAttributeError → all autodoc directives fail silently.

Original prompt

This section details on the original issue you should resolve

<issue_title>Documentation generation broken</issue_title>
<issue_description>Recent merge broke the documentation we are generating. Likely one of the PRs that refactored the iris class. Please investigate and fix the documentation without making too many changes.</issue_description>

<agent_instructions>It used to work so I expect changes to be minimal.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: mawad-amd <112003944+mawad-amd@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix broken documentation generation Fix docs build: update Triton/Gluon mocks in conf.py Feb 19, 2026
Copilot AI requested a review from mawad-amd February 19, 2026 12:51
@mawad-amd
Copy link
Collaborator

@copilot did you verify the generated documentation?

@mawad-amd mawad-amd marked this pull request as ready for review February 19, 2026 13:07
@mawad-amd mawad-amd requested a review from neoblizz as a code owner February 19, 2026 13:07
Copilot AI review requested due to automatic review settings February 19, 2026 13:07
@mawad-amd mawad-amd requested a review from BKP as a code owner February 19, 2026 13:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical documentation build issue where Sphinx autodoc was silently failing to import all iris.* modules, resulting in empty API reference pages. The root cause was missing constexpr_function attribute in the Triton and Gluon mock classes used during documentation generation, which caused import failures when importing modules that use this decorator.

Changes:

  • Added constexpr_function = PreserveDocstringMock() to both TritonMock and GluonMock classes to handle the @triton.constexpr_function and @gluon.constexpr_function decorators used in aggregate class constructors
  • Enhanced PreserveDocstringMock.__call__() to handle both direct decorator (@triton.jit) and decorator factory (@triton.jit()) usage patterns
  • Added "tritonblas" to autodoc_mock_imports list since it's imported by iris.ops modules but unavailable in the docs build environment

Copy link
Contributor Author

Copilot AI commented Feb 19, 2026

@copilot did you verify the generated documentation?

Yes — I built the docs locally using the same build_docs.sh script as CI and verified the output. All sections render correctly with full method signatures, parameters, return types, and examples:

  • Factory Function (iris)
  • Core Methods (get_heap_bases, barrier, get_device, get_cu_count, get_rank, get_num_ranks)
  • Logging Helpers (set_logger_level, debug, info, warning, error)
  • Utility Functions (do_bench)
  • Broadcast Helper (broadcast)

Iris Class docs

Zero autodoc: failed to import warnings in the build output.

@mawad-amd mawad-amd merged commit f840a61 into main Feb 19, 2026
40 of 41 checks passed
@mawad-amd mawad-amd deleted the copilot/fix-documentation-generation branch February 19, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation generation broken

2 participants