Skip to content

[mlir][mesh] adding shard-size control #98145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 7, 2024
Merged

Conversation

fschlimb
Copy link
Contributor

@fschlimb fschlimb commented Jul 9, 2024

  • Replacing #mesh.sharding attribute with operation mesh.sharding
    • extended semantics now allow providing optional halo_sizes and sharded_dims_sizes
    • internally a sharding is represented as a non-IR class mesh::MeshSharding

What previously was

%sharded0 = mesh.shard %arg0 <@mesh0, [[0]]> : tensor<4x8xf32>
%sharded1 = mesh.shard %arg1 <@mesh0, [[0]]> annotate_for_users : tensor<16x8xf32>

is now

%sharding = mesh.sharding @mesh0, [[0]] : !mesh.sharding
%0 = mesh.shard %arg0 to %sharding : tensor<4x8xf32>
%1 = mesh.shard %arg1 to %sharding annotate_for_users : tensor<16x8xf32>

and allows additional annotations to control the shard sizes:

mesh.mesh @mesh0 (shape = 4)
%sharding0 = mesh.sharding @mesh0, [[0]] halo_sizes = [1, 2] : !mesh.sharding
%0 = mesh.shard %arg0 to %sharding0 : tensor<4x8xf32>
%sharding1 = mesh.sharding @mesh0, [[0]] sharded_dims_sizes = [3, 5, 5, 3] : !mesh.sharding
%1 = mesh.shard %arg1 to %sharding1 annotate_for_users : tensor<16x8xf32>
  • mesh.shard op accepts additional optional attribute force, useful for halo updates
  • Some initial spmdization support for the new semantics
  • Support for tensor.empty reacting on sharded_dims_sizes and halo_sizes in the sharding
  • New collective operation mesh.update_halo as a spmdized target for shardings with halo_sizes

@sogartar @yaochengji

Copy link

github-actions bot commented Jul 9, 2024

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2024

@llvm/pr-subscribers-mlir-tensor
@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-linalg

Author: Frank Schlimbach (fschlimb)

Changes
  • Replacing #mesh.sharding attribute with operation mesh.sharding
    • extended semantics now allow providing optional halo_sizes and sharded_dims_sizes
    • internally a sharding is represented as a non-IR class mesh::MeshSharding

What previously was

%sharded0 = mesh.shard %arg0 &lt;@<!-- -->mesh0, [[0]]&gt; : tensor&lt;4x8xf32&gt;
%sharded1 = mesh.shard %arg1 &lt;@<!-- -->mesh0, [[0]]&gt; annotate_for_users : tensor&lt;16x8xf32&gt;

is now

%sharding = mesh.sharding @<!-- -->mesh0, [[0]] : !mesh.sharding
%0 = mesh.shard %arg0 to %sharding : tensor&lt;4x8xf32&gt;
%1 = mesh.shard %arg1 to %sharding annotate_for_users : tensor&lt;16x8xf32&gt;

and allows additional annotations to control the shard sizes:

mesh.mesh @<!-- -->mesh1d_4(shape = 4)
%sharding0 = mesh.sharding @<!-- -->mesh0, [[0]] halo_sizes = [1, 2] : !mesh.sharding
%0 = mesh.shard %arg0 to %sharding0 : tensor&lt;4x8xf32&gt;
%sharding0 = mesh.sharding @<!-- -->mesh0, [[0]] sharded_dims_sizes = [3, 5, 5, 3] : !mesh.sharding
%1 = mesh.shard %arg1 to %sharding annotate_for_users : tensor&lt;16x8xf32&gt;
  • mesh.shard op accepts additional optional attribute force, useful for halo updates
  • Some initial spmdization support for the new semantics
  • Support for tensor.empty reacting on sharded_dims_sizes and halo_sizes in the sharding
  • New collective operation mesh.update_halo as a spmdized target for shardings with halo_sizes

@sogartar @yaochengji


Patch is 207.06 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/98145.diff

28 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Mesh/IR/CMakeLists.txt (+4)
  • (modified) mlir/include/mlir/Dialect/Mesh/IR/MeshBase.td (+22-90)
  • (modified) mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h (+68-11)
  • (modified) mlir/include/mlir/Dialect/Mesh/IR/MeshOps.td (+274-73)
  • (modified) mlir/include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.h (+14-15)
  • (modified) mlir/include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.td (+6-6)
  • (modified) mlir/include/mlir/Dialect/Mesh/Interfaces/ShardingInterfaceImpl.h (+13-11)
  • (added) mlir/include/mlir/Dialect/Tensor/IR/ShardingInterfaceImpl.h (+23)
  • (modified) mlir/include/mlir/InitAllDialects.h (+2)
  • (modified) mlir/include/mlir/Interfaces/InferTypeOpInterface.h (+2-2)
  • (modified) mlir/lib/Dialect/Linalg/Transforms/MeshShardingInterfaceImpl.cpp (+15-16)
  • (modified) mlir/lib/Dialect/Mesh/IR/MeshOps.cpp (+317-65)
  • (modified) mlir/lib/Dialect/Mesh/Interfaces/ShardingInterface.cpp (+73-57)
  • (modified) mlir/lib/Dialect/Mesh/Transforms/ShardingPropagation.cpp (+32-34)
  • (modified) mlir/lib/Dialect/Mesh/Transforms/Spmdization.cpp (+159-90)
  • (modified) mlir/lib/Dialect/Tensor/IR/CMakeLists.txt (+1)
  • (added) mlir/lib/Dialect/Tensor/IR/ShardingInterfaceImpl.cpp (+103)
  • (modified) mlir/test/Dialect/Linalg/mesh-sharding-propagation.mlir (+16-8)
  • (modified) mlir/test/Dialect/Linalg/mesh-spmdization.mlir (+54-41)
  • (modified) mlir/test/Dialect/Mesh/canonicalization.mlir (+2-2)
  • (modified) mlir/test/Dialect/Mesh/invalid.mlir (+35-11)
  • (modified) mlir/test/Dialect/Mesh/ops.mlir (+96-28)
  • (modified) mlir/test/Dialect/Mesh/resharding-spmdization.mlir (+56-22)
  • (modified) mlir/test/Dialect/Mesh/sharding-propagation.mlir (+125-73)
  • (modified) mlir/test/Dialect/Mesh/simplifications.mlir (+8-8)
  • (modified) mlir/test/Dialect/Mesh/spmdization.mlir (+132-29)
  • (added) mlir/test/Dialect/Tensor/mesh-spmdization.mlir (+42)
  • (modified) mlir/test/lib/Dialect/Mesh/TestReshardingSpmdization.cpp (+10-6)
diff --git a/mlir/include/mlir/Dialect/Mesh/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/Mesh/IR/CMakeLists.txt
index 7ba966d8cab7c..f26c6285efd89 100644
--- a/mlir/include/mlir/Dialect/Mesh/IR/CMakeLists.txt
+++ b/mlir/include/mlir/Dialect/Mesh/IR/CMakeLists.txt
@@ -13,6 +13,10 @@ set(LLVM_TARGET_DEFINITIONS MeshBase.td)
 mlir_tablegen(MeshEnums.h.inc -gen-enum-decls)
 mlir_tablegen(MeshEnums.cpp.inc -gen-enum-defs)
 
+set(LLVM_TARGET_DEFINITIONS MeshBase.td)
+mlir_tablegen(MeshTypes.h.inc -gen-typedef-decls)
+mlir_tablegen(MeshTypes.cpp.inc -gen-typedef-defs)
+
 set(LLVM_TARGET_DEFINITIONS MeshOps.td)
 mlir_tablegen(MeshOps.h.inc -gen-op-decls)
 mlir_tablegen(MeshOps.cpp.inc -gen-op-defs)
diff --git a/mlir/include/mlir/Dialect/Mesh/IR/MeshBase.td b/mlir/include/mlir/Dialect/Mesh/IR/MeshBase.td
index 3a85bf2d552f3..61403ac178980 100644
--- a/mlir/include/mlir/Dialect/Mesh/IR/MeshBase.td
+++ b/mlir/include/mlir/Dialect/Mesh/IR/MeshBase.td
@@ -12,6 +12,7 @@
 include "mlir/IR/OpBase.td"
 include "mlir/IR/AttrTypeBase.td"
 include "mlir/IR/BuiltinTypeInterfaces.td"
+include "mlir/IR/CommonAttrConstraints.td"
 include "mlir/IR/EnumAttr.td"
 
 //===----------------------------------------------------------------------===//
@@ -31,11 +32,13 @@ def Mesh_Dialect : Dialect {
   ];
 
   let useDefaultAttributePrinterParser = 1;
+  let useDefaultTypePrinterParser = 1;
   let hasConstantMaterializer = 1;
 }
 
 def Mesh_MeshAxis : I<16>;
 def Mesh_MeshAxesAttr : DenseArrayAttrBase<"DenseI16ArrayAttr", "int16_t", "i16">;
