Open axeabc opened 2 months ago
This is happening because the IR contains multile dynamic dims for the "tensor.expand_shape"
0th and the 2nd dimension both are dynamic for the same re-association group. So the transform doesnt understand how to distribute the data. I also have my ownd doubt about the semantic validity of this IR. For example, if the input shape is 3x4x2, then the collapsed shape will be 24. Then you are dividing it by 9, which will give you the quotient as 2. Then you are trying to expand it as <2x3x24>, which will exceed the original number of elements.
This is happening because the IR contains multile dynamic dims for the "tensor.expand_shape"
0th and the 2nd dimension both are dynamic for the same re-association group. So the transform doesnt understand how to distribute the data. I also have my ownd doubt about the semantic validity of this IR. For example, if the input shape is 3x4x2, then the collapsed shape will be 24. Then you are dividing it by 9, which will give you the quotient as 2. Then you are trying to expand it as <2x3x24>, which will exceed the original number of elements.
Thank you for your explanation. This IR is randomly generated via certain fuzzing technique, so it might have a semantic problem. It's a better practice to report an error rather than crash for mlir-opt?
https://github.com/llvm/llvm-project/blob/8e0daabe97cf5e73402bcb4c3e54b3583199ba8f/mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp#L2306-L2318 Can the assertion be changed to an error here?
git version: c3d3cef8d5837
system:
Ubuntu 18.04.6 LTS
reproduce with:
mlir-opt -one-shot-bufferize a.mlir
a.mlir:
stack trace: