-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[mlir]Add a check to ensure bailing out when reducing to a scalar #129694
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
…calar, as ExtractStridedSliceOp does not support handling scalars
@llvm/pr-subscribers-mlir-vector @llvm/pr-subscribers-mlir Author: Prakhar Dixit (Prakhar-Dixit) ChangesFixes issue #64075 Minimal example crashing :
Full diff: https://github.com/llvm/llvm-project/pull/129694.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
index 08ba972b12ce6..f519484fd56c8 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
@@ -355,6 +355,11 @@ struct UnrollMultiReductionPattern
LogicalResult matchAndRewrite(vector::MultiDimReductionOp reductionOp,
PatternRewriter &rewriter) const override {
+ auto resultType = reductionOp->getResult(0).getType();
+ if (mlir::isa<mlir::FloatType>(resultType) ||
+ mlir::isa<mlir::IntegerType>(resultType)) {
+ return failure();
+ }
std::optional<SmallVector<int64_t>> targetShape =
getTargetShape(options, reductionOp);
if (!targetShape)
|
Thanks, this fix makes sense to me!
From what I can tell, this is simply making sure that we are not unrolling scalars. Not sure how we missed that. Note, in your comment you refer to
Please add as a test. |
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.
Thanks for the updates!
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.
LGTM, thanks!
I don't have merge access. Could you guys please merge it for me? |
@Prakhar-Dixit , from what I can tell, you still haven't configured your e-mail address: |
Oh, thanks for reminding me! I made it public. |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/55/builds/8125 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/6644 Here is the relevant piece of the build log for the reference
|
Fixes issue #64075
Referencing this comment for more detailed view -> #64075 (comment)
Minimal example crashing :