+def Mesh_ShardShapeAttr : DenseArrayAttrBase<"DenseI64ArrayAttr", "int64_t", "i64">;
 
 //===----------------------------------------------------------------------===//
 // Mesh Enums.
@@ -59,104 +62,33 @@ def Mesh_ReductionKind : I32EnumAttr<"ReductionKind",
 }
 
 def Mesh_ReductionKindAttr : EnumAttr<Mesh_Dialect, Mesh_ReductionKind, "partial"> {
-  let assemblyFormat = "`<` $value `>`";
+  let assemblyFormat = "$value";
+}
+
+class Mesh_Type<string name, string typeMnemonic, list<Trait> traits = [],
+                   string baseCppClass = "::mlir::Type">
+    : TypeDef<Mesh_Dialect, name, traits, baseCppClass> {
+  let mnemonic = typeMnemonic;
+}
+
+def Mesh_Sharding : Mesh_Type<"Sharding", "sharding"> {
+  let summary = "sharding definition";
+  let assemblyFormat = "";
 }
 
 //===----------------------------------------------------------------------===//
 // Mesh Attribute
 //===----------------------------------------------------------------------===//
 
-def MeshSharding : AttrDef<Mesh_Dialect, "MeshSharding"> {
-  let mnemonic = "shard";
-
-  let parameters = (ins
-    AttrParameter<"::mlir::FlatSymbolRefAttr",
-     "The mesh on which tensors are sharded.">:$mesh,
-    ArrayRefParameter<"MeshAxesAttr">:$split_axes,
-    OptionalArrayRefParameter<"MeshAxis">:$partial_axes,
-    OptionalParameter<"::mlir::mesh::ReductionKind">:$partial_type
-  );
-
-  let summary = "Attribute that extends tensor type to distributed tensor type.";
-
-  let description = [{
-    The MeshSharding attribute is used in a `mesh.shard` operation.
-    It specifies how a tensor is sharded and distributed across the process
-    mesh.
-
-    1. `mesh`: this attribute is a FlatSymbolRefAttr that refers to the device
-    mesh where the distributed tensor is placed. The symbol must resolve to a
-    `mesh.mesh` operation.
-
-    2. `split_axes`: is an array composed of int64_t sub-arrays. The outer array's
-    maximum size is the `rank` of the related tensor. For the i-th sub-array, if
-    its value is [x, y], it indicates that the tensor's i-th dimension is splitted
-    along the x and y axes of the device mesh.
-
-    3. `partial_axes`: if not empty, this signifies that the tensor is partial
-    one along the specified mesh axes. An all-reduce should be applied to obtain
-    the complete tensor, with reduction type being specified by `partial_type`.
-
-    4. `partial_type`: indicates the reduction type of the possible all-reduce
-    op. It has 4 possible values:
-    `generic`: is not an allowed value inside a shard attribute.
-
-    Example:
-
-    ```
-    mesh.mesh @mesh0(shape = 2x2x4)
-
-    // The tensor is fully replicated on @mesh0.
-    // Currently, there must be at least one sub-array present in axes, even
-    // if it's empty. Otherwise, a parsing error will occur.
-    #mesh.shard<@mesh0, [[]]>
-
-    // The tensor is sharded on the first dimension along axis 0 of @mesh0
-    #mesh.shard<@mesh0, [[0]]>
-
-    // The tensor is sharded on the first dimension along axis 0 of @mesh0 and
-    // it is also a partial_sum along mesh axis 1.
-    #mesh.shard<@mesh0, [[0], []], partial = sum[1]>
-
-    // The tensor is sharded on the first dimension along axis 0 of @mesh0 and
-    // it is also a partial_max along mesh axis 1.
-    #mesh.shard<@mesh0, [[0]], partial = max[1]>
-
-    // Could be used in the attribute of mesh.shard op
-    %0 = mesh.shard %arg0 to <@mesh0, [[0]]> : tensor<4x8xf32>
-    ```
-  }];
-  let assemblyFormat = [{
-    `<` $mesh `,` `[` $split_axes `]` (`,` `partial` `=` $partial_type `[`
-       $partial_axes^ `]`)? `>`
-  }];
-
-  let builders = [
-    AttrBuilder<(ins "FlatSymbolRefAttr":$mesh,
-                     "ArrayRef<SmallVector<MeshAxis>>":$split_axes,
-                     "ArrayRef<MeshAxis>": $partial_axes,
-                     "mesh::ReductionKind": $partial_type), [{
-      SmallVector<MeshAxesAttr> splitAxesAttr = llvm::map_to_vector(
-                  split_axes, [&](ArrayRef<MeshAxis> array) {
-          return MeshAxesAttr::get($_ctxt, array);
-      });
-      return $_get($_ctxt, mesh, splitAxesAttr, partial_axes,
-                   partial_type);
-    }]>,
-    AttrBuilder<(ins "FlatSymbolRefAttr":$mesh,
-                     "ArrayRef<SmallVector<MeshAxis>>":$split_axes), [{
-      return MeshShardingAttr::get($_ctxt, mesh, split_axes, {}, ReductionKind::Sum);
-    }]>
-  ];
-
+def Mesh_MeshAxesArrayAttr : AttrDef<Mesh_Dialect, "MeshAxesArray"> {
+  let mnemonic = "axisarray";
+  let parameters = (ins ArrayRefParameter<"MeshAxesAttr">:$axes);
+  let assemblyFormat = "`[` $axes `]`";
   let extraClassDeclaration = [{
-    bool operator==(::mlir::Attribute rhs) const;
-    bool operator!=(::mlir::Attribute rhs) const;
-    bool operator==(::mlir::mesh::MeshShardingAttr rhs) const;
-    bool operator!=(::mlir::mesh::MeshShardingAttr rhs) const;
+    size_t size() const { return getAxes().size(); }
+    auto begin() const { return getAxes().begin(); }
+    auto end() const { return getAxes().end(); }
   }];
-
-  let genVerifyDecl = 1;
 }
 
 #endif // MLIR_DIALECT_MESH_IR_MESHBASE_TD
diff --git a/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h b/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h
index b27c9e81b3293..3c467d6f95948 100644
--- a/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h
+++ b/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h
@@ -24,6 +24,8 @@ namespace mesh {
 
 using MeshAxis = int16_t;
 using MeshAxesAttr = DenseI16ArrayAttr;
+using ShardShapeAttr = DenseI64ArrayAttr;
+using HaloSizePairAttr = DenseI64ArrayAttr;
 
 } // namespace mesh
 } // namespace mlir
@@ -33,6 +35,59 @@ using MeshAxesAttr = DenseI16ArrayAttr;
 #define GET_ATTRDEF_CLASSES
 #include "mlir/Dialect/Mesh/IR/MeshAttributes.h.inc"
 
+namespace mlir {
+namespace mesh {
+
+class MeshSharding {
+private:
+  ::mlir::FlatSymbolRefAttr mesh;
+  SmallVector<MeshAxesAttr> split_axes;
+  SmallVector<MeshAxis> partial_axes;
+  ReductionKind partial_type;
+  SmallVector<int64_t> static_halo_sizes;
+  SmallVector<int64_t> static_sharded_dims_sizes;
+  SmallVector<Value> dynamic_halo_sizes;
+  SmallVector<Value> dynamic_sharded_dims_sizes;
+
+public:
+  MeshSharding() = default;
+  MeshSharding(Value rhs);
+  static MeshSharding get(::mlir::FlatSymbolRefAttr mesh_,
+                          ArrayRef<MeshAxesAttr> split_axes_,
+                          ArrayRef<MeshAxis> partial_axes_ = {},
+                          ReductionKind partial_type_ = ReductionKind::Sum,
+                          ArrayRef<int64_t> static_halo_sizes_ = {},
+                          ArrayRef<int64_t> static_sharded_dims_sizes_ = {},
+                          ArrayRef<Value> dynamic_halo_sizes_ = {},
+                          ArrayRef<Value> dynamic_sharded_dims_sizes_ = {});
+  ::mlir::FlatSymbolRefAttr getMeshAttr() const { return mesh; }
+  ::llvm::StringRef getMesh() const { return mesh.getValue(); }
+  ArrayRef<MeshAxesAttr> getSplitAxes() const { return split_axes; }
+  ArrayRef<MeshAxis> getPartialAxes() const { return partial_axes; }
+  ReductionKind getPartialType() const { return partial_type; }
+  ArrayRef<int64_t> getStaticHaloSizes() const { return static_halo_sizes; }
+  ArrayRef<int64_t> getStaticShardedDimsSizes() const {
+    return static_sharded_dims_sizes;
+  }
+  ArrayRef<Value> getDynamicHaloSizes() const { return dynamic_halo_sizes; }
+  ArrayRef<Value> getDynamicShardedDimsSizes() const {
+    return dynamic_sharded_dims_sizes;
+  }
+  operator bool() const { return (!mesh) == false; }
+  bool operator==(Value rhs) const;
+  bool operator!=(Value rhs) const;
+  bool operator==(const MeshSharding &rhs) const;
+  bool operator!=(const MeshSharding &rhs) const;
+  bool sameExceptConstraint(const MeshSharding &rhs) const;
+  bool sameConstraint(const MeshSharding &rhs) const;
+};
+
+} // namespace mesh
+} // namespace mlir
+
+#define GET_TYPEDEF_CLASSES
+#include "mlir/Dialect/Mesh/IR/MeshTypes.h.inc"
+
 #define GET_OP_CLASSES
 #include "mlir/Dialect/Mesh/IR/MeshOps.h.inc"
 
