[all-commits] [llvm/llvm-project] 315ba7: [mlir][linalg] Vectorisation of tensor.extract - d...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Thu Sep 19 11:53:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 315ba7740663208f8bc45a7e4f145dc1df79500c
      https://github.com/llvm/llvm-project/commit/315ba7740663208f8bc45a7e4f145dc1df79500c
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2024-09-19 (Thu, 19 Sep 2024)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
    M mlir/test/Dialect/Linalg/vectorization-scalable.mlir
    M mlir/test/Dialect/Linalg/vectorize-tensor-extract-masked.mlir

  Log Message:
  -----------
  [mlir][linalg] Vectorisation of tensor.extract - dynamic shapes (#100582)

This PR removes the assumption that reading from a dynamic tensor is
always a gather load:

```mlir
%extracted = tensor.extract %src[%c79, %3] : tensor<?x?xf32>
```

That assumption was originally introduced to simplify the implementation
and to reduce the number of cases to consider. Now that the
vectorisation of `tensor.extract` has been around for > 1 year and has
been quite stable, we can safely relax it.

This is a relatively small change - rather than using the parent linalg
Op to infer the target output shape (not possible with dynamic shapes),
the vectorizer will use the (previously constructed) output vector
shape instead.

As expected, the following test required updating (`vector.gather` ->
`vector.transfer_read`):
*
@masked_dynamic_vectorize_nd_tensor_extract_with_affine_apply_contiguous

Similar test for scalable vectors is also added.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list