Skip to content

Commit 466abaf

Browse files
committed
Revert "[MLIR][Mesh] Add sharding propagation pass (#69665)"
This reverts commit 9d9400d. This reverts commit bda763a. The buildbot is broken and tests are failing.
1 parent bda763a commit 466abaf

23 files changed

+5
-1468
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
add_subdirectory(Interfaces)
21
add_subdirectory(IR)
3-
add_subdirectory(Transforms)

mlir/include/mlir/Dialect/Mesh/IR/MeshBase.td

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,6 @@ def Mesh_Partial : I32EnumAttr<"Partial", "partial type of a distributed tensor"
4949
let cppNamespace = "::mlir::mesh";
5050
}
5151

52-
// Mesh_IteratorType and Mesh_Partial are used to annotate different aspects of
53-
// distributed tensors. Mesh_IteratorType annotates loops in an operation, while
54-
// Mesh_Partial indicates whether a tensor is sharded on a specific dimension or
55-
// is partial.
56-
def Mesh_IteratorType : I32EnumAttr<"IteratorType", "Iterator type", [
57-
I32EnumAttrCase<"Parallel", 1, "parallel">,
58-
I32EnumAttrCase<"ReductionSum", 2, "reduction_sum">,
59-
I32EnumAttrCase<"ReductionMax", 3, "reduction_max">,
60-
I32EnumAttrCase<"ReductionMin", 4, "reduction_min">,
61-
I32EnumAttrCase<"ReductionGeneric", 5, "reduction_generic">,
62-
I32EnumAttrCase<"Invalid", 100, "invalid">
63-
]> {
64-
let genSpecializedAttr = 0;
65-
let cppNamespace = "::mlir::mesh";
66-
}
67-
6852
//===----------------------------------------------------------------------===//
6953
// Mesh Attribute
7054
//===----------------------------------------------------------------------===//
@@ -138,24 +122,6 @@ def MeshSharding : AttrDef<Mesh_Dialect, "MeshSharding"> {
138122
$partial_axes^ `]`)? `>`
139123
}];
140124

141-
let builders = [
142-
AttrBuilder<(ins "SymbolRefAttr":$cluster,
143-
"ArrayRef<SmallVector<int32_t>>":$split_axes,
144-
"ArrayRef<int32_t>": $partial_axes,
145-
"mesh::Partial": $partial_type), [{
146-
SmallVector<DenseI32ArrayAttr> splitAxesAttr = llvm::map_to_vector(
147-
split_axes, [&](ArrayRef<int32_t> array) {
148-
return DenseI32ArrayAttr::get($_ctxt, array);
149-
});
150-
return $_get($_ctxt, cluster, splitAxesAttr, partial_axes,
151-
partial_type);
152-
}]>,
153-
AttrBuilder<(ins "SymbolRefAttr":$cluster,
154-
"ArrayRef<SmallVector<int32_t>>":$split_axes), [{
155-
return MeshShardingAttr::get($_ctxt, cluster, split_axes, {}, Partial::Sum);
156-
}]>
157-
];
158-
159125
let genVerifyDecl = 1;
160126
}
161127

mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,4 @@
2424
#define GET_OP_CLASSES
2525
#include "mlir/Dialect/Mesh/IR/MeshOps.h.inc"
2626

27-
namespace mlir {
28-
namespace mesh {
29-
30-
bool isReductionLoop(IteratorType iType);
31-
32-
bool areReductionAndPartialMatch(IteratorType iType, Partial partial);
33-
34-
template <typename T>
35-
void removeTrailingEmptySubArray(SmallVector<SmallVector<T>> &array) {
36-
while (!array.empty() && array.back().empty())
37-
array.pop_back();
38-
}
39-
40-
Partial getPartialTypeFromReduction(IteratorType iType);
41-
42-
} // namespace mesh
43-
} // namespace mlir
44-
4527
#endif // MLIR_DIALECT_MESH_IR_MESHOPS_H

mlir/include/mlir/Dialect/Mesh/Interfaces/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

mlir/include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.h

Lines changed: 0 additions & 68 deletions
This file was deleted.

mlir/include/mlir/Dialect/Mesh/Interfaces/ShardingInterface.td

Lines changed: 0 additions & 102 deletions
This file was deleted.

mlir/include/mlir/Dialect/Mesh/Transforms/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

mlir/include/mlir/Dialect/Mesh/Transforms/Passes.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

mlir/include/mlir/Dialect/Mesh/Transforms/Passes.td

Lines changed: 0 additions & 32 deletions
This file was deleted.

mlir/include/mlir/Dialect/Tosa/IR/ShardingInterfaceImpl.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

mlir/include/mlir/IR/AffineMap.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,6 @@ class AffineMap {
104104
static AffineMap getPermutationMap(ArrayRef<unsigned> permutation,
105105
MLIRContext *context);
106106

107-
/// Returns an affine map with `numDims` input dimensions and results
108-
/// specified by `targets`.
109-
///
110-
/// Examples:
111-
/// * getMultiDimMapWithTargets(3, [0, 2, 1])
112-
/// -> affine_map<(d0, d1, d2) -> (d0, d2, d1)>
113-
/// * getMultiDimMapWithTargets(3, [2, 1])
114-
/// -> affine_map<(d0, d1, d2) -> (d2, d1)>
115-
static AffineMap getMultiDimMapWithTargets(unsigned numDims,
116-
ArrayRef<unsigned> targets,
117-
MLIRContext *context);
118-
119107
/// Returns a vector of AffineMaps; each with as many results as
120108
/// `exprs.size()`, as many dims as the largest dim in `exprs` and as many
121109
/// symbols as the largest symbol in `exprs`.

mlir/include/mlir/InitAllDialects.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
#include "mlir/Dialect/Tensor/TransformOps/TensorTransformOps.h"
8080
#include "mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h"
8181
#include "mlir/Dialect/Tensor/Transforms/SubsetInsertionOpInterfaceImpl.h"
82-
#include "mlir/Dialect/Tosa/IR/ShardingInterfaceImpl.h"
8382
#include "mlir/Dialect/Tosa/IR/TosaOps.h"
8483
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
8584
#include "mlir/Dialect/Transform/PDLExtension/PDLExtension.h"
@@ -172,7 +171,6 @@ inline void registerAllDialects(DialectRegistry &registry) {
172171
tensor::registerSubsetOpInterfaceExternalModels(registry);
173172
tensor::registerTilingInterfaceExternalModels(registry);
174173
tensor::registerValueBoundsOpInterfaceExternalModels(registry);
175-
tosa::registerShardingInterfaceExternalModels(registry);
176174
vector::registerBufferizableOpInterfaceExternalModels(registry);
177175
vector::registerSubsetOpInterfaceExternalModels(registry);
178176
NVVM::registerNVVMTargetInterfaceExternalModels(registry);

0 commit comments

Comments
 (0)