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

[CPU] Remove unnecessary factors from getMaxVectorTileSize. #15843

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

hanhanW
Copy link
Contributor

@hanhanW hanhanW commented Dec 7, 2023

There is no lower_bound and upper_bound context in vector tile size. We should just use the number of elements factor. It removes lb and ub; it asks users to provide the number of elements directly.

It also removes allowIncomplteTile because this factor should already be modeld by enforcePowerOfTwo.

There is no lower_bound and upper_bound context in vector tile size. We
should just use the number of elements factor. It removes `lb` and `ub`;
it asks users to provide the number of elements directly.

It also removes `allowIncomplteTile` because this factor should already
be modeld by `enforcePowerOfTwo`.
@hanhanW hanhanW added benchmarks:x86_64 Run default x86_64 benchmarks benchmarks:android-cpu Run default Android CPU benchmarks labels Dec 8, 2023
@hanhanW hanhanW marked this pull request as ready for review December 9, 2023 00:21
@hanhanW hanhanW requested a review from pzread December 9, 2023 00:21
@hanhanW
Copy link
Contributor Author

hanhanW commented Dec 9, 2023

I want to claim this as an NFC but I remove the logics about allowIncomplteTile. I think it is legacy code because they are copied from getMaxDistributionTileSize: c00e8b9

We likely don't hit the branch when computing vector sizes, so it does not impact any lit tests and benchmark results. It looks like a good cleanup to me. @dcaballe what do you think?

@@ -854,9 +838,6 @@ static LogicalResult setMatmulNoPadRootConfig(
const SmallVectorImpl<bool> &vecScalableDims = inputScalableTileFlags.back();
SmallVector<int64_t> parallelTileSizes;
SmallVector<bool> parallelScalableFlags;
bool allowIncompleteTile =
vecPreProcStrategy == VectorPreProcStrategy::Peeling ||
vecPreProcStrategy == VectorPreProcStrategy::Masking;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to assert if the strategy is not one of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is okay because all the matmul strategy is using peeling or masking. At least it is the case for targets we've been actively working on.

Copy link
Contributor

@dcaballe dcaballe left a comment

Choose a reason for hiding this comment

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

SG, thanks!

@hanhanW hanhanW merged commit 2529fb3 into iree-org:main Dec 12, 2023
63 of 70 checks passed
@hanhanW hanhanW deleted the clean-get-max-vector-size branch December 12, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks:android-cpu Run default Android CPU benchmarks benchmarks:x86_64 Run default x86_64 benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants