[all-commits] [llvm/llvm-project] 2a2520: [mlir][tensor] Restrict the verifier for tensor.pa...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Tue Oct 22 20:11:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a2520082882d857b22f16e9efa8f794d328f3ee
      https://github.com/llvm/llvm-project/commit/2a2520082882d857b22f16e9efa8f794d328f3ee
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2024-10-22 (Tue, 22 Oct 2024)

  Changed paths:
    M mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
    M mlir/test/Dialect/Linalg/transform-lower-pack.mlir
    M mlir/test/Dialect/Tensor/fold-empty-op.mlir
    M mlir/test/Dialect/Tensor/invalid.mlir

  Log Message:
  -----------
  [mlir][tensor] Restrict the verifier for tensor.pack/tensor.unpack (#113108)

Restricts the verifier for tensor.pack and tensor.unpack Ops so that the
following is no longer allowed:

```mlir
  %c8 = arith.constant 8 : index
  %0 = tensor.pack %input inner_dims_pos = [0, 1] inner_tiles = [8, %c8] into %output : tensor<?x?xf32> -> tensor<?x?x8x8xf32>
```

Specifically, in line with other Tensor Ops, require:
  * a dynamic dimensions for each (dynamic) SSA value,
  * a static dimension for each static size (attribute).

In the example above, a static dimension (8) is mixed with a dynamic
size (%c8).

Note that this is mostly deleting existing code - that's because this
change simplifies the logic in verifier.

For more context:
* https://discourse.llvm.org/t/tensor-ops-with-dynamic-sizes-which-behaviour-is-more-correct



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