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

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

Added comprehensive documentation for the operation fuser API, including a detailed usage guide with code examples, diagrams, and integration into the API reference docs.

Major changes:

  • Created new op_fuser.rst guide covering basic usage, quantization workflows, branching operations, implementation details, and common misconceptions
  • Added operation fuser section to PyTorch API documentation listing all 26+ fusible operations
  • Fixed docstring formatting across 15+ Python modules (single backticks to double backticks for proper RST rendering)
  • Improved parameter documentation (e.g., `False` to False, `None` to None)
  • Fixed RST hyperlink formatting (added spaces before closing backticks)
  • Added .DS_Store to .gitignore

Confidence Score: 5/5

  • This PR is safe to merge with no risk - pure documentation improvements
  • All changes are documentation-only: new user guide, API reference updates, and docstring formatting fixes. No functional code changes. One minor style issue with missing newline at EOF in .gitignore.
  • No files require special attention

Important Files Changed

Filename Overview
docs/examples/op_fuser/op_fuser.rst Added comprehensive usage guide for op fuser API with examples and diagrams
docs/api/pytorch.rst Added operation fuser API reference section with all op classes
.gitignore Added .DS_Store to ignored files (missing newline at EOF)

Sequence Diagram

sequenceDiagram
    participant User
    participant Sequential
    participant FusibleOperation
    participant OperationFuser
    participant FusedKernel

    User->>Sequential: Construct with ops
    User->>Sequential: Forward pass
    Sequential->>OperationFuser: Group operations
    OperationFuser->>FusibleOperation: Analyze fusion opportunities
    FusibleOperation-->>OperationFuser: Return fusion metadata
    OperationFuser->>FusedKernel: Launch fused forward
    FusedKernel-->>OperationFuser: Forward result
    OperationFuser-->>Sequential: Return output
    Sequential-->>User: Output tensor
    
    User->>Sequential: Backward pass
    Sequential->>OperationFuser: Trigger backward
    OperationFuser->>FusedKernel: Launch fused backward
    FusedKernel-->>OperationFuser: Gradients
    OperationFuser-->>Sequential: Return gradients
    Sequential-->>User: Loss gradients
Loading

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.

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.

Additional Comments (1)

  1. transformer_engine/pytorch/ops/basic/activation.py, line 387 (link)

    syntax: Extra space before period.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

19 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

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

Additional Comments (1)

  1. .gitignore, line 44 (link)

    style: missing newline at end of file

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

19 files reviewed, 1 comment

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.

2 participants