Skip to content

Conversation

@copybara-service
Copy link

@copybara-service copybara-service bot commented Nov 11, 2025

[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.

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.
PiperOrigin-RevId: 831053083
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.

2 participants