Skip to content

Conversation

@timmoon10
Copy link
Collaborator

Description

This PR adds a basic usage guide for the op fuser and includes it in the autogenerated API docs.

It is ready as-is, but if reviews take a while I may expand it with a guide on creating custom fused ops.

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

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

@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 Overview

Greptile Summary

This PR adds comprehensive documentation for the operation fuser API in Transformer Engine, including a new usage guide and autogenerated API docs.

  • Added new docs/examples/op_fuser/op_fuser.rst with usage guide covering basic usage, quantization, branching operations, and implementation details
  • Added operation fuser classes to autogenerated API documentation in docs/api/pytorch.rst
  • Fixed RST docstring formatting across multiple Python files (single backticks → double backticks, hyperlink spacing)
  • Included PNG diagrams illustrating operation fusion patterns
  • Added .DS_Store to .gitignore

Confidence Score: 5/5

  • This PR is safe to merge - it consists entirely of documentation additions and docstring formatting fixes with no functional code changes.
  • All changes are documentation-only (RST files, docstrings, and .gitignore). No functional code is modified. The code examples in the documentation have been verified to use correct API signatures. Previous review comments about swapped arguments have been addressed in a follow-up commit.
  • No files require special attention.

Important Files Changed

File Analysis

Filename Score Overview
docs/examples/op_fuser/op_fuser.rst 5/5 New comprehensive documentation guide for the operation fuser API, covering basic usage, quantization, branching operations, and implementation details with correct code examples.
docs/api/pytorch.rst 5/5 Added autogenerated API documentation for operation fuser classes including Sequential, FusibleOperation, Linear, and various ops.
docs/index.rst 5/5 Added link to new op_fuser documentation page in the documentation index.
transformer_engine/pytorch/ops/basic/activation.py 5/5 Fixed RST formatting for hyperlinks (added spaces before angle brackets) and improved ClampedSwiGLU warning block formatting for proper Sphinx rendering.
transformer_engine/pytorch/ops/basic/basic_linear.py 5/5 Docstring formatting improvements: changed single backticks to double backticks for proper RST code formatting.
transformer_engine/pytorch/ops/linear.py 5/5 Docstring formatting improvements: changed single backticks to double backticks for proper RST code formatting.
.gitignore 5/5 Added .DS_Store to gitignore to exclude macOS metadata files.

Sequence Diagram

sequenceDiagram
    participant User
    participant Sequential
    participant OperationFuser
    participant FusibleOp as FusibleOperation
    participant BasicOp as BasicOperation

    User->>Sequential: Create with FusibleOperations
    User->>Sequential: forward(x)
    Sequential->>OperationFuser: Group adjacent ops (first call)
    OperationFuser->>FusibleOp: Attempt fusion
    FusibleOp->>BasicOp: Access params/state
    BasicOp-->>FusibleOp: Return fused result
    FusibleOp-->>OperationFuser: Return output
    OperationFuser-->>Sequential: Return fused output
    Sequential-->>User: Return y
Loading

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.

19 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

timmoon10 and others added 2 commits December 2, 2025 22:03
Review suggestion from @greptile-apps

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

/te-ci core pytorch

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.

19 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Signed-off-by: Tim Moon <[email protected]>
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.

19 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.

1 participant