Repository navigation
Add a pass to initialize all remaining empty tensors to zero-filled tensors - #8749
Merged
MaheshRavishankar merged 1 commit intoApr 5, 2022
Merged
Conversation
Collaborator
Author
|
@benvanik https://github.com/google/iree/blob/main/iree/compiler/Translation/test/streams.mlir test fails with this pass. Any pointers as to how to fix that? (or why it is failing?) |
benvanik
reviewed
Apr 2, 2022
| } | ||
| Value value = | ||
| rewriter.create<arith::ConstantOp>(loc, elementType, zero.getValue()); | ||
| rewriter.replaceOpWithNewOp<TensorSplatOp>(initTensorOp, resultType, value, |
Collaborator
There was a problem hiding this comment.
the splat only takes dynamic sizes, not all sizes - maybe that's the failure in the streams.mlir? (it has dynamic shapes)
MaheshRavishankar
force-pushed
the
init_empty_tensors
branch
from
April 4, 2022 20:20
4af9d56 to
c9d1676
Compare
…ensors. After dispatch region formation, all remaining `linalg.init_tensor` ops are converted to `flow.tensor.splat` ops as a fallback. Ideally this should never happen and all `linalg.init_tensor` get fused with their uses. But in cases where a front-end generates code where the `init_tensor` escapes, this provides a safety net for it. The code is still correct, but potentially uses more memory and is slower. Fixes iree-org#8717
MaheshRavishankar
force-pushed
the
init_empty_tensors
branch
from
April 5, 2022 16:55
c9d1676 to
de1523c
Compare
benvanik
approved these changes
Apr 5, 2022
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.
After dispatch region formation, all remaining
linalg.init_tensorops are converted to
flow.tensor.splatops as a fallback. Ideallythis should never happen and all
linalg.init_tensorget fused withtheir uses. But in cases where a front-end generates code where the
init_tensorescapes, this provides a safety net for it. The code isstill correct, but potentially uses more memory and is slower.
Fixes #8717