@@ -50,9 +105,9 @@ void removeTrailingEmptySubArray(SmallVector<SmallVector<T>> &array) {
 }
 
 // Is the same tensor replicated on all processes.
-inline bool isFullReplication(MeshShardingAttr attr) {
-  return attr.getPartialAxes().empty() &&
-         llvm::all_of(attr.getSplitAxes(), [](MeshAxesAttr axes) {
+inline bool isFullReplication(MeshSharding sharding) {
+  return sharding.getPartialAxes().empty() &&
+         llvm::all_of(sharding.getSplitAxes(), [](MeshAxesAttr axes) {
            return axes.asArrayRef().empty();
          });
 }
@@ -80,8 +135,10 @@ mesh::MeshOp getMesh(Op op, SymbolTableCollection &symbolTableCollection) {
 template <>
 inline mesh::MeshOp
 getMesh<ShardOp>(ShardOp op, SymbolTableCollection &symbolTableCollection) {
-  return getMesh(op.getOperation(), op.getShardAttr().getMesh(),
-                 symbolTableCollection);
+  return getMesh(
+      op.getOperation(),
+      cast<ShardingOp>(op.getSharding().getDefiningOp()).getMeshAttr(),
+      symbolTableCollection);
 }
 
 // Get the number of processes that participate in each group
@@ -131,22 +188,22 @@ inline int64_t gatherDimension(int64_t dimSize, int64_t shardCount) {
 // On a 2x4x? mesh with split axes = [[0], [1], [2]] the shape ?x5x1 would
 // result in a shape for each shard of ?x2x?.
 ShapedType shardShapedType(ShapedType shape, MeshOp mesh,
-                           MeshShardingAttr sharding);
+                           MeshSharding sharding);
 
 // If ranked tensor type return its sharded counterpart.
 //
 // If not ranked tensor type return `type`.
 // `sharding` in that case must be null.
-Type shardType(Type type, MeshOp mesh, MeshShardingAttr sharding);
+Type shardType(Type type, MeshOp mesh, MeshSharding sharding);
 
 // Insert shard op if there is not one that already has the same sharding.
 // May insert resharding if required.
-void maybeInsertTargetShardingAnnotation(MeshShardingAttr sharding,
+void maybeInsertTargetShardingAnnotation(MeshSharding sharding,
                                          OpOperand &operand,
                                          OpBuilder &builder);
-void maybeInsertTargetShardingAnnotation(MeshShardingAttr sharding,
-                                         OpResult result, OpBuilder &builder);
-void maybeInsertSourceShardingAnnotation(MeshShardingAttr sharding,
+void maybeInsertTargetShardingAnnotation(MeshSharding sharding, OpResult result,
+                                         OpBuilder &builder);
+void maybeInsertSourceShardingAnnotation(MeshSharding sharding,
                                          OpOperand &operand,
                                          OpBuilder &builder);
 
diff --git a/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.td b/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.td
index 8e1e475463585..49c4037942f6f 100644
--- a/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.td
+++ b/mlir/include/mlir/Dialect/Mesh/IR/MeshOps.td
@@ -20,7 +20,7 @@ include "mlir/IR/OpAsmInterface.td"
 include "mlir/IR/SymbolInterfaces.td"
 
 //===----------------------------------------------------------------------===//
-// Mesh Dialect operations.
+// Mesh operations.
 //===----------------------------------------------------------------------===//
 
 class Mesh_Op<string mnemonic, list<Trait> traits = []> :
@@ -105,22 +105,221 @@ def Mesh_MeshShapeOp : Mesh_Op<"mesh_shape", [
   ];
 }
 
+def Mesh_ProcessMultiIndexOp : Mesh_Op<"process_multi_index", [
+  Pure,
+  DeclareOpInterfaceMethods<SymbolUserOpInterface>,
+  DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>
+]> {
+  let summary = "Get the multi index of current device along specified mesh axes.";
+  let description = [{
+    It is used in the SPMD format of IR.
+    The `axes` mush be non-negative and less than the total number of mesh axes.
+    If the axes are empty then get the index along all axes.
+  }];
+  let arguments = (ins
+    FlatSymbolRefAttr:$mesh,
+    DefaultValuedAttr<Mesh_MeshAxesAttr, "{}">:$axes
+  );
+  let results = (outs
+    Variadic<Index>:$result
+  );
+  let assemblyFormat = [{
+    `on` $mesh (`axes` `=` $axes^)?
+    attr-dict `:` type($result)
+  }];
+  let builders = [
+    OpBuilder<(ins "::mlir::mesh::MeshOp":$mesh)>,
+    OpBuilder<(ins "StringRef":$mesh, "ArrayRef<MeshAxis>":$axes)>
+  ];
+}
+
+def Mesh_ProcessLinearIndexOp : Mesh_Op<"process_linear_index", [
+  Pure,
+  DeclareOpInterfaceMethods<SymbolUserOpInterface>,
+  DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>
+]> {
+  let summary = "Get the linear index of the current device.";
+  let description = [{
+    Example:
+    ```
+    %idx = mesh.process_linear_index on @mesh : index
+    ```
+    if `@mesh` has shape `(10, 20, 30)`, a device with multi
+    index `(1, 2, 3)` will have linear index `3 + 30*2 + 20*30*1`.
+  }];
+  let arguments = (ins FlatSymbolRefAttr:$mesh);
+  let results = (outs Index:$result);
+  let assemblyFormat = "`on` $mesh attr-dict `:` type($result)";
+  let builders = [
+    OpBuilder<(ins "::mlir::mesh::MeshOp":$mesh)>
+  ];
+}
+
+//===----------------------------------------------------------------------===//
+// Sharding operations.
+//===----------------------------------------------------------------------===//
+
+def Mesh_ShardingOp : Mesh_Op<"sharding", [
+    Pure,
+    AttrSizedOperandSegments,
+    DeclareOpInterfaceMethods<OpAsmOpInterface, ["getAsmResultNames"]>
+  ]> {
+  let summary = "Define a sharding of a tensor.";
+  let description = [{
+    The MeshSharding specifies how a tensor is sharded and distributed across the
+    process mesh. It is typically used in a `mesh.shard` operation.
+    The operation has the follwing attributes and operands:
+
+    1. `mesh`: this attribute is a FlatSymbolRefAttr that refers to the device
+    mesh where the distributed tensor is placed. The symbol must resolve to a
+    `mesh.mesh` operation.
+
+    2. `split_axes`: is an array composed of int64_t sub-arrays. The outer array's
+    maximum size is the `rank` of the related tensor. For the i-th sub-array, if
+    its value is [x, y], it indicates that the tensor's i-th dimension is splitted
+    along the x and y axes of the device mesh.
+
+    3. [Optional] `partial_axes`: if not empty, this signifies that the tensor is partial
+    one along the specified mesh axes. An all-reduce should be applied to obtain
+    the complete tensor, with reduction type being specified by `partial_type`.
+
+    4. [Optional] `partial_type`: indicates the reduction type of the possible all-reduce
+    op. It has 4 possible values:
+    `generic`: is not an allowed value inside a shard attribute.
+
+    5. [Optional] Sizes of halos to be added for each sharded tensor dimension.
+    `halo_sizes`is provided as a flattened 1d array of i64s, 2 values for each sharded dimension.
+    `halo_sizes` = [1, 2] means that the first sharded dimension gets an additional
+    halo of size 1 at the start of the first dimension and a halo size is 2 at its end.
+    `halo_sizes` = [1, 2, 2, 3] defines halos for the first 2 sharded dimensions
+    e.g. the first sharded dimension gets [1,2] halos and the seconds gets [2,3] halos.
+    `?` indicates dynamic halo sizes.
+    
+    6. [Optional] Sizes of sharded dimensions of each shard.
+    `sharded_dims_sizes`is provided as a flattened 1d array of i64s: for each device of the
+    device-mesh one value for each sharded tensor dimension.
+    Assuming a 3d-tensor of shape 32x32x32 with the first 2 dimensions being sharded,
+    `sharded_dims_sizes` = [16, 8, 16, 24] means that the first device of
+    the device-mesh will get a shard of shape 16x8x32 and the second device will get a
+    shard of shape 16x24x32.
+    `?` indicates dynamic shard dimensions.
+    
+    `halo_sizes` and `sharded_dims_sizes` are mutually exclusive.
+
+    Examples:
+
+    ```
+    mesh.mesh @mesh0(shape = 2x2x4)
+    mesh.mesh @mesh1d_4(shape = 4)
+
+    // The tensor is fully replicated on @mesh0.
+    // Currently, there must be at least one sub-array present in axes, even
+    // if it's empty. Otherwise, a parsing error will occur.
+    %sharding0 = mesh.sharding @mesh0, [[]]
+
+    // The tensor is sharded on the first dimension along axis 0 of @mesh0
+    %sharding1 = mesh.sharding @mesh0, [[0]]
+
+    // The tensor is sharded on its first dimension along axis 0 of @mesh0 and
+    // it is also a partial_sum along mesh axis 1.
+    %sharding2 = mesh.sharding @mesh0, [[0], []] partial = sum[1]
+
+    // The tensor is sharded on its first dimension along axis 0 of @mesh0 and
+    // it is also a partial_max along mesh axis 1.
+    %sharding3 = mesh.sharding @mesh0, [[0]] partial = max[1]
+
+    // Could be used for a mesh.shard op
+    %sharded0 = mesh.shard %arg0 to %sharding3 : tensor<4x8xf32>
+
+    // The tensor is sharded on its first dimension along axis 0 of @mesh0 and
+    // and it has halo-sizes of 1 and 2 on the sharded dim.
+    %halo_sharding = mesh.sharding @mesh0, [[0]] halo_sizes = [1, 2]
+    %sharded1 = mesh.shard %arg0 to %halo_sharding : tensor<4x8xf32>
+    
+    // The tensor is sharded on its second dimension along axis 0 of @mesh1d_4
+    // and it has pre-defined shard sizes. The shards of the devices will have
+    // the following shapes: [4x2, 4x3, 4x4, 4x5]
+    %sharding4 = mesh.sharding @mesh1d_4, [[], [0]] sharded_dims_sizes = [2, 3, 4, 5]
+    %sharded2 = mesh.shard %arg0 to %sharding4 : tensor<4x14xf32>
+    ```
+  }];
+    
+  let arguments = (ins
+    FlatSymbolRefAttr:$mesh,
+    Mesh_MeshAxesArrayAttr:$split_axes,
+    OptionalAttr<Mesh_MeshAxesAttr>:$partial_axes,
+    OptionalAttr<Mesh_ReductionKindAttr>:$partial_type,
+    DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$static_sharded_dims_sizes,
+    Variadic<I64>:$dynamic_sharded_dims_sizes,
+    DefaultValuedAttr<DenseI64ArrayAttr, "{}">:$static_halo_sizes,
+    Variadic<I64>:$dynamic_halo_sizes
+  );
+  let results = (outs
+    Mesh_Sharding:$result
+  );
+  let assemblyFormat = [{
+    $mesh `,` $split_axes
+    (`partial` `=` $partial_type $partial_axes^)?
+    (`halo_sizes` `=` custom<DynamicIndexList>($dynamic_halo_sizes, $static_halo_sizes)^)?
+    (`sharded_dims_sizes` `=` custom<DynamicIndexList>($dynamic_sharded_dims_sizes, $static_sharded_dims_sizes)^)?
+    attr-dict `:` type($result)
+  }];
+  let builders = [
+    OpBuilder<(ins "FlatSymbolRefAttr":$mesh,
+                   "ArrayRef<MeshAxesAttr>":$split_axes,
+                   "ArrayRef<MeshAxis>":$partial_axes,
+                   "mesh::ReductionKind":$partial_type,
+                   CArg<"ArrayRef<int64_t>", "{}">:$static_halo_sizes,
+                   CArg<"ArrayRef<int64_t>", "{}">:$static_sharded_dims_sizes)>,
+    OpBuilder<(ins "FlatSymbolRefAttr":$mesh,
+                   "ArrayRef<MeshAxesAttr>":$split_axes)>,
+    OpBuilder<(ins "FlatSymbolRefAttr":$mesh,
+                   "ArrayRef<MeshAxesAttr...
[truncated]

Copy link
Contributor

@sogartar sogartar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing. I have a few remarks.

@fschlimb
Copy link
Contributor Author

Thank you for contributing. I have a few remarks.

Thanks for your detailed review! See my comments/modifications.

@fschlimb fschlimb requested a review from sogartar July 10, 2024 09:47
Comment on lines 331 to 333
4. `force`: A unit attribute requesting an explicit sharding of the data,
therefore not allowing to be optimizied away. This is useful in the presence
of halos and inplace semantics.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add explanation in the doc with an example?
I still don't understand. It would be desirable to avoid the complexity of another attribute.
Shouldn't insert_slice know how to handle its spmdization? It would have requirements that the destination-passing style operand and the result are related and that they need to have the same sharding. If this constraint can not be satisfied then resharding will be inserted during sharding propagation.

Copy link

github-actions bot commented Jul 12, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@fschlimb
Copy link
Contributor Author

fschlimb commented Aug 5, 2024

@fschlimb
Copy link
Contributor Author

fschlimb commented Aug 6, 2024

@sogartar You're probably right and we can go without the the force attribute. I am pretty sure I can handle all update_halo cases without that if I move the generation of mesh.update_halo into the spmdize method for inplace operations like insert_slice. An extra optimization pass should be able to get rid of extra update_halo ops, e.g. when the output of one is the input of the other.
I removed force from mesh.shard and adapted related code/tests.

I also added a check in a symbolverifier to disallow sharded_dims_sizes on dynamic meshes.

As far as I can tell I addressed all your concerns and suggestions.

Copy link
Contributor

@sogartar sogartar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fschlimb, thank you for your contribution. Could you rebase before merging since this PR has been opened for a while and there may be some conflicts.
The commit/pr title should be prefixed with [mlir][mesh].

@fschlimb fschlimb changed the title mlir::mesh::shardingOp adding shard-size control [mlir][mesh] adding shard-size control Aug 7, 2024
@fschlimb fschlimb requested a review from yaochengji August 7, 2024 07:57
@rengolin rengolin merged commit fca6983 into llvm:main Aug 7, 2024
7 checks passed
Copy link

github-actions bot commented Aug 7, 2024

@fschlimb Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested
by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as
the builds can include changes from many authors. It is not uncommon for your
change to be included in a build that fails due to someone else's changes, or
infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself.
This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 7, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-libcxx running on linaro-flang-aarch64-libcxx while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/89/builds/3580

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
179.428 [1549/47/5517] Creating library symlink lib/libMLIRTestTransformDialect.so
179.431 [1549/46/5518] Creating library symlink lib/libMLIROpenMPToLLVMIRTranslation.so
179.464 [1549/45/5519] Linking CXX shared library lib/libMLIRVCIXToLLVMIRTranslation.so.20.0git
179.467 [1549/44/5520] Linking CXX shared library lib/libMLIRX86VectorToLLVMIRTranslation.so.20.0git
179.485 [1549/43/5521] Linking CXX shared library lib/libMLIRTargetLLVM.so.20.0git
179.492 [1544/47/5522] Creating library symlink lib/libMLIRVCIXToLLVMIRTranslation.so
179.492 [1544/46/5523] Creating library symlink lib/libMLIRX86VectorToLLVMIRTranslation.so
179.495 [1540/49/5524] Creating library symlink lib/libMLIRTargetLLVM.so
179.505 [1540/48/5525] Linking CXX shared library lib/libMLIRCAPITransformDialect.so.20.0git
179.509 [1540/47/5526] Linking CXX shared library lib/libMLIRTensorDialect.so.20.0git
FAILED: lib/libMLIRTensorDialect.so.20.0git 
: && /usr/local/bin/c++ -fPIC -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -stdlib=libc++ -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRTensorDialect.so.20.0git -o lib/libMLIRTensorDialect.so.20.0git tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorDialect.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorOps.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib:"  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  -lpthread  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-libcxx/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingOption(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE17getShardingOptionEPKNS2_7ConceptEPNS_9OperationEN4llvm8ArrayRefINS0_12MeshShardingEEESF_+0x50): undefined reference to `mlir::mesh::detail::defaultGetShardingOption(mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::mesh::ShardingOption const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE22getShardingAnnotationsEPKNS2_7ConceptEPNS_9OperationERKNS0_14ShardingOptionE+0x44): undefined reference to `mlir::mesh::detail::defaultGetShardingAnnotations(mlir::Operation*, mlir::mesh::ShardingOption const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::addShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE22addShardingAnnotationsEPKNS2_7ConceptEPNS_9OperationERNS_9OpBuilderERKNS0_14ShardingOptionE+0x48): undefined reference to `mlir::mesh::detail::defaultAddShardingAnnotations(mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::spmdize(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::Value>, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>, mlir::IRMapping&, mlir::SymbolTableCollection&, mlir::OpBuilder&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE7spmdizeEPKNS2_7ConceptEPNS_9OperationEN4llvm8ArrayRefINS_5ValueEEENSD_INS0_12MeshShardingEEESH_RNS_9IRMappingERNS_21SymbolTableCollectionERNS_9OpBuilderE+0x7c): undefined reference to `mlir::mesh::shardType(mlir::Type, mlir::mesh::MeshOp, mlir::mesh::MeshSharding)'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE7spmdizeEPKNS2_7ConceptEPNS_9OperationEN4llvm8ArrayRefINS_5ValueEEENSD_INS0_12MeshShardingEEESH_RNS_9IRMappingERNS_21SymbolTableCollectionERNS_9OpBuilderE+0x388): undefined reference to `mlir::mesh::ShardShapeOp::getODSResultIndexAndLength(unsigned int)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::ShardingOp mlir::OpBuilder::create<mlir::mesh::ShardingOp, mlir::mesh::MeshSharding const&>(mlir::Location, mlir::mesh::MeshSharding const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_]+0x30): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_]+0x34): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_]+0x70): undefined reference to `mlir::mesh::ShardingOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::mesh::MeshSharding)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::ProcessLinearIndexOp mlir::OpBuilder::create<mlir::mesh::ProcessLinearIndexOp, llvm::StringRef>(mlir::Location, llvm::StringRef&&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_]+0x30): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_]+0x34): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_]+0x60): undefined reference to `mlir::mesh::ProcessLinearIndexOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::StringRef)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::ShardShapeOp mlir::OpBuilder::create<mlir::mesh::ShardShapeOp, llvm::ArrayRef<long>, mlir::OpResult, mlir::Value&>(mlir::Location, llvm::ArrayRef<long>&&, mlir::OpResult&&, mlir::Value&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_]+0x3c): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_]+0x40): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_]+0x74): undefined reference to `mlir::mesh::ShardShapeOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::ArrayRef<long>, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::MeshOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::MeshOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::MeshOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::MeshOp, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::ShardingOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ShardingOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::ProcessLinearIndexOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ProcessLinearIndexOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::ShardShapeOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ShardShapeOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
179.523 [1540/46/5527] Linking CXX shared library lib/libMLIROpenACCTransforms.so.20.0git
179.533 [1540/45/5528] Linking CXX shared library lib/libMLIROpenACCToLLVMIRTranslation.so.20.0git
179.540 [1540/44/5529] Linking CXX shared library lib/libMLIRGPUToLLVMIRTranslation.so.20.0git

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 7, 2024

LLVM Buildbot has detected a new failure on builder mlir-nvidia running on mlir-nvidia while building mlir at step 5 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/138/builds/2153

Here is the relevant piece of the build log for the reference:

Step 5 (build-check-mlir-build-only) failure: build (failure)
...
584.816 [1138/16/3762] Creating library symlink lib/libMLIRNVGPUDialect.so
584.875 [1137/16/3763] Linking CXX shared library lib/libMLIRAMDGPUUtils.so.20.0git
584.883 [1136/16/3764] Creating library symlink lib/libMLIRAMDGPUUtils.so
584.981 [1135/16/3765] Building CXX object tools/mlir/lib/Dialect/Vector/Transforms/CMakeFiles/obj.MLIRVectorTransforms.dir/VectorTransferSplitRewritePatterns.cpp.o
585.009 [1134/16/3766] Building CXX object tools/mlir/lib/Pass/CMakeFiles/obj.MLIRPass.dir/PassCrashRecovery.cpp.o
585.015 [1133/16/3767] Linking CXX shared library lib/libMLIROpenACCDialect.so.20.0git
585.023 [1132/16/3768] Creating library symlink lib/libMLIROpenACCDialect.so
585.041 [1131/16/3769] Building CXX object tools/mlir/lib/Pass/CMakeFiles/obj.MLIRPass.dir/IRPrinting.cpp.o
585.057 [1130/16/3770] Building CXX object tools/mlir/lib/Pass/CMakeFiles/obj.MLIRPass.dir/PassRegistry.cpp.o
585.058 [1129/16/3771] Linking CXX shared library lib/libMLIRTensorDialect.so.20.0git
FAILED: lib/libMLIRTensorDialect.so.20.0git 
: && /usr/bin/clang++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=lld -Wl,--color-diagnostics   -Wl,--gc-sections -shared -Wl,-soname,libMLIRTensorDialect.so.20.0git -o lib/libMLIRTensorDialect.so.20.0git tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorDialect.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorOps.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib:"  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/lib && :
ld.lld: error: undefined symbol: mlir::mesh::detail::defaultGetShardingOption(mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>)
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingOption(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>))

ld.lld: error: undefined symbol: mlir::mesh::detail::defaultGetShardingAnnotations(mlir::Operation*, mlir::mesh::ShardingOption const&)
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::mesh::ShardingOption const&))

ld.lld: error: undefined symbol: mlir::mesh::detail::defaultAddShardingAnnotations(mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&)
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::addShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&))

ld.lld: error: undefined symbol: mlir::mesh::shardType(mlir::Type, mlir::mesh::MeshOp, mlir::mesh::MeshSharding)
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::spmdize(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::Value>, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>, mlir::IRMapping&, mlir::SymbolTableCollection&, mlir::OpBuilder&))

ld.lld: error: undefined symbol: mlir::mesh::ShardShapeOp::getODSResultIndexAndLength(unsigned int)
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::spmdize(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::Value>, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>, mlir::IRMapping&, mlir::SymbolTableCollection&, mlir::OpBuilder&))

ld.lld: error: undefined symbol: mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::ShardingOp mlir::OpBuilder::create<mlir::mesh::ShardingOp, mlir::mesh::MeshSharding const&>(mlir::Location, mlir::mesh::MeshSharding const&))
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(llvm::DefaultDoCastIfPossible<mlir::mesh::ShardingOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ShardingOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*))

