I'm opening an issue regarding a bug found in IREE: iree-org/iree#24265
The problematic code is here:
https://github.com/iree-org/torch-mlir/blob/d2768f876d3cc16019dc1b3eb567c7f339935439/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp#L2830
The intention is to reduce starting from the last axis, which is why the code sorts the dimensions in descending order. However, when -1 is used (representing the last dimension), the sorting becomes incorrect when there are other axes in our set.
To fix this, the dimensions should be converted with toPositiveDim before sorting and entering loop.
I'm opening an issue regarding a bug found in IREE: iree-org/iree#24265
The problematic code is here:
https://github.com/iree-org/torch-mlir/blob/d2768f876d3cc16019dc1b3eb567c7f339935439/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp#L2830
The intention is to reduce starting from the last axis, which is why the code sorts the dimensions in descending order. However, when -1 is used (representing the last dimension), the sorting becomes incorrect when there are other axes in our set.
To fix this, the dimensions should be converted with toPositiveDim before sorting and entering loop.