-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[mlir][tosa] Fix ability to expand ranks with dynamic shape support #128037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-mlir-tosa @llvm/pr-subscribers-mlir Author: Jerry-Ge (Jerry-Ge) ChangesFix ability to expand ranks with dynamic shape support Full diff: https://github.com/llvm/llvm-project/pull/128037.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp b/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
index d1a8732dac212..9ade05c8f095b 100644
--- a/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
+++ b/mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
@@ -88,9 +88,9 @@ computeReshapeOutput(ArrayRef<int64_t> higherRankShape,
higherRankDim = higherRankShape[i];
lowerRankDim = lowerRankShape[j];
- if (lowerRankDim == 1 && higherRankDim > 1)
+ if (lowerRankDim == 1 && higherRankDim != 1)
reshapeOutputShape[i] = 1;
- else if ((lowerRankDim > 1 && higherRankDim == 1) ||
+ else if ((lowerRankDim != 1 && higherRankDim == 1) ||
(lowerRankDim == higherRankDim))
reshapeOutputShape[i] = lowerRankDim;
else if (higherRankDim != lowerRankDim)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to test this change at all?
good question, i don't have a clear answer. CC the original author: @sjarus |
9f7d82f
to
16462f4
Compare
- The use of != 1 accommodates the use of kDynamicDim - Simplified the for loop to iterate only on lowerRank and access the higherRank dim by using the rankDiff Signed-off-by: Suraj Sudhir <[email protected]> Change-Id: I0f223f335667b2e32c43d4370f0a4b11b0617694
16462f4
to
72b7eaf
Compare
…port to tosa_arm_internal This patch merges down upstream review changes into mltech/tosa_arm_internal branch. Upstream Github patch: llvm#128037 - The use of != 1 accommodates the use of kDynamicDim - Simplified the for loop to iterate only on lowerRank and access the higherRank dim by using the rankDiff Signed-off-by: Suraj Sudhir <[email protected]> Change-Id: Ia011099171b0965d5deeb06645e8d3731f980915
Uh oh!
There was an error while loading. Please reload this page.