[Mlir-commits] [mlir] [Linalg][Vectorization] Add support for linalg vectorization of a tensor.extract case (PR #107922)

Andrzej Warzyński llvmlistbot at llvm.org
Thu Sep 19 11:52:00 PDT 2024


================
@@ -253,6 +253,58 @@ module attributes {transform.with_named_sequence} {
     transform.yield
   }
 }
+
+// -----
+
+#map = affine_map<(d0, d1) -> (d0, d1)>
+#map1 = affine_map<(d0, d1, d2) -> (d0 + d1 + d2)>
+func.func @vectorize_nd_tensor_extract_without_outer_unit_dim(%arg0: tensor<8x128x768xf32>, %arg1 : index) -> tensor<8x1xf32> {
----------------
banach-space wrote:

IIUC, the key characteristic of this case is that it is loading a 1D column vector using `vector.gather`. [vectorize_nd_tensor_extract_transfer_read_basic_column](https://github.com/llvm/llvm-project/blob/69f3244da76586be393d1e97b01660c6f03d666c/mlir/test/Dialect/Linalg/vectorize-tensor-extract.mlir#L118-L133) also reads a 1D column vector, but that's a "broadcast of a scalar" case.
```suggestion
func.func @vectorize_nd_tensor_extract_load_1d_column_vector_using_gather_load(%arg0: tensor<8x128x768xf32>, %arg1 : index) -> tensor<8x1xf32> {
```

`vectorize_nd_tensor_extract` should probably be just removed from all test function names. Not in this PR though 😅 

https://github.com/llvm/llvm-project/pull/107922


More information about the Mlir-commits mailing list