Repository navigation
Update semantics of linalg_ext.reverse. - #7155
Merged
Merged
Conversation
1. Allow the op takes multiple reverse dimensions. 2. Update the loop bound of reverse dim with the whole size. Re (2), it is required because of tiling interface. The current tiling interface expects the implmenetation returned a tiled op. However, two tiled ops are required in the previous definition. E.g., say that we have `M` tiles in total. [T_1], [T_2], ... , [T_M] The result of `T_1` will be stored to the position of `T_M`, and vise versa. If we iterate only half of the tensor, we need create reversed `T_1` and reversed `T_M`, then store them to corresponding offsets. In this context, two tiled op are created, but only one can be returned. The updated semantic also meets the current lowering, instead of emitting the affine maps into the op itself.
hanhanW
requested review from
MaheshRavishankar,
antiagainst and
asaadaldien
September 23, 2021 21:11
MaheshRavishankar
approved these changes
Sep 23, 2021
Merged
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.
Re (2), it is required because of tiling interface. The current tiling
interface expects the implmenetation returned a tiled op. However, two
tiled ops are required in the previous definition. E.g., say that we
have
Mtiles in total.[T_1], [T_2], ... , [T_M]
The result of
T_1will be stored to the position ofT_M, and viseversa. If we iterate only half of the tensor, we need to create reversed
T_1and reversedT_M, then store them to corresponding offsets. Inthis context, two tiled op are created, but only one can be returned.
The updated semantic also meets the current lowering, instead of
emitting the affine maps into the op itself.
This PR also adds e2e tests for the op.
It is a step toward #5045