Skip to content

Update semantics of linalg_ext.reverse. - #7155

Merged
hanhanW merged 3 commits into
iree-org:mainfrom
hanhanW:rev1
Sep 23, 2021
Merged

hanhanW merged 3 commits into
iree-org:mainfrom
hanhanW:rev1

Conversation

@hanhanW

@hanhanW hanhanW commented Sep 23, 2021

Copy link
Copy Markdown
Contributor
  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 to 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.

This PR also adds e2e tests for the op.

It is a step toward #5045

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
hanhanW merged commit 2e49e5e into iree-org:main Sep 23, 2021
@hanhanW
hanhanW deleted the rev1 branch September 23, 2021 22:32
@rsuderman rsuderman mentioned this pull request Sep 24, 2021
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