Repository navigation
[VectorLayout] Fix insertion of new constOp for non dominate issue. - #18894
Merged
Merged
Conversation
Main motivation of this patch is to resolve issue where we have the same
constOp being used by multiple operations.
But with a twist where first time the constOp needs a layout is on a op
that topologically comes after other ops that use constOp. This will
generate a copy of constOp in the location right before the latter op,
which is problematic because this constOp will be used by other ops
before it.
Previously for the test added we get this error:
```
within split at contraction_layout.mlir:1 offset :24:10: note: see current operation: %9 = "arith.addf"(%8, %6) <{fastmath = #arith.fastmath<none>}> : (vector<96x64xf16>, vector<96x64xf16>) -> vector<96x64xf16>
within split at contraction_layout.mlir:1 offset :22:19: error: operand #1 does not dominate this use
%scaled_rhs = arith.mulf %read_1, %cst_1 : vector<96x64xf16>
```
While minor, this is also problematic because this error seem to stopped
layout analysis (but not fatally) S.T it fails to vector distribute in
some cases, making it hard to debug.
Signed-off-by: Stanley Winata <[email protected]>
raikonenfnu
requested review from
antiagainst,
hanhanW and
qedawkins
as code owners
October 24, 2024 22:32
Collaborator
Author
|
Was quite tricky to debug since I thought it was related to layout analysis visitOperations mechanisms, but hopefully now This PR should fix: #18876 :) (P.S seems like this was caused after an LLVM bump. I feel clone + replaceAllUses used to guarantee domination, but doesn't seem like it anymore) |
qedawkins
approved these changes
Oct 24, 2024
nirvedhmeshram
approved these changes
Oct 24, 2024
Eliasj42
pushed a commit
that referenced
this pull request
Oct 31, 2024
…18894) Main motivation of this patch is to resolve issue where we have the same constOp being used by multiple operations. But with a twist where first time the constOp needs a layout is on a op that topologically comes after other ops that use constOp. This will generate a copy of constOp in the location right before the latter op, which is problematic because this constOp will be used by other ops before it. Previously for the test added we get this error: ``` within split at contraction_layout.mlir:1 offset :24:10: note: see current operation: %9 = "arith.addf"(%8, %6) <{fastmath = #arith.fastmath<none>}> : (vector<96x64xf16>, vector<96x64xf16>) -> vector<96x64xf16> within split at contraction_layout.mlir:1 offset :22:19: error: operand #1 does not dominate this use %scaled_rhs = arith.mulf %read_1, %cst_1 : vector<96x64xf16> ``` While minor, this is also problematic because this error seem to stopped layout analysis (but not fatally) S.T it fails to vector distribute in some cases, making it hard to debug. Signed-off-by: Stanley Winata <[email protected]> Signed-off-by: Elias Joseph <[email protected]>
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.
Main motivation of this patch is to resolve issue where we have the same constOp being used by multiple operations.
But with a twist where first time the constOp needs a layout is on a op that topologically comes after other ops that use constOp. This will generate a copy of constOp in the location right before the latter op, which is problematic because this constOp will be used by other ops before it.
Previously for the test added we get this error:
While minor, this is also problematic because this error seem to stopped layout analysis (but not fatally) S.T it fails to vector distribute in some cases, making it hard to debug.