iree icon indicating copy to clipboard operation
iree copied to clipboard

[LinalgExt] Add simple vectorization for map_scatter

Open Max191 opened this issue 7 months ago • 1 comments

Allows vector types for the map_scatter input operand, and adds a trivial vectorization pass, which converts the input of map_scatter ops to vector operands with a vector.transfer_read.

This vectorization lowering is not complete, because the map_scatter op in this form will not be able to lower into other operations. The final lowering will happen as a decomposition after the map_scatter op has been both vectorized and bufferized, and the map_scatter op will be decomposed into a vector.scatter op. The reason this decomposition will need to happen after bufferization, is that the vector.scatter op requires a memref base. The decomposition pattern of the vectorized map_scatter will come as a follow-up PR.

Eventually, the vectorized map_scatter op could instead be decomposed into an iree_vector_ext.transfer_scatter op, but since the op does not exist yet, the current plan is to use vector.scatter first.

Max191 avatar Jun 12 '25 20:06 Max191

Additional context for reviewers: https://github.com/iree-org/iree/pull/21116 has the remainder of the vector lowering for map_scatter. It is waiting on some upstream MLIR changes, so it is a draft for now.

Max191 avatar Jun 17 '25 14:06 Max191