[all-commits] [llvm/llvm-project] 2f664f: [mlir][mesh] Fix empty `split_axes` sharding annot...

Matteo Franciolini via All-commits all-commits at lists.llvm.org
Sat Sep 21 08:43:33 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f664f2bdf2a3974f5c35ea0278239011181eb87
      https://github.com/llvm/llvm-project/commit/2f664f2bdf2a3974f5c35ea0278239011181eb87
  Author: Matteo Franciolini <mfranciolini at tesla.com>
  Date:   2024-09-21 (Sat, 21 Sep 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h
    M mlir/test/Dialect/Linalg/mesh-sharding-propagation.mlir
    M mlir/test/Dialect/Mesh/sharding-propagation.mlir

  Log Message:
  -----------
  [mlir][mesh] Fix empty `split_axes` sharding annotation (#108236)

The `split_axes` attribute is defined as "array attribute of array
attributes". Following the definition, empty `split_axes` values should
not be allowed, since that would break the definition and would lead to
invalid IR. In such scenario, passes leveraging the mesh dialect can
observe:
* crashes in sharding-propagation;
* creation of null MeshShardingAttrs in spmdization;
* non roundtrippable IR.

The patch prevents `split_axes` to become empty by modifying the
`removeTrailingEmptySubArray` such that a minimum size of one is
guaranteed when constructing the attribute, and adds a test that would
crash without the change.



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