Support tensor.pad in the layout pipeline - #3221
Open
copybara-service[bot] wants to merge 1 commit into
Open
Conversation
copybara-service
Bot
force-pushed
the
test_949162359
branch
from
July 21, 2026 17:29
6cab8d5 to
ca98c5b
Compare
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
copybara-service
Bot
force-pushed
the
test_949162359
branch
from
July 21, 2026 21:00
ca98c5b to
29e01f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.