Repository navigation
Add more patterns to lower to flow.tensor ops - #5576
Merged
MaheshRavishankar merged 7 commits intoApr 27, 2021
Merged
Conversation
Collaborator
Author
|
I am looking into if |
Collaborator
Author
|
@antiagainst @hanhanW for the benfit of these to really kick in, I need some patterns upstream, but if I add those patterns first, it will fail in IREE. So these adds the code paths to not fail when those patterns are used. After they make their way in, we might be able to get some improvement here. |
hanhanW
approved these changes
Apr 26, 2021
antiagainst
approved these changes
Apr 26, 2021
MaheshRavishankar
force-pushed
the
subtensor_insert_to_flow
branch
from
April 26, 2021 19:47
c8ab6c5 to
62887ec
Compare
added 7 commits
April 26, 2021 16:15
Inlining reshapes into dispatch regions cause subtle issues. The `subtensor` -> `tensor_reshape` pattern causes issues during bufferization. To avoid this two approaches are possible 1) Fuse reshapes with other operations as much as possible during fusion on linalg ops. 2) Lower reshapes to `flow.tensor.reshape` before dispatch region creation.
When the slice of the subtensor update is contiguous in memory, the subtensor_insert can be lowered to a flow.tensor.update.
MaheshRavishankar
force-pushed
the
subtensor_insert_to_flow
branch
from
April 26, 2021 23:15
50c4e80 to
717ae8e
Compare
Merged
ThomasRaoux
pushed a commit
to ThomasRaoux/iree
that referenced
this pull request
Apr 27, 2021
The following operations can be lowered to flow.tensor. ops. linalg.tensor_reshape -> flow.tensor.reshape : Once all reshapes can be folded away, the remaining reshapes only exist at the boundaries of dispatch regions. These are better off converted to flow.tensor.reshape so that they could become no-ops when lowered to the hal layer. subtensor -> flow.tensor.slice. A subtensor operation can be lowered to a flow.tensor.slice operation in some cases. This can become a no-op in many cases. subtensor_insert -> flow.tensor.update. A subtensor_insert operation can be lowered to a flow.tensor.update operation which will allow for doign in-place updates. This will eliminate some dispatch regions that do not need to be created.
This was referenced Apr 27, 2021
Closed
Closed
simon-camp
pushed a commit
to simon-camp/iree
that referenced
this pull request
Apr 29, 2021
The following operations can be lowered to flow.tensor. ops. linalg.tensor_reshape -> flow.tensor.reshape : Once all reshapes can be folded away, the remaining reshapes only exist at the boundaries of dispatch regions. These are better off converted to flow.tensor.reshape so that they could become no-ops when lowered to the hal layer. subtensor -> flow.tensor.slice. A subtensor operation can be lowered to a flow.tensor.slice operation in some cases. This can become a no-op in many cases. subtensor_insert -> flow.tensor.update. A subtensor_insert operation can be lowered to a flow.tensor.update operation which will allow for doign in-place updates. This will eliminate some dispatch regions that do not need to be created.
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.
The following operations can be lowered to
flow.tensor.ops.linalg.tensor_reshape->flow.tensor.reshape: Once all reshapes can be folded away, the remaining reshapes only exist at the boundaries of dispatch regions. These are better off converted toflow.tensor.reshapeso that they could become no-ops when lowered to thehallayer.subtensor->flow.tensor.slice. Asubtensoroperation can be lowered to aflow.tensor.sliceoperation in some cases. This can become a no-op in many cases.subtensor_insert->flow.tensor.update. Asubtensor_insertoperation can be lowered to aflow.tensor.updateoperation which will allow for doign in-place updates.This will eliminate some dispatch regions that do not need to be created.