[Mosaic] Allow padding in small tiling row shuffle reshape. #33262
+105
−48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Mosaic] Allow padding in small tiling row shuffle reshape.
We just need to make sure shape aligns to vreg-slice lane dim and only last vreg contains padding on tiled dims.
Examples:
1: Reshape vector<10x128xi32> to vector<5x256xi32> can use the row shuffle reshape routine by inferring in tiling = (8, 128) and out tiling = (4, 128) because 1) vregs are still one-to-one mapping, ensured by vreg-slice lane aligned, and 2) only last vreg in tiled dims are padded, ensured by #elements are the same in tiled dims.
2: Reshape vector<16x512x56x128xbf16> to vector<16x512x7168xbf16> can use in tiling = (16, 128) and out tiling = (1, 256) and make it no-op.