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

Torch: Fold RuntimeAssertOp when condition is true #2198

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

mgehre-amd
Copy link
Contributor

@mgehre-amd mgehre-amd commented Jun 5, 2023

The runtime.assert op gets introduced by some decompositions.
In the cases we saw, the condition got simplified to true, so we can remove the assert again.

This makes two tests pass with TOSA.

@mgehre-amd mgehre-amd requested a review from silvasean June 6, 2023 08:08
Copy link
Collaborator

@qingyunqu qingyunqu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@ramiro050 ramiro050 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgehre-amd mgehre-amd force-pushed the matthias.fold_runtime_assert branch from 9f722e9 to 8938962 Compare June 7, 2023 11:40
@mgehre-amd mgehre-amd force-pushed the matthias.fold_runtime_assert branch from 8938962 to d23bdd2 Compare June 7, 2023 12:00
@mgehre-amd
Copy link
Contributor Author

mgehre-amd commented Jun 7, 2023

Can you also add a lit test in: https://github.com/llvm/torch-mlir/blob/main/test/Dialect/Torch/canonicalize.mlir

Other than that, LGTM

Done!

@qingyunqu qingyunqu merged commit 27a3d09 into llvm:main Jun 9, 2023
gpetters94 pushed a commit to gpetters94/mlir-npcomp that referenced this pull request Jul 7, 2023
gpetters94 pushed a commit to gpetters94/mlir-npcomp that referenced this pull request Jul 7, 2023
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 this pull request may close these issues.

3 participants