-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add EvalTranspose pattern to StablehloAggressiveFolder #2570
Conversation
@mvpant wanted to give a heads up that I'm going to be doing some re-organizing of StablehloAggressiveSimplification in the coming days (not planning to touch folders this week), and add some patterns from MHLO canonicalizers. If you don't have any active changes..maybe hold off on starting any for a few days to avoid a nasty merge conflict. |
@GleasonK sure. By the way, out of curiosity, what is the reason why stablehlo operations do not have |
Exactly this. I've had too many issues with folks not being able to opt-out of certain patterns being applied and then they invent "clever" solutions like barrier ops to prevent constant folding, or mirrors of Also I had a followup question, I see a few uses of |
Eh, doesn't sound good, makes much more sense now to keep emitted operations as is.
Nope. I think |
This patch folds
stablehlo.transpose
operation with constant operand intostablehlo.constant
.I have considered doing this by iterating over source index space, i.e.
but that requires preinitialization of result vector with some value, which is twice as slow on simple case: