-
Notifications
You must be signed in to change notification settings - Fork 653
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 preprocessing TransposeExtractConcat pass #17692
Conversation
f256330
to
50d192f
Compare
compiler/src/iree/compiler/Preprocessing/Common/TransposeExtractConcat.cpp
Show resolved
Hide resolved
rewriter, genericOp.getDpsInitOperand(0)->get(), perm); | ||
SmallVector<Value> newOperands(genericOp.getOperands()); | ||
newOperands.back() = newInit; | ||
auto newGenericOp = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected that you have to transpose the operands as well? I am actually confused why you even need to do a transpose or anything here... you should be able to just clone the operation as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the naming for the function createTransposedInit
wasn't good. Its not transposing anything but rather creating an empty tensor of the same shape as the new. The idea is that there is a long chain of unary elementwise generic ops and when the tensor.extract_slice
op gets transposed, the corresponding child linalg generic's operand type is updated but not the dps init operand.
e.g.
generic with ins(tensor<1024x2>) outs(tensor<1024x2>)
then, after changing transposing extract slice ins and outs don't match:
generic with ins(tensor<2x1024>) outs(tensor<1024x2>)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets try to find time today to walk through this a bit.
compiler/src/iree/compiler/Preprocessing/Common/TransposeExtractConcat.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Ian Wood <ianwood2024@u.northwestern.edu>
Talked with Mahesh yesterday about this. Notes:
|
nod-ai/SHARK-ModelDev#683