[mlir][sparse] fix performance bug in matmul with a sparse rhs due to suboptimal iteration graphs.
While dense tensors support random accesses, it is critical to visit them in a row-major order for better cache locality. However, we previously consider dense inputs and outputs together when computing constraints for building iteration graph, it could lead us to less efficient iteration graphs. This patch adds a new `SortMask::kIncludeDenseInput` to treat dense inputs/outputs separately when building iteration graph, thus increasing the chance for use to construct a better iteration graph. A more fine-grained approach is to treat each input separately. Note, related to: https://github.com/llvm/llvm-project/issues/51651 Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D144932
Loading
Please sign in to comment