-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
[mlir][ReshapeOpsUtils] ComposeExpandOfCollapseOp is not detecting complicated dynamic shapes #117117
Labels
Comments
hockyy
changed the title
ComposeExpandOfCollapseOp is not detecting complicated dynamic shapes
[MLIR][ReshapeOpsUtils] ComposeExpandOfCollapseOp is not detecting complicated dynamic shapes
Nov 21, 2024
hockyy
changed the title
[MLIR][ReshapeOpsUtils] ComposeExpandOfCollapseOp is not detecting complicated dynamic shapes
[mlir][ReshapeOpsUtils] ComposeExpandOfCollapseOp is not detecting complicated dynamic shapes
Nov 21, 2024
@llvm/issue-subscribers-mlir Author: Hocky Yudhiono (hockyy)
```
module {
func.func @broadcast_test(%arg0: tensor<4x8x?x3x?xf32>) -> tensor<1x4x3x8x1x1x?x3x1x1x?x1x14xf32> {
%c2 = arith.constant 2 : index
%c4 = arith.constant 4 : index
%dim = tensor.dim %arg0, %c4 : tensor<4x8x?x3x?xf32>
%dim_0 = tensor.dim %arg0, %c2 : tensor<4x8x?x3x?xf32>
%collapsed = tensor.collapse_shape %arg0 [[0], [1, 2, 3, 4]] : tensor<4x8x?x3x?xf32> into tensor<4x?xf32>
%0 = tensor.empty(%dim_0, %dim) : tensor<4x3x8x?x3x?x14xf32>
%collapsed_1 = tensor.collapse_shape %0 [[0], [1], [2, 3, 4, 5], [6]] : tensor<4x3x8x?x3x?x14xf32> into tensor<4x3x?x14xf32>
%broadcasted = linalg.broadcast ins(%collapsed : tensor<4x?xf32>) outs(%collapsed_1 : tensor<4x3x?x14xf32>) dimensions = [1, 3]
%collapsed_2 = tensor.collapse_shape %broadcasted [[0, 1, 2, 3]] : tensor<4x3x?x14xf32> into tensor<?xf32>
%expanded = tensor.expand_shape %collapsed_2 [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]] output_shape [1, 4, 3, 8, 1, 1, %dim_0, 3, 1, 1, %dim, 1, 14] : tensor<?xf32> into tensor<1x4x3x8x1x1x?x3x1x1x?x1x14xf32>
return %expanded : tensor<1x4x3x8x1x1x?x3x1x1x?x1x14xf32>
}
}
```
This part is not canonicalized |
Maybe it's same to #109650. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This part is not canonicalized
The text was updated successfully, but these errors were encountered: