-
Notifications
You must be signed in to change notification settings - Fork 49
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
addptr operand produced by an unsupported operation: divsi
#16
Comments
Add a python script:
|
Currently I am looking at this issue, please assign it to me. |
@yuanfz98 @nhat-nguyen I wanted to check on this. There's some discussion of this pattern being supported in #62. Does it work in the latest version? |
@yuanfz98 @nhat-nguyen, I want to follow up on this as well. @blaine-rister, the issue still exists in the latest version. |
@fhossein-quic Sorry for the delayed response. We can't statically determine the shape of the memory loads when there are |
Was this triton kernel generated by Torch Inductor? @fhossein-quic @nhat-nguyen I thought you might be interested in pytorch/pytorch#125077. We are beefing up Inductor's codegen so it won't use mod/div to compute indices nearly as often. |
@blaine-rister This code is indeed generated from torch-inductor! Thank you for the link and appreciate the improvements in the codegen! Do you know if the improvements will help in this case #138? We have rather complex codegen from torch-inductor throughout most of the basic operations such as singleton broadcasting, reshape,... I will definitely go through your chain of PR this week to understand more about the improvements. Thanks again! |
@nhat-nguyen that PR should work for broadcasts. I'm not sure about reshape--I think it mostly depends on what you do with the result of the reshape. AFAIK reshape by itself doesn't change the underlying data, but it affects the semantics of subsequent operations on that data. The basic pattern seems similar to what's described in #138. Basically, we pattern match on mod/div indexing expressions, trying to determine that this is the same iteration order as some ND block. Then we solve for the shape of that block. There are some complicated scenarios where this analysis fails, e.g. Right now, to take advantage of that PR you have to follow several restrictions:
We have some ideas on how to expand it beyond those so you'll see the benefits on all shapes, with or without block pointers. |
@nhat-nguyen pytorch/pytorch#132937 should expand Inductor's block pointer support for pointwise kernels. You need to use the new |
Any progress on this? |
We're still working on the final touches of this fallback mode, hopefully we will be able to push some changes over the coming weeks. |
created from #7.
I don't know what original Triton code looked like that created this, but there is a division in the address expression.
repros.zip
triton-shared-opt -triton-to-linalg 5.mlir
triton-shared-opt -triton-to-linalg 32.mlir
triton-shared-opt -triton-to-linalg 35.mlir
triton-shared-opt -triton-to-linalg 41.mlir
triton-shared-opt -triton-to-linalg 72.mlir
triton-shared-opt -triton-to-linalg 88.mlir
Error output:
The text was updated successfully, but these errors were encountered: