Issue 87396
Summary TosaToTensor regression from #85798
Labels regression
Assignees sabauma, sjarus, rafaelubalmw
Reporter bjacob
    The following test starts failing as of #85798, with a failing assertion introduced in that PR, and passes when it is reverted:

```mlir
 func.func @mlp_invocation(%lhs: tensor<2x4xf32>, %rhs : tensor<4x8xf32>) -> tensor<2x8xf32> {
    %lhs_3D = tosa.reshape %lhs {new_shape = array<i64 : 1, 2, 2>} : (tensor<2x4xf32>) -> tensor<1x2x4xf32>
    %rhs_3D = tosa.reshape %rhs {new_shape = array<i64 : 1, 2, 2>} : (tensor<4x8xf32>) -> tensor<1x4x8xf32>
    %0 = tosa.matmul %lhs_3D, %rhs_3D : (tensor<1x2x4xf32>, tensor<1x4x8xf32>) -> tensor<1x2x8xf32>
    %1 = tosa.clamp %0 {
        min_int = 0 : i64, max_int = 9223372036854775807 : i64,
        min_fp = 0.0 : f32, max_fp = 3.4028235e+38 : f32}
 : (tensor<1x2x8xf32>) -> tensor<1x2x8xf32>
    %2 = tosa.negate %1 : (tensor<1x2x8xf32>) -> tensor<1x2x8xf32>
    %3 = tosa.reshape %2 {new_shape = array<i64 : 2, 2>}  : (tensor<1x2x8xf32>) -> tensor<2x8xf32>
 return %3 : tensor<2x8xf32>
 }
```

Run:

```
mlir-opt --tosa-to-tensor /tmp/a.mlir
```

Result:

```
mlir-opt: /home/benoit/megabump/work/iree/third_party/llvm-project/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp:196: SmallVector<ReassociationExprs> (anonymous namespace)::createReassociationMapForCollapse(OpBuilder &, Type, Type): Assertion `currSrcDim == srcShape.size() && currDstDim == dstShape.size()' failed.
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to