ld.lld: error: undefined symbol: mlir::mesh::ShardingOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::mesh::MeshSharding)
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::ShardingOp mlir::OpBuilder::create<mlir::mesh::ShardingOp, mlir::mesh::MeshSharding const&>(mlir::Location, mlir::mesh::MeshSharding const&))

ld.lld: error: undefined symbol: mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(mlir::mesh::ProcessLinearIndexOp mlir::OpBuilder::create<mlir::mesh::ProcessLinearIndexOp, llvm::StringRef>(mlir::Location, llvm::StringRef&&))
>>> referenced by ShardingInterfaceImpl.cpp
>>>               tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o:(llvm::DefaultDoCastIfPossible<mlir::mesh::ProcessLinearIndexOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ProcessLinearIndexOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*))

ld.lld: error: undefined symbol: mlir::mesh::ProcessLinearIndexOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::StringRef)

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 7, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-sharedlibs running on linaro-flang-aarch64-sharedlibs while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/80/builds/1865

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
1366.339 [3370/23/3932] Creating library symlink lib/libMLIROpenACCDialect.so
1366.410 [3370/22/3933] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/TypeToLLVM.cpp.o
1366.412 [3370/21/3934] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/Dialect/OpenMPCommon.cpp.o
1366.441 [3370/20/3935] Building CXX object tools/mlir/lib/Target/SPIRV/CMakeFiles/obj.MLIRSPIRVTranslateRegistration.dir/TranslateRegistration.cpp.o
1366.457 [3370/19/3936] Linking CXX shared library lib/libMLIRTargetCpp.so.20.0git
1366.524 [3370/18/3937] Linking CXX shared library lib/libMLIRPDLToPDLInterp.so.20.0git
1366.525 [3370/17/3938] Linking CXX shared library lib/libMLIRMemRefUtils.so.20.0git
1366.557 [3370/16/3939] Linking CXX shared library lib/libMLIRNVGPUDialect.so.20.0git
1366.620 [3370/15/3940] Linking CXX shared library lib/libMLIRAMDGPUDialect.so.20.0git
1366.637 [3370/14/3941] Linking CXX shared library lib/libMLIRTensorDialect.so.20.0git
FAILED: lib/libMLIRTensorDialect.so.20.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -Werror=global-constructors -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRTensorDialect.so.20.0git -o lib/libMLIRTensorDialect.so.20.0git tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorDialect.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorOps.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib:"  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  -lpthread  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-sharedlibs/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingOption(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE17getShardingOptionEPKNS2_7ConceptEPNS_9OperationEN4llvm8ArrayRefINS0_12MeshShardingEEESF_+0x50): undefined reference to `mlir::mesh::detail::defaultGetShardingOption(mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::mesh::ShardingOption const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE22getShardingAnnotationsEPKNS2_7ConceptEPNS_9OperationERKNS0_14ShardingOptionE+0x44): undefined reference to `mlir::mesh::detail::defaultGetShardingAnnotations(mlir::Operation*, mlir::mesh::ShardingOption const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::addShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE22addShardingAnnotationsEPKNS2_7ConceptEPNS_9OperationERNS_9OpBuilderERKNS0_14ShardingOptionE+0x48): undefined reference to `mlir::mesh::detail::defaultAddShardingAnnotations(mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::spmdize(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::Value>, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>, mlir::IRMapping&, mlir::SymbolTableCollection&, mlir::OpBuilder&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE7spmdizeEPKNS2_7ConceptEPNS_9OperationEN4llvm8ArrayRefINS_5ValueEEENSD_INS0_12MeshShardingEEESH_RNS_9IRMappingERNS_21SymbolTableCollectionERNS_9OpBuilderE+0x7c): undefined reference to `mlir::mesh::shardType(mlir::Type, mlir::mesh::MeshOp, mlir::mesh::MeshSharding)'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE7spmdizeEPKNS2_7ConceptEPNS_9OperationEN4llvm8ArrayRefINS_5ValueEEENSD_INS0_12MeshShardingEEESH_RNS_9IRMappingERNS_21SymbolTableCollectionERNS_9OpBuilderE+0x440): undefined reference to `mlir::mesh::ShardShapeOp::getODSResultIndexAndLength(unsigned int)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::ShardingOp mlir::OpBuilder::create<mlir::mesh::ShardingOp, mlir::mesh::MeshSharding const&>(mlir::Location, mlir::mesh::MeshSharding const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_]+0x30): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_]+0x34): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh10ShardingOpEJRKNS2_12MeshShardingEEEET_NS_8LocationEDpOT0_]+0x70): undefined reference to `mlir::mesh::ShardingOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::mesh::MeshSharding)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::ProcessLinearIndexOp mlir::OpBuilder::create<mlir::mesh::ProcessLinearIndexOp, llvm::StringRef>(mlir::Location, llvm::StringRef&&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_]+0x30): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_]+0x34): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh20ProcessLinearIndexOpEJN4llvm9StringRefEEEET_NS_8LocationEDpOT0_]+0x60): undefined reference to `mlir::mesh::ProcessLinearIndexOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::StringRef)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::ShardShapeOp mlir::OpBuilder::create<mlir::mesh::ShardShapeOp, llvm::ArrayRef<long>, mlir::OpResult, mlir::Value&>(mlir::Location, llvm::ArrayRef<long>&&, mlir::OpResult&&, mlir::Value&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_]+0x3c): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_]+0x40): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_[_ZN4mlir9OpBuilder6createINS_4mesh12ShardShapeOpEJN4llvm8ArrayRefIlEENS_8OpResultERNS_5ValueEEEET_NS_8LocationEDpOT0_]+0x74): undefined reference to `mlir::mesh::ShardShapeOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::ArrayRef<long>, mlir::Value, mlir::Value)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::MeshOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::MeshOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::MeshOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh6MeshOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::MeshOp, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::ShardingOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ShardingOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh10ShardingOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::ProcessLinearIndexOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ProcessLinearIndexOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh20ProcessLinearIndexOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `llvm::DefaultDoCastIfPossible<mlir::mesh::ShardShapeOp, mlir::Operation*, llvm::CastInfo<mlir::mesh::ShardShapeOp, mlir::Operation*, void> >::doCastIfPossible(mlir::Operation*)':
ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x24): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_[_ZN4llvm23DefaultDoCastIfPossibleIN4mlir4mesh12ShardShapeOpEPNS1_9OperationENS_8CastInfoIS3_S5_vEEE16doCastIfPossibleES5_]+0x28): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
1366.667 [3370/13/3942] Building CXX object tools/mlir/lib/Target/SPIRV/CMakeFiles/obj.MLIRSPIRVBinaryUtils.dir/SPIRVBinaryUtils.cpp.o
1366.877 [3370/12/3943] Building CXX object tools/mlir/lib/Target/SPIRV/Serialization/CMakeFiles/obj.MLIRSPIRVSerialization.dir/SerializeOps.cpp.o
1366.910 [3370/11/3944] Building CXX object tools/mlir/lib/Target/SPIRV/Serialization/CMakeFiles/obj.MLIRSPIRVSerialization.dir/Serializer.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 7, 2024

