Skip to content

[PyTorch] Documentation for op fuser API#2447

Open
timmoon10 wants to merge 23 commits intoNVIDIA:mainfrom
timmoon10:tmoon/te-ops-docs
Open

[PyTorch] Documentation for op fuser API#2447
timmoon10 wants to merge 23 commits intoNVIDIA:mainfrom
timmoon10:tmoon/te-ops-docs

Conversation

@timmoon10
Copy link
Collaborator

@timmoon10 timmoon10 commented Dec 3, 2025

Description

This PR adds a basic usage guide for the op fuser and includes it in the autogenerated API docs. It also includes a guide for implementing custom ops and fusions.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

  • Add basic usage guide for op fuser
  • Include TE ops in autogenerated API docs
  • Debug TE ops docstrings
  • Add guide for implementing custom ops and fusions

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
@timmoon10 timmoon10 added the documentation Improvements or additions to documentation label Dec 3, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 3, 2025

Greptile Summary

This PR adds comprehensive documentation for the operation fuser API, including a detailed usage guide with examples and a developer guide for implementing custom operations and fusions. The documentation demonstrates basic usage patterns, quantization support, and branching operations.

Key changes:

  • New docs/examples/op_fuser/op_fuser.rst guide with usage examples and developer guidance
  • Added operation fuser classes and functions to API documentation in docs/api/pytorch.rst
  • Cleaned up docstrings across multiple operation files by fixing RST hyperlink formatting (adding spaces between link text and URLs)
  • Added corresponding test cases in tests/pytorch/test_fusible_ops.py that mirror the documentation examples

What was reviewed:
All previous thread issues have been addressed or acknowledged by the developer. The documentation is well-structured with clear examples. The code changes are primarily formatting improvements to docstrings for better rendering in autogenerated documentation. The test cases provide executable validation of the documentation examples.

Confidence Score: 5/5

  • This PR is safe to merge - it's a documentation-only change with corresponding tests
  • The PR exclusively adds documentation and fixes docstring formatting. All previously identified issues in review threads have been addressed or acknowledged. The new documentation is comprehensive, well-structured, and includes matching test cases for validation. No functional code changes affect runtime behavior.
  • No files require special attention

Important Files Changed

Filename Overview
docs/examples/op_fuser/op_fuser.rst New comprehensive documentation guide for op fuser API with usage examples and developer guide
docs/api/pytorch.rst Added operation fuser classes and functions to API documentation
tests/pytorch/test_fusible_ops.py Added test cases that match documentation examples for custom ops and fusions
transformer_engine/pytorch/ops/basic/activation.py Fixed RST hyperlink formatting by adding spaces between link text and URLs in docstrings
transformer_engine/pytorch/ops/linear.py Updated docstrings for consistency and API documentation generation

Last reviewed commit: 03abb07

greptile-apps[bot]

This comment was marked as resolved.

timmoon10 and others added 2 commits December 2, 2025 22:03
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Review suggestion from @greptile-apps

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
@timmoon10

This comment was marked as outdated.

greptile-apps[bot]

This comment was marked as resolved.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
greptile-apps[bot]

This comment was marked as outdated.

greptile-apps[bot]

This comment was marked as resolved.

@pggPL pggPL self-requested a review December 17, 2025 12:47
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
@timmoon10

This comment was marked as outdated.

greptile-apps[bot]

This comment was marked as resolved.

Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
greptile-apps[bot]

This comment was marked as outdated.

greptile-apps[bot]

This comment was marked as outdated.

Comment on lines 151 to 153
Copy link
Member

Choose a reason for hiding this comment

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

Not sure what that means - any examples?

Copy link
Collaborator Author

@timmoon10 timmoon10 Jan 15, 2026

Choose a reason for hiding this comment

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

For MXFP8, it's not safe for the quantize op to produce a MXFP8Tensor with swizzled scales. There's no way to know if it will consumed by a GEMM or by something else.

@timmoon10 timmoon10 removed the 2.12.0 label Jan 25, 2026
greptile-apps[bot]

This comment was marked as resolved.

Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
@timmoon10
Copy link
Collaborator Author

@greptile-apps I'm about to push a commit with a major reorganization. In addition to checking correctness, please check that the writing is clear and sounds natural.

timmoon10 and others added 2 commits February 17, 2026 23:45
Signed-off-by: Tim Moon <tmoon@nvidia.com>
greptile-apps[bot]

This comment was marked as resolved.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
@timmoon10
Copy link
Collaborator Author

/te-ci

greptile-apps[bot]

This comment was marked as resolved.

@greptile-apps

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

Signed-off-by: Tim Moon <tmoon@nvidia.com>
greptile-apps[bot]

This comment was marked as outdated.

Signed-off-by: Tim Moon <tmoon@nvidia.com>
greptile-apps[bot]

This comment was marked as resolved.

Signed-off-by: Tim Moon <tmoon@nvidia.com>
greptile-apps[bot]

This comment was marked as resolved.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Tim Moon <4406448+timmoon10@users.noreply.github.com>
greptile-apps[bot]

This comment was marked as outdated.

Signed-off-by: Tim Moon <tmoon@nvidia.com>
Signed-off-by: Tim Moon <tmoon@nvidia.com>
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

25 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments