The check here was stricter than necessary, we just want all the
parallel dims to go to one side and all reduction dims to go to the
other.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The original code is wrong when the case is outer-reductions. Instead, it should check that
!useInnerDimsForReduction && (parallelDims == llvm::to_vector<4>(llvm::seq<int64_t>(reductionDims.size(), parallelDims.size() + reductionDims.size()))))
The code that you submitted wouldn't work if you switch the RUN command to use inner-reductions strategy for your test example. (There are other cases also where it wouldn't work.)
// RUN: mlir-opt %s -test-vector-multi-reduction-lowering-patterns | FileCheck %s
whereas the change I wrote should work.
Basically, you want to ensure that the transpose happens whenever the reduction dimensions are either not contiguous or not in the innermost/outermost dimensions depending on the strategy.
Comment Actions
- Address review comments
- Add a test to make sure the inner reduction strategy still works