Repository navigation
Closed
Description
I hit a crash in a compilation after integrates. I think there are some bugs related to multiple outputs in the pass.
To repro:
#map0 = affine_map<(d0, d1) -> (d1)>
#map1 = affine_map<(d0, d1) -> (d0, d1)>
module {
func.func @foo(%arg0: tensor<512xf32>, %arg1: tensor<512xf32>, %arg2: tensor<512xf32>, %arg3: tensor<200x512xf32>) -> tensor<25x8x1x512xf32> {
%0:2 = linalg.generic {
indexing_maps = [#map0, #map0, #map0, #map1],
iterator_types = ["parallel", "parallel"]
}
ins(%arg0, %arg1 : tensor<512xf32>, tensor<512xf32>)
outs(%arg2, %arg3 : tensor<512xf32>, tensor<200x512xf32>) {
^bb0(%arg4: f32, %arg5: f32, %arg6: f32, %arg7: f32):
%2 = arith.addf %arg4, %arg5 : f32
linalg.yield %2, %2 : f32, f32
} -> (tensor<512xf32>, tensor<200x512xf32>)
%1 = tensor.expand_shape %0#1 [[0, 1, 2], [3]] : tensor<200x512xf32> into tensor<25x8x1x512xf32>
return %1 : tensor<25x8x1x512xf32>
}
}Run: iree-opt --iree-flow-fusion-of-tensor-ops repro.mlir
log:
iree/third_party/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1162: ReferenceT llvm::detail::indexed_accessor_range_base<mlir:
:TypeRange, llvm::PointerUnion<const mlir::Value *, const mlir::Type *, mlir::OpOperand *, mlir::detail::OpResultImpl *>, mlir::Type, mlir::Type, mlir::Type>::operator[](size_t) const [D
erivedT = mlir::TypeRange, BaseT = llvm::PointerUnion<const mlir::Value *, const mlir::Type *, mlir::OpOperand *, mlir::detail::OpResultImpl *>, T = mlir::Type, PointerT = mlir::Type, Re
ferenceT = mlir::Type]: Assertion `Index < size() && "invalid index for value range"' failed.
...
third_party/llvm-project/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp:797
It's crash at here which triggers an out-of-bound access.
@MaheshRavishankar it seems like there is a bug in https://reviews.llvm.org/D132301
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
MaheshRavishankar commentedon Aug 24, 2022
Oh, will look into it soon. Thanks for reporting!
allieculp commentedon Aug 24, 2022
Marking as P1, please downgrade if needed!
MaheshRavishankar commentedon Aug 25, 2022
Fixed by https://reviews.llvm.org/D132631
MaheshRavishankar commentedon Aug 25, 2022
Will close it after cherry-picking it into IREE.
Cherry pick llvm/llvm-project@71604f4 (#10207)
Squashed commit of the following: