Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[NFC] Add StrategyTilingLevel enum class to clear tiling level meaning.#8633

Merged
hanhanW merged 3 commits into
iree-org:mainfrom
hanhanW:rename
Mar 25, 2022
Merged

[NFC] Add StrategyTilingLevel enum class to clear tiling level meaning.#8633
hanhanW merged 3 commits into
iree-org:mainfrom
hanhanW:rename

Conversation

@hanhanW
Copy link
Copy Markdown
Contributor

@hanhanW hanhanW commented Mar 24, 2022

The codegen used to use TilingLevel::L1Tiles and
TilingLevel::VectorTiles. This is confusing in strategy approach because
they are not targeting tiling sizes for L1 and vector. They are actually
the tiling sizes for parallel dims and reduction dims. Correct the
variable name to make confusion less.

The codegen used to use TilingLevel::L1Tiles and
TilingLevel::VectorTiles. This is confusing in strategy approach because
they are not targeting tiling sizes for L1 and vector. They are actually
the tiling sizes for parallel dims and reduction dims. Correct the
variable name to make confusion less.
Copy link
Copy Markdown
Collaborator

@MaheshRavishankar MaheshRavishankar left a comment

Choose a reason for hiding this comment

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

Looks good. Just one comment, stamping anyway

NumTileLevels = 3
};

enum class StrategyTilingLevel : unsigned {
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.

Doesnt that replace the TilingLevel class above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The TilingLevel is still used in ARM CPU pipeline. I think it's still meaningful for mmt4d and CPUTileFuseAndVectorize approach.

@hanhanW hanhanW enabled auto-merge (squash) March 24, 2022 21:23
@dcaballe
Copy link
Copy Markdown
Contributor

LGTM! Just missing a bit of context: the implementation seems to imply that the last dimension will always be a reduction. Is that always the case?

@hanhanW
Copy link
Copy Markdown
Contributor Author

hanhanW commented Mar 24, 2022

LGTM! Just missing a bit of context: the implementation seems to imply that the last dimension will always be a reduction. Is that always the case?

I don't follow the question. Do you mean the last enum value (i.e., ReductionTiles)? The enum class provides the meaning of each tiling sizes. The last dimension of the loop can be a parallel loop. E.g., say that we have a 2D element-wise op. A valid configuration could be [[64, 64], [32, 32], [0, 0]].

@hanhanW hanhanW disabled auto-merge March 24, 2022 22:52
@MaheshRavishankar
Copy link
Copy Markdown
Collaborator

LGTM! Just missing a bit of context: the implementation seems to imply that the last dimension will always be a reduction. Is that always the case?

I don't follow the question. Do you mean the last enum value (i.e., ReductionTiles)? The enum class provides the meaning of each tiling sizes. The last dimension of the loop can be a parallel loop. E.g., say that we have a 2D element-wise op. A valid configuration could be [[64, 64], [32, 32], [0, 0]].

To provide some context, The tile sizes that are decided go hand-in hand with the pipeline used. The pipeline might use these values in any way. So there is no set meaning in the attribute itself. It just carries the payload to be used later on during code-generation. The enums added here provide that meaning. First level is for distribution to workgroups, second level is for next level tile + fuse that can only tile the parallel loops, and finally the tiling for the reduction loops.

@dcaballe
Copy link
Copy Markdown
Contributor

Thanks for the clarifications! It makes sense to me now!

@hanhanW hanhanW merged commit cbea6b2 into iree-org:main Mar 25, 2022
@hanhanW hanhanW deleted the rename branch March 25, 2022 06:24
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