-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Type exposed_in decorator #141894
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
Type exposed_in decorator #141894
Conversation
Test Plan: - lintrunner [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/141894
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b22b108 with merge base 9012e7a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
albanD
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok!
Test Plan: - lintrunner [ghstack-poisoned]
| device_types: device_types_t = None, | ||
| schema: Optional[str] = None, | ||
| ) -> Callable: | ||
| ) -> Any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this valuable typing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not correct
| from typing import Callable, TypeVar | ||
|
|
||
|
|
||
| F = TypeVar("F") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| F = TypeVar("F") | |
| _F = TypeVar("_F") |
No reason for the TypeVar to be public
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file isn't public (the path is torch.utils._exposed_in) so F isn't public
We've been using it privately for half a year and everything's been good. This PR: 1. Makes torch.library.triton_op public 2. Renames capture_triton -> wrap_triton. We got feedback that no one knew what "capture triton" does. 3. Makes torch.library.wrap_triton public. triton_op is used to construct a Python custom operator that may call 1+ triton kernels. Each of those triton kernels must be annotated with wrap_triton. Test Plan: - existing tests Pull Request resolved: #141880 Approved by: https://github.com/albanD ghstack dependencies: #141894
Fixes #141618 Pull Request resolved: #141883 Approved by: https://github.com/albanD ghstack dependencies: #141894, #141880
Test Plan: - lintrunner Pull Request resolved: pytorch#141894 Approved by: https://github.com/albanD
We've been using it privately for half a year and everything's been good. This PR: 1. Makes torch.library.triton_op public 2. Renames capture_triton -> wrap_triton. We got feedback that no one knew what "capture triton" does. 3. Makes torch.library.wrap_triton public. triton_op is used to construct a Python custom operator that may call 1+ triton kernels. Each of those triton kernels must be annotated with wrap_triton. Test Plan: - existing tests Pull Request resolved: pytorch#141880 Approved by: https://github.com/albanD ghstack dependencies: pytorch#141894
) Fixes pytorch#141618 Pull Request resolved: pytorch#141883 Approved by: https://github.com/albanD ghstack dependencies: pytorch#141894, pytorch#141880
Summary: #141894 made this API actually typed w.r.t. pyre, which is causing some internal type failures. This PR expands the typing for stack_module_state to squash those failures. Test Plan: - pyre [ghstack-poisoned]
Summary: #141894 made this API actually typed w.r.t. pyre, which is causing some internal type failures. This PR expands the typing for stack_module_state to squash those failures. Test Plan: - pyre Pull Request resolved: #142169 Approved by: https://github.com/albanD
Test Plan: - lintrunner Pull Request resolved: pytorch#141894 Approved by: https://github.com/albanD
We've been using it privately for half a year and everything's been good. This PR: 1. Makes torch.library.triton_op public 2. Renames capture_triton -> wrap_triton. We got feedback that no one knew what "capture triton" does. 3. Makes torch.library.wrap_triton public. triton_op is used to construct a Python custom operator that may call 1+ triton kernels. Each of those triton kernels must be annotated with wrap_triton. Test Plan: - existing tests Pull Request resolved: pytorch#141880 Approved by: https://github.com/albanD ghstack dependencies: pytorch#141894
) Fixes pytorch#141618 Pull Request resolved: pytorch#141883 Approved by: https://github.com/albanD ghstack dependencies: pytorch#141894, pytorch#141880
Summary: #141894 made this API actually typed w.r.t. pyre, which is causing some internal type failures. This PR expands the typing for stack_module_state to squash those failures. Test Plan: - pyre Pull Request resolved: #142169 Approved by: https://github.com/albanD
Stack from ghstack (oldest at bottom):
Test Plan: