-
Notifications
You must be signed in to change notification settings - Fork 824
[StableHLO] Fix reshape canonicalization for dense_resource constants. #22365
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
Conversation
8e6a0af to
c4ad1bd
Compare
|
@weidel-p can you remove all the unrelated commits from this PR? |
c4ad1bd to
4643144
Compare
|
sorry, the signoff added those by accident. |
compiler/plugins/input/StableHLO/Conversion/Preprocessing/Canonicalization.cpp
Outdated
Show resolved
Hide resolved
ff884cb to
8d52a41
Compare
|
Thanks for the feedback, please take a look again. |
hanhanW
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.
overall looks okay, just few nits.
compiler/plugins/input/StableHLO/Conversion/Preprocessing/test/canonicalization.mlir
Outdated
Show resolved
Hide resolved
| // Test for reshape with dense_resource constants (regression test for crash) | ||
| // CHECK-LABEL: func.func @reshape_dense_resource | ||
| func.func @reshape_dense_resource() -> tensor<8x1x1xf32> { | ||
| %cst = stablehlo.constant dense_resource<torch_tensor_8_torch.float32> : tensor<8xf32> |
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.
You don't need any torch things in StableHLO directory. Can you just do something like dense_resource<__elided__> : tensor<8xf32>, or find a builtin one?
This test will be broken if
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.
I renamed the dense resource with elided.
|
Please update PR title. See https://google.github.io/eng-practices/review/developer/cl-descriptions.html for the guidance. |
compiler/plugins/input/StableHLO/Conversion/Preprocessing/Canonicalization.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Philipp <[email protected]>
Signed-off-by: Philipp <[email protected]>
…/canonicalization.mlir Co-authored-by: Han-Chung Wang <[email protected]> Signed-off-by: Philipp <[email protected]>
…nicalization.cpp Co-authored-by: Jakub Kuderski <[email protected]> Signed-off-by: Philipp <[email protected]>
Signed-off-by: Philipp <[email protected]>
be292bd to
5070145
Compare
compiler/plugins/input/StableHLO/Conversion/Preprocessing/test/canonicalization.mlir
Outdated
Show resolved
Hide resolved
Signed-off-by: Philipp <[email protected]>
Signed-off-by: Philipp <[email protected]>
|
sorry, I missed installing the pre-commit tool. Now linting should work. |
hanhanW
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.
thanks!
iree-org#22365) Handle DenseResourceElementsAttr in Canonicalization.cpp to deal with 1D dense resources. Fixes: iree-org#22230 --------- Signed-off-by: Philipp <[email protected]> Co-authored-by: Han-Chung Wang <[email protected]> Co-authored-by: Jakub Kuderski <[email protected]>
Handle DenseResourceElementsAttr in Canonicalization.cpp to deal with 1D dense resources.
Fixes: #22230