add support for tensor.insert_slice in layout optimization#2335
Merged
copybara-service[bot] merged 1 commit intomainfrom Oct 24, 2025
Merged
add support for tensor.insert_slice in layout optimization#2335copybara-service[bot] merged 1 commit intomainfrom
copybara-service[bot] merged 1 commit intomainfrom
Conversation
f7c48f4 to
1e3ecbb
Compare
f0a5aa5 to
df0f5dc
Compare
This PR adds the following * layout-propagation: Rectify the slice layout with the destination operand of the tensor.insert_slice and then propagate the destination layout to the result layout * layout-optimization: Treat tensor.insert_slice as a LayoutHoistingOpInterface and allow hoisting convert_layout operations through insert_slice by updating the destination operand layout * convert-to-ciphertext-semantics: This lowers tensor.insert_slice, by first remapping the input to be compatible with the destination layout (by composing the relation from the insert slice with the destination layout) and then masking / mul / adding each ciphertext of the result and inserting into a result tensor FIXMEs left: * Some assertions about the slice strides * convert-to-ciphertext-semantics was updated to optimize layouts in a forward pass for any ops that change layouts but that's only for insert slice so it feels like a special case right now and I want to clean that mess up. PiperOrigin-RevId: 823679451
df0f5dc to
8b52080
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.
add support for tensor.insert_slice in layout optimization
This PR adds the following
FIXMEs left: