Skip to content

[CPU] Teach TilingConfig::getVectorTileSizes about CPU lowering config. - #21397

Merged
hanhanW merged 2 commits into
iree-org:mainfrom
hanhanW:vectorization-vector-inference
Jul 17, 2025
Merged

hanhanW merged 2 commits into
iree-org:mainfrom
hanhanW:vectorization-vector-inference

Conversation

@hanhanW

@hanhanW hanhanW commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

The revision updates the static constructor with unique_ptr because there are invalid states. E.g., the config does not recognize GPU lowering config and different structured Codegen lowering configs. In this context, we prefer factory functions to initializer methods. See https://abseil.io/tips/42 for more details.

Furthermore, it updates the logic of getVectorTileSizes, which uses the mapping level index to get the right list. Ideally, we can implement an interface method for all the specific lowering config, but we still need the generic lowering config being able to handle the case. Thus, we only update TilingConfig logic now, and we will do the interface way later.

The revision updates the static construct with unique_ptr because there
are invalid states. E.g., the config does not recognize GPU lowering
config and different structured Codegen lowering config. In this
context, we prefer factory functions to initializer methods. See
https://abseil.io/tips/42 for more details.

Furthermore, it updates the logic of getVectorTileSizes, which uses the
mapping level index to get the right list.

Signed-off-by: hanhanW <[email protected]>

@jtuyls jtuyls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

? loweringConfig.getStaticTilingLevelSizes(0, /*target=*/nullptr)
.size()
: 0;
for (auto level : tilingLevelToActualLevelMap) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
for (auto level : tilingLevelToActualLevelMap) {
for (unsigned level : tilingLevelToActualLevelMap) {

@banach-space banach-space left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks!

Signed-off-by: hanhanW <[email protected]>
@hanhanW
hanhanW enabled auto-merge (squash) July 17, 2025 16:32
@hanhanW
hanhanW merged commit 3f52423 into iree-org:main Jul 17, 2025
@hanhanW
hanhanW deleted the vectorization-vector-inference branch July 17, 2025 17:20
IanWood1 pushed a commit to IanWood1/iree that referenced this pull request Jul 18, 2025
…g. (iree-org#21397)

The revision updates the static constructor with unique_ptr because
there are invalid states. E.g., the config does not recognize GPU
lowering config and different structured Codegen lowering configs. In
this context, we prefer factory functions to initializer methods. See
https://abseil.io/tips/42 for more details.

Furthermore, it updates the logic of `getVectorTileSizes`, which uses
the mapping level index to get the right list. Ideally, we can implement
an interface method for all the specific lowering config, but we still
need the generic lowering config being able to handle the case. Thus, we
only update `TilingConfig` logic now, and we will do the interface way
later.

---------

Signed-off-by: hanhanW <[email protected]>
AWoloszyn pushed a commit that referenced this pull request Dec 1, 2025
…g. (#21397)

The revision updates the static constructor with unique_ptr because
there are invalid states. E.g., the config does not recognize GPU
lowering config and different structured Codegen lowering configs. In
this context, we prefer factory functions to initializer methods. See
https://abseil.io/tips/42 for more details.

Furthermore, it updates the logic of `getVectorTileSizes`, which uses
the mapping level index to get the right list. Ideally, we can implement
an interface method for all the specific lowering config, but we still
need the generic lowering config being able to handle the case. Thus, we
only update `TilingConfig` logic now, and we will do the interface way
later.

---------

Signed-off-by: hanhanW <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants