Skip to content
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

Optimize Dot + Slice #3267

Closed
umangyadav opened this issue Jul 11, 2024 · 1 comment · Fixed by #3268
Closed

Optimize Dot + Slice #3267

umangyadav opened this issue Jul 11, 2024 · 1 comment · Fixed by #3268
Assignees

Comments

@umangyadav
Copy link
Member

RNN has patterns where
Output of GEMM is immediately Sliced.

MIGraphX can slice inputs of the GEMMs instead and only compute portion of the GEMM that is useful instead.

@umangyadav umangyadav self-assigned this Jul 11, 2024
@umangyadav
Copy link
Member Author

For exmaple:
Following is the code snippet before fuse_mlir pass for the test_gru_bidirct_3args test where @22 is a dot operation and only used once where it is sliced.

@22 = gpu::mlir_op[op=dot](@0,r), [mlir_dot1] -> float_type, {2, 10}, {10, 1}
@23 = slice[axes={1},starts={0},ends={5}](@21) -> float_type, {2, 5}, {15, 1}
@24 = contiguous(@23) -> float_type, {2, 5}, {5, 1}
@25 = slice[axes={1},starts={10},ends={15}](@21) -> float_type, {2, 5}, {15, 1}
@26 = contiguous(@25) -> float_type, {2, 5}, {5, 1}
@27 = slice[axes={1},starts={0},ends={5}](@22) -> float_type, {2, 5}, {10, 1}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant