Skip to content

Support tensor.pad in the layout pipeline - #3221

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_949162359
Open

Support tensor.pad in the layout pipeline#3221
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_949162359

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Support tensor.pad in the layout pipeline

This change adds support for a tensor.pad op in the layout pipeline. By default, tensor.pad lowers with no overhead: it just materializes as a change to the layout descriptor (precomposing the layout relation with a "padded to unpadded" relation), and if downstream kernels are compatible, no explicit layout conversion is needed. For ops where they are needed, layout-propagation will ensure a layout conversion is inserted, and that layout conversion will incorporate the padding as well. The problem is that this layout_conversion step will be slow.

This change adds support for a tensor.pad op in the layout pipeline. By default, tensor.pad lowers with no overhead: it just materializes as a change to the layout descriptor (precomposing the layout relation with a "padded to unpadded" relation), and if downstream kernels are compatible, no explicit layout conversion is needed. For ops where they are needed, layout-propagation will ensure a layout conversion is inserted, and that layout conversion will incorporate the padding as well. The problem is that this layout_conversion step will be slow.

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

1 participant