LLVM Buildbot has detected a new failure on builder flang-aarch64-latest-gcc running on linaro-flang-aarch64-latest-gcc while building mlir at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/130/builds/1817

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
1422.171 [2898/17/4214] Creating library symlink lib/libMLIRNVGPUDialect.so
1423.046 [2898/16/4215] Building CXX object tools/mlir/lib/Dialect/XeGPU/IR/CMakeFiles/obj.MLIRXeGPUDialect.dir/XeGPUDialect.cpp.o
1423.560 [2898/15/4216] Building CXX object tools/mlir/lib/Dialect/X86Vector/Transforms/CMakeFiles/obj.MLIRX86VectorTransforms.dir/AVXTranspose.cpp.o
1424.535 [2898/14/4217] Building CXX object tools/mlir/lib/Target/Cpp/CMakeFiles/obj.MLIRTargetCpp.dir/TranslateToCpp.cpp.o
1424.547 [2896/15/4218] Creating library symlink lib/libMLIRAMDGPUUtils.so
1424.557 [2894/16/4219] Creating library symlink lib/libMLIROpenACCDialect.so
1424.791 [2894/15/4220] Linking CXX shared library lib/libMLIRX86VectorDialect.so.20.0git
1424.813 [2893/15/4221] Creating library symlink lib/libMLIRX86VectorDialect.so
1425.424 [2893/14/4222] Building CXX object tools/mlir/lib/Dialect/XeGPU/IR/CMakeFiles/obj.MLIRXeGPUDialect.dir/XeGPUOps.cpp.o
1425.578 [2893/13/4223] Linking CXX shared library lib/libMLIRTensorDialect.so.20.0git
FAILED: lib/libMLIRTensorDialect.so.20.0git 
: && /usr/local/bin/c++ -fPIC -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -O3 -DNDEBUG  -Wl,-z,defs -Wl,-z,nodelete   -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/./lib  -Wl,--gc-sections -shared -Wl,-soname,libMLIRTensorDialect.so.20.0git -o lib/libMLIRTensorDialect.so.20.0git tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorDialect.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorOps.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ValueBoundsOpInterfaceImpl.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib:/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib:"  lib/libMLIRAffineDialect.so.20.0git  lib/libMLIRParallelCombiningOpInterface.so.20.0git  lib/libMLIRMemRefDialect.so.20.0git  lib/libMLIRArithUtils.so.20.0git  lib/libMLIRComplexDialect.so.20.0git  lib/libMLIRArithAttrToLLVMConversion.so.20.0git  lib/libMLIRArithDialect.so.20.0git  lib/libMLIRCastInterfaces.so.20.0git  lib/libMLIRInferIntRangeCommon.so.20.0git  lib/libMLIRLLVMDialect.so.20.0git  lib/libLLVMBitWriter.so.20.0git  lib/libLLVMAsmParser.so.20.0git  lib/libLLVMBitReader.so.20.0git  lib/libMLIRDialectUtils.so.20.0git  lib/libMLIRShapedOpInterfaces.so.20.0git  lib/libMLIRValueBoundsOpInterface.so.20.0git  lib/libMLIRDestinationStyleOpInterface.so.20.0git  lib/libMLIRAnalysis.so.20.0git  lib/libMLIRInferTypeOpInterface.so.20.0git  lib/libMLIRSideEffectInterfaces.so.20.0git  lib/libMLIRLoopLikeInterface.so.20.0git  lib/libMLIRInferIntRangeInterface.so.20.0git  lib/libMLIRFunctionInterfaces.so.20.0git  lib/libMLIRCallInterfaces.so.20.0git  lib/libMLIRDataLayoutInterfaces.so.20.0git  lib/libMLIRPresburger.so.20.0git  lib/libMLIRViewLikeInterface.so.20.0git  lib/libLLVMCore.so.20.0git  lib/libLLVMBinaryFormat.so.20.0git  lib/libMLIRDialect.so.20.0git  lib/libMLIRControlFlowInterfaces.so.20.0git  lib/libMLIRMemorySlotInterfaces.so.20.0git  lib/libMLIRUBDialect.so.20.0git  lib/libMLIRIR.so.20.0git  lib/libMLIRSupport.so.20.0git  -lpthread  lib/libLLVMSupport.so.20.0git  -Wl,-rpath-link,/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/lib && :
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::mesh::ShardingOption const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE22getShardingAnnotationsEPKNS2_7ConceptEPNS_9OperationERKNS0_14ShardingOptionE+0x54): undefined reference to `mlir::mesh::detail::defaultGetShardingAnnotations(mlir::Operation*, mlir::mesh::ShardingOption const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::addShardingAnnotations(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE22addShardingAnnotationsEPKNS2_7ConceptEPNS_9OperationERNS_9OpBuilderERKNS0_14ShardingOptionE+0x70): undefined reference to `mlir::mesh::detail::defaultAddShardingAnnotations(mlir::Operation*, mlir::OpBuilder&, mlir::mesh::ShardingOption const&)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `mlir::mesh::detail::ShardingInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::EmptyOpShardingInterface>::getShardingOption(mlir::mesh::detail::ShardingInterfaceInterfaceTraits::Concept const*, mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>)':
ShardingInterfaceImpl.cpp:(.text._ZN4mlir4mesh6detail32ShardingInterfaceInterfaceTraits13FallbackModelIN12_GLOBAL__N_124EmptyOpShardingInterfaceEE17getShardingOptionEPKNS2_7ConceptEPNS_9OperationEN4llvm8ArrayRefINS0_12MeshShardingEEESF_+0x60): undefined reference to `mlir::mesh::detail::defaultGetShardingOption(mlir::Operation*, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>)'
/usr/bin/ld: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.o: in function `(anonymous namespace)::EmptyOpShardingInterface::spmdize(mlir::Operation*, llvm::ArrayRef<mlir::Value>, llvm::ArrayRef<mlir::mesh::MeshSharding>, llvm::ArrayRef<mlir::mesh::MeshSharding>, mlir::IRMapping&, mlir::SymbolTableCollection&, mlir::OpBuilder&) const [clone .isra.0]':
ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x94): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::MeshOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x98): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::MeshOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x184): undefined reference to `mlir::mesh::shardType(mlir::Type, mlir::mesh::MeshOp, mlir::mesh::MeshSharding)'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x534): undefined reference to `mlir::mesh::ShardShapeOp::getODSResultIndexAndLength(unsigned int)'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x698): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x69c): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x788): undefined reference to `mlir::mesh::ShardingOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::mesh::MeshSharding)'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x82c): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x830): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardingOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x86c): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x870): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ProcessLinearIndexOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x8b4): undefined reference to `mlir::mesh::ProcessLinearIndexOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::StringRef)'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x94c): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x950): undefined reference to `mlir::detail::TypeIDResolver<mlir::mesh::ShardShapeOp, void>::id'
/usr/bin/ld: ShardingInterfaceImpl.cpp:(.text._ZNK12_GLOBAL__N_124EmptyOpShardingInterface7spmdizeEPN4mlir9OperationEN4llvm8ArrayRefINS1_5ValueEEENS5_INS1_4mesh12MeshShardingEEESA_RNS1_9IRMappingERNS1_21SymbolTableCollectionERNS1_9OpBuilderE.isra.0+0x998): undefined reference to `mlir::mesh::ShardShapeOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::ArrayRef<long>, mlir::Value, mlir::Value)'
collect2: error: ld returned 1 exit status
1427.453 [2893/12/4224] Building CXX object tools/mlir/lib/Target/SPIRV/Serialization/CMakeFiles/obj.MLIRSPIRVSerialization.dir/Serializer.cpp.o
1428.787 [2893/11/4225] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/DebugTranslation.cpp.o
1428.903 [2893/10/4226] Building CXX object tools/mlir/lib/Dialect/Vector/Transforms/CMakeFiles/obj.MLIRVectorTransforms.dir/VectorEmulateMaskedLoadStore.cpp.o
1429.051 [2893/9/4227] Building CXX object tools/mlir/lib/Target/LLVMIR/CMakeFiles/obj.MLIRTargetLLVMIRExport.dir/LoopAnnotationTranslation.cpp.o
1430.746 [2893/8/4228] Building CXX object tools/mlir/lib/Dialect/SPIRV/IR/CMakeFiles/obj.MLIRSPIRVDialect.dir/SPIRVOpDefinition.cpp.o
1434.025 [2893/7/4229] Building CXX object tools/mlir/lib/Dialect/Vector/TransformOps/CMakeFiles/obj.MLIRVectorTransformOps.dir/VectorTransformOps.cpp.o
1437.915 [2893/6/4230] Building CXX object tools/mlir/lib/Dialect/Vector/Transforms/CMakeFiles/obj.MLIRVectorTransforms.dir/VectorEmulateNarrowType.cpp.o
In file included from ../llvm-project/mlir/include/mlir/Rewrite/FrozenRewritePatternSet.h:12,
                 from ../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:17,
                 from ../llvm-project/mlir/include/mlir/Dialect/Arith/Transforms/NarrowTypeEmulationConverter.h:13,
                 from ../llvm-project/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp:12:
../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h: In instantiation of ‘class mlir::OpConversionPattern<mlir::vector::StoreOp>’:
../llvm-project/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp:111:35:   required from here
../llvm-project/mlir/include/mlir/IR/PatternMatch.h:255:16: warning: ‘virtual void mlir::RewritePattern::rewrite(mlir::Operation*, mlir::PatternRewriter&) const’ was hidden [-Woverloaded-virtual=]

rengolin added a commit that referenced this pull request Aug 7, 2024
This reverts commit fca6983.

Also reverts the fixup: "[mlir] Fix -Wunused-variable in MeshOps.cpp (NFC)"

This reverts commit fc73736.
@rengolin
Copy link
Member

rengolin commented Aug 7, 2024

Reverted along with the fixup. Please build the projects that are failing in CI and run the tests above before creating a new PR.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 7, 2024

LLVM Buildbot has detected a new failure on builder premerge-monolithic-windows running on premerge-windows-1 while building mlir at step 5 "clean-build-dir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/35/builds/1679

Here is the relevant piece of the build log for the reference:

Step 5 (clean-build-dir) failure: Delete failed. (failure)
Step 7 (build-unified-tree) failure: build (failure)
...
[8294/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\FrontendAction.cpp.obj
[8295/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\CompilerInvocation.cpp.obj
[8296/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\FrontendOptions.cpp.obj
[8297/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\LangOptions.cpp.obj
[8298/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\TextDiagnosticPrinter.cpp.obj
[8299/12485] Linking CXX static library lib\FortranSemantics.lib
[8300/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\TextDiagnostic.cpp.obj
[8301/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\TextDiagnosticBuffer.cpp.obj
[8302/12485] Building CXX object tools\flang\lib\FrontendTool\CMakeFiles\flangFrontendTool.dir\ExecuteCompilerInvocation.cpp.obj
[8303/12485] Building CXX object tools\flang\lib\Optimizer\Builder\CMakeFiles\FIRBuilder.dir\Runtime\TemporaryStack.cpp.obj
FAILED: tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/TemporaryStack.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Optimizer\Builder -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Optimizer\Builder -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Optimizer\Builder\CMakeFiles\FIRBuilder.dir\Runtime\TemporaryStack.cpp.obj /Fdtools\flang\lib\Optimizer\Builder\CMakeFiles\FIRBuilder.dir\FIRBuilder.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Optimizer\Builder\Runtime\TemporaryStack.cpp
tools\mlir\include\mlir/Dialect/Arith/IR/ArithOps.h.inc(5074): fatal error C1060: compiler is out of heap space
[8304/12485] Building CXX object tools\flang\lib\Optimizer\Builder\CMakeFiles\FIRBuilder.dir\Runtime\Transformational.cpp.obj
FAILED: tools/flang/lib/Optimizer/Builder/CMakeFiles/FIRBuilder.dir/Runtime/Transformational.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Optimizer\Builder -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Optimizer\Builder -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Optimizer\Builder\CMakeFiles\FIRBuilder.dir\Runtime\Transformational.cpp.obj /Fdtools\flang\lib\Optimizer\Builder\CMakeFiles\FIRBuilder.dir\FIRBuilder.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Optimizer\Builder\Runtime\Transformational.cpp
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\time.h(297): fatal error C1060: compiler is out of heap space
[8305/12485] Building CXX object tools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\FrontendActions.cpp.obj
FAILED: tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendActions.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Frontend -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Frontend -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\FrontendActions.cpp.obj /Fdtools\flang\lib\Frontend\CMakeFiles\flangFrontend.dir\flangFrontend.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Frontend\FrontendActions.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(516): fatal error C1060: compiler is out of heap space
[8306/12485] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\VectorSubscripts.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/VectorSubscripts.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\VectorSubscripts.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\VectorSubscripts.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(718): fatal error C1060: compiler is out of heap space
[8307/12485] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\Runtime.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/Runtime.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\Runtime.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\Runtime.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(245): fatal error C1060: compiler is out of heap space
[8308/12485] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\Utils.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/Utils.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\Utils.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\Utils.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\variant(1491): fatal error C1060: compiler is out of heap space
[8309/12485] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\ReductionProcessor.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/ReductionProcessor.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\ReductionProcessor.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\ReductionProcessor.cpp
C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\ReductionProcessor.cpp(848): fatal error C1060: compiler is out of heap space
[8310/12485] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\PFTBuilder.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/PFTBuilder.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\PFTBuilder.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\PFTBuilder.cpp
C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include\flang/Lower/Support/Utils.h(603): fatal error C1060: compiler is out of heap space
[8311/12485] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\OpenMP.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenMP/OpenMP.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenMP\OpenMP.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenMP\OpenMP.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\type_traits(775): fatal error C1060: compiler is out of heap space
[8312/12485] Building CXX object tools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenACC.cpp.obj
FAILED: tools/flang/lib/Lower/CMakeFiles/FortranLower.dir/OpenACC.cpp.obj 
sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe  /nologo /TP -DBUILD_EXAMPLES -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\include -Itools\flang\include -Iinclude -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\mlir\include -Itools\mlir\include -Itools\clang\include -IC:\ws\buildbot\premerge-monolithic-windows\llvm-project\llvm\..\clang\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /O2 /Ob2  -MD  /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\flang\lib\Lower\CMakeFiles\FortranLower.dir\OpenACC.cpp.obj /Fdtools\flang\lib\Lower\CMakeFiles\FortranLower.dir\FortranLower.pdb /FS -c C:\ws\buildbot\premerge-monolithic-windows\llvm-project\flang\lib\Lower\OpenACC.cpp
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\type_traits(1530): fatal error C1060: compiler is out of heap space

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 11, 2024

LLVM Buildbot has detected a new failure on builder clang-arm64-windows-msvc-2stage running on linaro-armv8-windows-msvc-02 while building mlir at step 4 "build stage 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/124/builds/111

Here is the relevant piece of the build log for the reference:

Step 4 (build stage 1) failure: 'ninja' (failure)
...
[2156/8992] Building CXX object tools\clang\lib\ASTMatchers\CMakeFiles\obj.clangASTMatchers.dir\GtestMatchers.cpp.obj
[2157/8992] Building CXX object lib\Frontend\HLSL\CMakeFiles\LLVMFrontendHLSL.dir\HLSLResource.cpp.obj
[2158/8992] Building CXX object lib\Transforms\Instrumentation\CMakeFiles\LLVMInstrumentation.dir\AddressSanitizer.cpp.obj
[2159/8992] Building CXX object lib\Transforms\Instrumentation\CMakeFiles\LLVMInstrumentation.dir\BoundsChecking.cpp.obj
[2160/8992] Building CXX object lib\Transforms\Instrumentation\CMakeFiles\LLVMInstrumentation.dir\CGProfile.cpp.obj
[2161/8992] Building CXX object lib\Transforms\Instrumentation\CMakeFiles\LLVMInstrumentation.dir\ControlHeightReduction.cpp.obj
[2162/8992] Building CXX object lib\Transforms\Instrumentation\CMakeFiles\LLVMInstrumentation.dir\DataFlowSanitizer.cpp.obj
[2163/8992] Building CXX object lib\Transforms\Instrumentation\CMakeFiles\LLVMInstrumentation.dir\GCOVProfiling.cpp.obj
[2164/8992] Building CXX object lib\Transforms\Instrumentation\CMakeFiles\LLVMInstrumentation.dir\BlockCoverageInference.cpp.obj
[2165/8992] Building CXX object tools\mlir\lib\Dialect\Tensor\IR\CMakeFiles\obj.MLIRTensorDialect.dir\ShardingInterfaceImpl.cpp.obj
FAILED: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/ShardingInterfaceImpl.cpp.obj 
ccache C:\Users\tcwg\scoop\apps\llvm\current\bin\clang-cl.exe  /nologo -TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\stage1\tools\mlir\lib\Dialect\Tensor\IR -IC:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\lib\Dialect\Tensor\IR -IC:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\stage1\include -IC:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\llvm\include -IC:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include -IC:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\stage1\tools\mlir\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Oi /Brepro /bigobj /permissive- -Werror=unguarded-availability-new /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported /Gw -Wundef -Werror=mismatched-tags -Werror=global-constructors /O2 /Ob2  -std:c++17 -MD  /EHs-c- /GR- -UNDEBUG /showIncludes /Fotools\mlir\lib\Dialect\Tensor\IR\CMakeFiles\obj.MLIRTensorDialect.dir\ShardingInterfaceImpl.cpp.obj /Fdtools\mlir\lib\Dialect\Tensor\IR\CMakeFiles\obj.MLIRTensorDialect.dir\ -c -- C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\lib\Dialect\Tensor\IR\ShardingInterfaceImpl.cpp
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\lib\Dialect\Tensor\IR\ShardingInterfaceImpl.cpp:10:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Dialect/Mesh/Interfaces/ShardingInterface.h:12:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Dialect/Mesh/IR/MeshOps.h:12:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Bytecode/BytecodeOpInterface.h:17:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Bytecode/BytecodeImplementation.h:17:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/IR/Attributes.h:12:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/IR/AttributeSupport.h:16:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/IR/MLIRContext.h:13:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Support/TypeID.h:20:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\llvm\include\llvm/ADT/STLExtras.h:24:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\llvm\include\llvm/ADT/iterator.h:12:
C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\llvm\include\llvm/ADT/iterator_range.h(46,5): warning: '__GNUC__' is not defined, evaluates to 0 [-Wundef]
   46 | #if __GNUC__ == 7 || (__GNUC__ == 8 && __GNUC_MINOR__ < 4)
      |     ^
C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\llvm\include\llvm/ADT/iterator_range.h(46,23): warning: '__GNUC__' is not defined, evaluates to 0 [-Wundef]
   46 | #if __GNUC__ == 7 || (__GNUC__ == 8 && __GNUC_MINOR__ < 4)
      |                       ^
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\lib\Dialect\Tensor\IR\ShardingInterfaceImpl.cpp:10:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Dialect/Mesh/Interfaces/ShardingInterface.h:12:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Dialect/Mesh/IR/MeshOps.h:12:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Bytecode/BytecodeOpInterface.h:17:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Bytecode/BytecodeImplementation.h:19:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/IR/Dialect.h:17:
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/IR/OperationSupport.h:19:
C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/IR/BuiltinAttributes.h(359,14): warning: 'complex' is deprecated: warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning. [-Wdeprecated-declarations]
  359 |       return {APFloat(*smt, value.real()), APFloat(*smt, value.imag())};
      |              ^
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\complex(1302,5): note: 'complex' has been explicitly marked deprecated here
 1302 |     _DEPRECATE_NONFLOATING_COMPLEX
      |     ^
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\yvals_core.h(1339,7): note: expanded from macro '_DEPRECATE_NONFLOATING_COMPLEX'
 1339 |     [[deprecated("warning STL4037: "                                                   \
      |       ^
In file included from C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\lib\Dialect\Tensor\IR\ShardingInterfaceImpl.cpp:10:
C:\Users\tcwg\llvm-worker\clang-arm64-windows-msvc-2stage\llvm\mlir\include\mlir/Dialect/Mesh/Interfaces/ShardingInterface.h(84,10): fatal error: 'mlir/Dialect/Mesh/Interfaces/ShardingInterface.h.inc' file not found
   84 | #include "mlir/Dialect/Mesh/Interfaces/ShardingInterface.h.inc"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

rengolin pushed a commit that referenced this pull request Aug 12, 2024
This is a fixed copy of #98145 (necessary after it got reverted).

@sogartar @yaochengji
This PR adds the following to #98145:
- `UpdateHaloOp` accepts a `memref` (instead of a tensor) and not
returning a result to clarify its inplace-semantics
- `UpdateHaloOp` accepts `split_axis` to allow multiple mesh-axes per
tensor/memref-axis (similar to `mesh.sharding`)
- The implementation of `Shardinginterface` for tensor operation
(`tensor.empty` for now) moved from the tensor library to the mesh
interface library. `spmdize` uses features from `mesh` dialect.
@rengolin agreed that `tensor` should not depend on `mesh` so this
functionality cannot live in a `tensor`s lib. The unfulfilled dependency
caused the issues leading to reverting #98145. Such cases are generally
possible and might lead to re-considering the current structure (like
for tosa ops).
- rebased onto latest main
--------------------------
Replacing `#mesh.sharding` attribute with operation `mesh.sharding`
- extended semantics now allow providing optional `halo_sizes` and
`sharded_dims_sizes`
- internally a sharding is represented as a non-IR class
`mesh::MeshSharding`

