-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Easy][FRONTEND] Add pre run hooks to JITFunction #3314
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jlebar
approved these changes
Mar 7, 2024
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.
sgtm
I think it would be nice if the interpreter was modified to use these hooks too :) (doesn't need to be done in this PR) For example, something that we can't do today is
|
Merged for you! |
htyu
pushed a commit
to htyu/triton
that referenced
this pull request
Mar 20, 2024
This PR adds pre run hooks to JITFunction in order for user to do analysis/error detection or any other pre hook operation they would like to do prior to execution of the kernel. For PyTorch, the specific use case we have is being able to provide better error messages when a FakeTensor (our tracing tensors) are passed into the a Triton Kernel. In addition our use case, these pre run hooks should provide generic functionality to users.
binarman
pushed a commit
to binarman/triton
that referenced
this pull request
Apr 2, 2024
This PR adds pre run hooks to JITFunction in order for user to do analysis/error detection or any other pre hook operation they would like to do prior to execution of the kernel. For PyTorch, the specific use case we have is being able to provide better error messages when a FakeTensor (our tracing tensors) are passed into the a Triton Kernel. In addition our use case, these pre run hooks should provide generic functionality to users.
zou3519
added a commit
to zou3519/triton
that referenced
this pull request
Jul 17, 2024
Follow-up to triton-lang#3314 The context is that the PyTorch team wants to be able to override the behavior of triton kernels under various contexts. @chilee discussed this ask with triton folks previously and they seemed amenable to it. Some examples include: - PyTorch has FakeTensors, tensor subclasses that don't have storage. These can be sent through models, but today they error out when passed to a triton kernel. - PyTorch has symbolic tracing (torch.fx). torch.fx replaces Tensors with Proxy objects that then get passed to a function that may contain a triton kernel. Today that errors out. Test Plan: - added new tests
zou3519
added a commit
to zou3519/triton
that referenced
this pull request
Jul 17, 2024
Follow-up to triton-lang#3314 The context is that the PyTorch team wants to be able to override the behavior of triton kernels under various contexts. @Chillee discussed this ask with triton folks previously and they seemed amenable to it. Some examples include: - PyTorch has FakeTensors, tensor subclasses that don't have storage. These can be sent through models, but today they error out when passed to a triton kernel. - PyTorch has symbolic tracing (torch.fx). torch.fx replaces Tensors with Proxy objects that then get passed to a function that may contain a triton kernel. Today that errors out. Test Plan: - added new tests
7 tasks
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds pre run hooks to JITFunction in order for user to do analysis/error detection or any other pre hook operation they would like to do prior to execution of the kernel.
For PyTorch, the specific use case we have is being able to provide better error messages when a FakeTensor (our tracing tensors) are passed into the a Triton Kernel.
In addition our use case, these pre run hooks should provide generic functionality to users.