-
Notifications
You must be signed in to change notification settings - Fork 639
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
[CPU] Limit unrolling factors for generic ops. #17227
Conversation
Abbreviated Benchmark Summary@ commit 778787188503d0505ada631a1b3416f81aa16971 (no previous benchmark results to compare) Data-Tiling Comparison TableClick to show
Raw Latencies
[Top 3 out of 128 results showed] No improved or regressed compilation metrics 🏖️ For more information: |
return false; | ||
} | ||
|
||
// Check that the two indexing maps are a permutation of each other. |
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.
The code seems to implement Both indexing maps are permutations, and exactly one of them is the identity
. What does this comment mean by "are a permutation of each other" ?
Also, this condition could be simplified to m0.isPermutation() && m1.isPermutation() && (m0.isIdentity() ^ m1.isIdentity())
.
What role is played by the separate checks for isEmpty
?
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.
As same as above response, the code is quite old. I can help update it either in the PR or in a follow-up. isEmpty()
is the check for scalars. We don't need the specialized transpose lowering when they are scalars.
@@ -325,21 +353,33 @@ getMinTilingSizesForEachDim(mlir::FunctionOpInterface entryPointFn, | |||
|
|||
// Limit unroll factor. For now, we assume the rightmost non-one tiled | |||
// dimension is for vectorization and any other non-one dimension is for | |||
// unrolling. | |||
// unrolling. The util limits the second rightmost non-one tiled dimension |
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.
What is "the util" ?
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 meant the lambda function, let me update the comment.
/// Returns true if the operation is a GenericOp implementing a supported | ||
/// transposition. |
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 was curious what "a supported transposition" means: supported in what sense?
Looking at how this function is used, it seems to mean "is defaultMaxTransposeUnrollFactor
should be used instead of defaultMaxUnrollFactor
for this op".
If I get that right, I would suggest that this relatively minor nuance --- just which numeric threshold value is used in some logic, not a fundamental switch of what logic is applied to the op --- is not what a reader of this comment would guess from reading the above comment, which suggests a major difference instead ("supported" vs... "not supported" ? which sounds scary).
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.
This is sort of precondition for transpose op lowering. We have specialized codegen for transpose ops on x86 path. It only supports n-D transpose with single input and single output. Here I'm just moving the code from below to here, but I can update the comment and and rename it to x86TransposeLoweringPrecondition
. What do you think?
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.
SG!
The revision also deprecates an outdated lit test that is impacted by it. It adds the other lit test simplified from the iree-org#16993 Fixes iree-org#16993 Signed-off-by: Lubo Litchev <lubol@google.com>
The revision also deprecates an outdated lit test that is impacted by it. It adds the other lit test simplified from the #16993
Fixes #16993