What previously was
```mlir
%sharded0 = mesh.shard %arg0 <@Mesh0, [[0]]> : tensor<4x8xf32>
%sharded1 = mesh.shard %arg1 <@Mesh0, [[0]]> annotate_for_users : tensor<16x8xf32>
```
is now
```mlir
%sharding = mesh.sharding @Mesh0, [[0]] : !mesh.sharding
%0 = mesh.shard %arg0 to %sharding : tensor<4x8xf32>
%1 = mesh.shard %arg1 to %sharding annotate_for_users : tensor<16x8xf32>
```
and allows additional annotations to control the shard sizes:
```mlir
mesh.mesh @Mesh0 (shape = 4)
%sharding0 = mesh.sharding @Mesh0, [[0]] halo_sizes = [1, 2] : !mesh.sharding
%0 = mesh.shard %arg0 to %sharding0 : tensor<4x8xf32>
%sharding1 = mesh.sharding @Mesh0, [[0]] sharded_dims_sizes = [3, 5, 5, 3] : !mesh.sharding
%1 = mesh.shard %arg1 to %sharding1 annotate_for_users : tensor<16x8xf32>
```
- `mesh.shard` op accepts additional optional attribute `force`, useful
for halo updates
- Some initial spmdization support for the new semantics
- Support for `tensor.empty` reacting on `sharded_dims_sizes` and
`halo_sizes` in the sharding
- New collective operation `mesh.update_halo` as a spmdized target for
shardings with `halo_sizes`

---------

Co-authored-by: frank.schlimbach <[email protected]>
Co-authored-by: Jie Fu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants