Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PyTorch] Remove some direct calls to PyTorch extensions in Float8Tensor #1137

Closed
wants to merge 2 commits into from

Conversation

timmoon10
Copy link
Collaborator

Description

When Float8Tensor launches TE kernels, it directly calls the PyTorch extensions rather than using the Python wrapper functions in te.pytorch.cpp_extensions. This is because the Python wrapper functions required passing in FP8TensorMeta objects. #1083 changed the APIs so the FP8TensorMetas are optional. This PR takes advantage of these new APIs, which also has the effect of registering FP8 casts with TorchScript.

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 refractor

Changes

  • Replace tex.cast_to_fp8 and tex.cast_from_fp8 calls in Float8Tensor with cpp_extensions wrappers

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 and others added 2 commits August 26, 2024 22:49
Avoid unnecessary direct calls to PyTorch extensions.

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

/te-ci pytorch

@timmoon10
Copy link
Collaborator Author

These changes have been incorporated into #1127.

@timmoon10 timmoon10 closed this Sep 3, 2024
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.

1 participant