Optimization for fold compare_GT(maximum(a,b), a) into compare_GT(b,a). Is it needed? #8346
apivovarov
started this conversation in
Ideas
Replies: 3 comments
-
Thank you, I think this is a universal simplification. |
Beta Was this translation helpful? Give feedback.
0 replies
-
As long as it preserves NaN propagation, we are happy to accept such optimizations for AlgebraicSimplifier. I suggest to not add all at once, but in different PRs, as it is easier to review that way. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Opened PR: Simplify Gt(Max(a,b), a) -> Gt(b,a) #9201 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a compiler frontend which is based on OpenXLA
Internally we have an optimization to fold
compare_GT(maximum(a,b), a)
intocompare_GT(b,a)
The optimization is added to
algebraic_simplifier.cc::HandleCompare()
.Full list of similar optimizations:
How useful would it be to contribute these optimizations to OpenXLA main?
We tested GT(max(a,b), a) optimization on Resnet50 model internally
Overall, we observed the following benefits of adding this optimization:
@majnemer @akuegel @lipracer @jurahul What you think?
Beta Was this translation helpful? Give feedback.
All reactions