Skip to content

Commit 1d34a28

Browse files
authored
Migrate IREE dialects to strict properties (#24983)
LLVM deprecated the legacy assembly treatment of attributes in llvm/llvm-project@c495a9b796c4. IREE temporarily opted eight dialects out during the LLVM integrate; this change removes those opt-outs and migrates them to strict properties. Update Codegen, VectorExt, Flow, HAL, LinalgExt, Stream, Util, and VM assembly formats, fixtures, examples, and generators. Add roundtrip coverage distinguishing properties from discardable attributes. Assisted-by: Codex --------- Signed-off-by: Jelle Schühmacher <schuehmacher@roofline.ai>
1 parent 4fc29b6 commit 1d34a28

237 files changed

Lines changed: 2407 additions & 2337 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎compiler/bindings/python/test/api/tuner_api_test.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ def test_isa_attention_op():
144144
%scale : f16,
145145
%output : tensor<20x4096x64xf16>
146146
) -> tensor<20x4096x64xf16> {
147-
%result = iree_linalg_ext.attention { root_op = #iree_codegen.root_op<set = 0>,
147+
%result = iree_linalg_ext.attention <
148148
indexing_maps = [
149149
affine_map<(d0, d1, d2, d3, d4) -> (d0, d1, d2)>,
150150
affine_map<(d0, d1, d2, d3, d4) -> (d0, d3, d2)>,
151151
affine_map<(d0, d1, d2, d3, d4) -> (d0, d3, d4)>,
152152
affine_map<(d0, d1, d2, d3, d4) -> ()>,
153153
affine_map<(d0, d1, d2, d3, d4) -> (d0, d1, d4)>
154154
]
155-
} ins(%q, %k, %v, %scale : tensor<20x4096x64xf16>, tensor<20x4096x64xf16>, tensor<20x4096x64xf16>, f16)
155+
> {root_op = #iree_codegen.root_op<set = 0>} ins(%q, %k, %v, %scale : tensor<20x4096x64xf16>, tensor<20x4096x64xf16>, tensor<20x4096x64xf16>, f16)
156156
outs(%output : tensor<20x4096x64xf16>) {
157157
^bb0(%score: f32):
158158
iree_linalg_ext.yield %score : f32

‎compiler/plugins/input/StableHLO/Conversion/StableHLOToIREEInputDialects.cpp‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,29 +406,28 @@ struct GenericTypeConvert final : ConversionPattern {
406406
LogicalResult
407407
matchAndRewrite(Operation *op, ArrayRef<Value> operands,
408408
ConversionPatternRewriter &rewriter) const override {
409-
llvm::SmallVector<NamedAttribute> newAttr;
410-
llvm::append_range(newAttr, op->getAttrs());
411-
412409
llvm::SmallVector<Type> newResults;
413410
if (failed(getTypeConverter()->convertTypes(op->getResultTypes(),
414411
newResults))) {
415412
return rewriter.notifyMatchFailure(op, "result type conversion failed");
416413
}
417414

418-
OperationState state(op->getLoc(), op->getName().getStringRef(), operands,
419-
newResults, newAttr, op->getSuccessors());
420-
for (Region &r : op->getRegions()) {
421-
Region *newRegion = state.addRegion();
422-
rewriter.inlineRegionBefore(r, *newRegion, newRegion->begin());
423-
TypeConverter::SignatureConversion result(newRegion->getNumArguments());
415+
Operation *newOp = op->clone(
416+
Operation::CloneOptions().withResultTypes(llvm::to_vector(newResults)));
417+
newOp->setOperands(operands);
418+
rewriter.insert(newOp);
419+
for (auto [r, newRegion] :
420+
llvm::zip_equal(op->getRegions(), newOp->getRegions())) {
421+
rewriter.inlineRegionBefore(r, newRegion, newRegion.begin());
422+
TypeConverter::SignatureConversion result(newRegion.getNumArguments());
424423
if (failed(getTypeConverter()->convertSignatureArgs(
425-
newRegion->getArgumentTypes(), result))) {
424+
newRegion.getArgumentTypes(), result))) {
426425
return rewriter.notifyMatchFailure(op,
427426
"argument type conversion failed");
428427
}
429-
rewriter.applySignatureConversion(&newRegion->front(), result);
428+
rewriter.applySignatureConversion(&newRegion.front(), result);
430429
}
431-
Operation *newOp = rewriter.create(state);
430+
432431
rewriter.replaceOp(op, newOp->getResults());
433432
return success();
434433
}

‎compiler/plugins/input/TOSA/InputConversion/Converti48Toi64.cpp‎

Lines changed: 74 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,36 @@ struct i48Toi64Converter : TypeConverter {
4545
}
4646
};
4747

48+
static Attribute
49+
convertIntegerAttributeIfNeeded(Attribute attr,
50+
const TypeConverter &converter) {
51+
auto typedAttr = dyn_cast<TypedAttr>(attr);
52+
if (!typedAttr) {
53+
return attr;
54+
}
55+
Type newType = converter.convertType(typedAttr.getType());
56+
if (!newType || newType == typedAttr.getType()) {
57+
return attr;
58+
}
59+
if (auto intAttr = dyn_cast<IntegerAttr>(attr)) {
60+
if (auto intType = dyn_cast<IntegerType>(newType)) {
61+
return IntegerAttr::get(intType, intAttr.getValue().getZExtValue());
62+
}
63+
}
64+
if (auto shapedType = dyn_cast<ShapedType>(newType)) {
65+
if (auto denseAttr = dyn_cast<DenseIntElementsAttr>(attr)) {
66+
auto elementType = dyn_cast<IntegerType>(shapedType.getElementType());
67+
if (elementType) {
68+
return denseAttr.mapValues(
69+
elementType, [&elementType](const APInt &value) {
70+
return APInt(elementType.getWidth(), value.getZExtValue());
71+
});
72+
}
73+
}
74+
}
75+
return attr;
76+
}
77+
4878
// Handles the type conversion component of the TypeConversion. This updates
4979
// conversion patterns that used the original i48 tensor types to be
5080
// updated to the i64 variants.
@@ -60,65 +90,46 @@ class GenericTypeConvert : public ConversionPattern {
6090
return rewriter.notifyMatchFailure(op, "is a func op");
6191
}
6292

63-
llvm::SmallVector<Type, 4> oldAttrTypes;
64-
llvm::SmallVector<unsigned, 4> typedIndices;
65-
66-
// Extract the typed attributes for conversion.
67-
for (auto [index, attr] : llvm::enumerate(op->getAttrs())) {
68-
if (auto typedAttr = dyn_cast<TypedAttr>(attr.getValue())) {
69-
oldAttrTypes.push_back(typedAttr.getType());
70-
typedIndices.push_back(index);
71-
}
93+
if (failed(getTypeConverter()->convertTypes(op->getResultTypes(),
94+
newResults))) {
95+
return rewriter.notifyMatchFailure(op, "result type conversion failed");
7296
}
73-
74-
llvm::SmallVector<Type, 4> newAttrTypes;
75-
(void)getTypeConverter()->convertTypes(oldAttrTypes, newAttrTypes);
76-
77-
llvm::SmallVector<NamedAttribute, 4> newAttrs(op->getAttrs());
78-
for (auto [idx, typedIndex] : llvm::enumerate(typedIndices)) {
79-
auto attrValue = newAttrs[typedIndex].getValue();
80-
auto newAttrType = newAttrTypes[idx];
81-
82-
// For integer attributes, create a new integer of new width.
83-
if (auto intAttr = dyn_cast<IntegerAttr>(attrValue)) {
84-
if (auto intType = dyn_cast<IntegerType>(newAttrType)) {
85-
auto value =
86-
IntegerAttr::get(intType, intAttr.getValue().getZExtValue());
87-
newAttrs[typedIndex] =
88-
NamedAttribute(newAttrs[typedIndex].getName(), value);
89-
continue;
90-
}
97+
Operation *newOp = op->clone(
98+
Operation::CloneOptions().withResultTypes(llvm::to_vector(newResults)));
99+
bool conversionFailed = false;
100+
newOp->getName().walkInherentAttrs(newOp, [&](StringRef, Attribute &attr) {
101+
if (Attribute converted =
102+
convertIntegerAttributeIfNeeded(attr, *getTypeConverter())) {
103+
attr = converted;
104+
} else {
105+
conversionFailed = true;
91106
}
92-
93-
// For shaped types, map the values to the new types.
94-
if (auto shapedType = dyn_cast<ShapedType>(newAttrType)) {
95-
if (auto denseAttr = dyn_cast<DenseIntElementsAttr>(attrValue)) {
96-
auto eType = dyn_cast<IntegerType>(shapedType.getElementType());
97-
auto cast = [&](APInt value) {
98-
return APInt(eType.getWidth(), value.getZExtValue());
99-
};
100-
auto newDenseAttr = denseAttr.mapValues(eType, cast);
101-
newAttrs[typedIndex] =
102-
NamedAttribute(newAttrs[typedIndex].getName(), newDenseAttr);
103-
continue;
104-
}
107+
});
108+
SmallVector<NamedAttribute> attrs;
109+
for (NamedAttribute attr : op->getDiscardableAttrs()) {
110+
if (Attribute converted = convertIntegerAttributeIfNeeded(
111+
attr.getValue(), *getTypeConverter())) {
112+
attrs.emplace_back(attr.getName(), converted);
113+
} else {
114+
conversionFailed = true;
105115
}
106-
return rewriter.notifyMatchFailure(op, "Unsupported input type");
107116
}
108-
109-
(void)getTypeConverter()->convertTypes(op->getResultTypes(), newResults);
110-
111-
OperationState state(op->getLoc(), op->getName().getStringRef(), operands,
112-
newResults, newAttrs, op->getSuccessors());
113-
for (Region &r : op->getRegions()) {
114-
Region *newRegion = state.addRegion();
115-
rewriter.inlineRegionBefore(r, *newRegion, newRegion->begin());
116-
TypeConverter::SignatureConversion result(newRegion->getNumArguments());
117+
if (conversionFailed) {
118+
newOp->destroy();
119+
return rewriter.notifyMatchFailure(op, "unsupported attribute type");
120+
}
121+
newOp->setDiscardableAttrs(attrs);
122+
newOp->setOperands(operands);
123+
rewriter.insert(newOp);
124+
for (auto [r, newRegion] :
125+
llvm::zip_equal(op->getRegions(), newOp->getRegions())) {
126+
rewriter.inlineRegionBefore(r, newRegion, newRegion.begin());
127+
TypeConverter::SignatureConversion result(newRegion.getNumArguments());
117128
(void)getTypeConverter()->convertSignatureArgs(
118-
newRegion->getArgumentTypes(), result);
119-
rewriter.applySignatureConversion(&newRegion->front(), result);
129+
newRegion.getArgumentTypes(), result);
130+
rewriter.applySignatureConversion(&newRegion.front(), result);
120131
}
121-
Operation *newOp = rewriter.create(state);
132+
122133
rewriter.replaceOp(op, newOp->getResults());
123134
return success();
124135
}
@@ -159,14 +170,18 @@ void Converti48Toi64Pass::runOnOperation() {
159170
return false;
160171
}
161172
}
162-
for (auto attr : op->getAttrs()) {
163-
if (auto typedAttr = dyn_cast<TypedAttr>(attr.getValue())) {
164-
if (isIllegalType(typedAttr.getType())) {
165-
return false;
166-
}
173+
bool legal = true;
174+
auto check = [&](Attribute attr) {
175+
if (auto typedAttr = dyn_cast<TypedAttr>(attr)) {
176+
legal &= !isIllegalType(typedAttr.getType());
167177
}
178+
};
179+
op->getName().walkInherentAttrs(
180+
op, [&](StringRef, Attribute &attr) { check(attr); });
181+
for (NamedAttribute attr : op->getDiscardableAttrs()) {
182+
check(attr.getValue());
168183
}
169-
return true;
184+
return legal;
170185
});
171186

172187
auto *ctx = &getContext();

‎compiler/plugins/input/TOSA/InputConversion/StripSignedness.cpp‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,19 @@ class GenericTypeConvert : public ConversionPattern {
6161
}
6262

6363
(void)getTypeConverter()->convertTypes(op->getResultTypes(), newResults);
64-
OperationState state(op->getLoc(), op->getName().getStringRef(), operands,
65-
newResults, op->getAttrs(), op->getSuccessors());
66-
for (Region &r : op->getRegions()) {
67-
Region *newRegion = state.addRegion();
68-
rewriter.inlineRegionBefore(r, *newRegion, newRegion->begin());
69-
TypeConverter::SignatureConversion result(newRegion->getNumArguments());
64+
Operation *newOp = op->clone(
65+
Operation::CloneOptions().withResultTypes(llvm::to_vector(newResults)));
66+
newOp->setOperands(operands);
67+
rewriter.insert(newOp);
68+
for (auto [r, newRegion] :
69+
llvm::zip_equal(op->getRegions(), newOp->getRegions())) {
70+
rewriter.inlineRegionBefore(r, newRegion, newRegion.begin());
71+
TypeConverter::SignatureConversion result(newRegion.getNumArguments());
7072
(void)getTypeConverter()->convertSignatureArgs(
71-
newRegion->getArgumentTypes(), result);
72-
rewriter.applySignatureConversion(&newRegion->front(), result);
73+
newRegion.getArgumentTypes(), result);
74+
rewriter.applySignatureConversion(&newRegion.front(), result);
7375
}
74-
Operation *newOp = rewriter.create(state);
76+
7577
rewriter.replaceOp(op, newOp->getResults());
7678
return success();
7779
}

‎compiler/plugins/input/Torch/InputConversion/test/attention.mlir‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func.func @attention(%arg0: tensor<5x2x3x4xf32>, %arg1: tensor<5x2x3x4xf32>, %ar
1616
// CHECK-SAME: %[[ARG3:.*]]: tensor<5x2x3x4xf32>) -> tensor<5x2x3x4xf32> {
1717
// CHECK: %[[SCALE:.*]] = arith.constant 5.000000e-01 : f32
1818
// CHECK: %[[EMPTY:.*]] = tensor.empty() : tensor<5x2x3x4xf32>
19-
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention {indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]} ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<5x2x3x4xf32>, tensor<5x2x3x4xf32>, tensor<5x2x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<5x2x3x4xf32>) {
19+
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention <indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]> ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<5x2x3x4xf32>, tensor<5x2x3x4xf32>, tensor<5x2x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<5x2x3x4xf32>) {
2020
// CHECK: ^[[BLOCK:.+]](%[[SCORE:.+]]: f32):
2121
// CHECK: linalg_ext.yield %[[SCORE]]
2222
// CHECK: } -> tensor<5x2x3x4xf32>
@@ -39,7 +39,7 @@ func.func @attention(%arg0: tensor<5x2x8x4xf32>, %arg1: tensor<5x2x3x4xf32>, %ar
3939
// CHECK-SAME: %[[ARG3:.*]]: tensor<5x2x8x4xf32>) -> tensor<5x2x8x4xf32> {
4040
// CHECK: %[[SCALE:.*]] = arith.constant 5.000000e-01 : f32
4141
// CHECK: %[[EMPTY:.*]] = tensor.empty() : tensor<5x2x8x4xf32>
42-
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention {indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]} ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<5x2x8x4xf32>, tensor<5x2x3x4xf32>, tensor<5x2x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<5x2x8x4xf32>) {
42+
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention <indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]> ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<5x2x8x4xf32>, tensor<5x2x3x4xf32>, tensor<5x2x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<5x2x8x4xf32>) {
4343
// CHECK: ^[[BLOCK:.+]](%[[SCORE:.+]]: f32):
4444
// CHECK: linalg_ext.yield %[[SCORE]]
4545
// CHECK: } -> tensor<5x2x8x4xf32>
@@ -62,7 +62,7 @@ func.func @attention(%arg0: tensor<1x3x4xf32>, %arg1: tensor<1x3x4xf32>, %arg2:
6262
// CHECK-SAME: %[[ARG3:.*]]: tensor<1x3x4xf32>) -> tensor<1x3x4xf32> {
6363
// CHECK: %[[SCALE:.*]] = arith.constant 5.000000e-01 : f32
6464
// CHECK: %[[EMPTY:.*]] = tensor.empty() : tensor<1x3x4xf32>
65-
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention {indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]} ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<1x3x4xf32>, tensor<1x3x4xf32>, tensor<1x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<1x3x4xf32>) {
65+
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention <indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]> ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<1x3x4xf32>, tensor<1x3x4xf32>, tensor<1x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<1x3x4xf32>) {
6666
// CHECK: ^[[BLOCK:.+]](%[[SCORE:.+]]: f32):
6767
// CHECK: linalg_ext.yield %[[SCORE]]
6868
// CHECK: } -> tensor<1x3x4xf32>
@@ -85,7 +85,7 @@ func.func @attention_scaled(%arg0: tensor<1x3x4xf32>, %arg1: tensor<1x3x4xf32>,
8585
// CHECK-SAME: %[[ARG3:.*]]: tensor<1x3x4xf32>) -> tensor<1x3x4xf32> {
8686
// CHECK: %[[SCALE:.*]] = arith.constant 1.250000e-01 : f32
8787
// CHECK: %[[EMPTY:.*]] = tensor.empty() : tensor<1x3x4xf32>
88-
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention {indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]} ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<1x3x4xf32>, tensor<1x3x4xf32>, tensor<1x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<1x3x4xf32>) {
88+
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention <indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]> ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<1x3x4xf32>, tensor<1x3x4xf32>, tensor<1x3x4xf32>, f32) outs(%[[EMPTY]] : tensor<1x3x4xf32>) {
8989
// CHECK: ^[[BLOCK:.+]](%[[SCORE:.+]]: f32):
9090
// CHECK: linalg_ext.yield %[[SCORE]]
9191
// CHECK: } -> tensor<1x3x4xf32>
@@ -112,7 +112,7 @@ func.func @attention_dyn(%arg0: tensor<?x?x4xf32>, %arg1: tensor<?x?x4xf32>, %ar
112112
// CHECK-DAG: %[[DIM0:.*]] = tensor.dim %[[ARG0]], %[[C0]]
113113
// CHECK-DAG: %[[DIM1:.*]] = tensor.dim %[[ARG0]], %[[C1]]
114114
// CHECK-DAG: %[[EMPTY:.*]] = tensor.empty(%[[DIM0]], %[[DIM1]]) : tensor<?x?x4xf32>
115-
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention {indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]} ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<?x?x4xf32>, tensor<?x?x4xf32>, tensor<?x?x4xf32>, f32) outs(%[[EMPTY]] : tensor<?x?x4xf32>) {
115+
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention <indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]> ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<?x?x4xf32>, tensor<?x?x4xf32>, tensor<?x?x4xf32>, f32) outs(%[[EMPTY]] : tensor<?x?x4xf32>) {
116116
// CHECK: ^[[BLOCK:.+]](%[[SCORE:.+]]: f32):
117117
// CHECK: linalg_ext.yield %[[SCORE]]
118118
// CHECK: } -> tensor<?x?x4xf32>
@@ -144,7 +144,7 @@ func.func @attention_dyn_head_dim(%arg0: tensor<?x?x?xf32>, %arg1: tensor<?x?x?x
144144
// CHECK: %[[HEAD_DIM_I64:.*]] = arith.index_cast %[[HEAD_DIM]] : index to i64
145145
// CHECK: %[[HEAD_DIM_F32:.*]] = arith.sitofp %[[HEAD_DIM_I64]] : i64 to f32
146146
// CHECK: %[[SCALE:.*]] = math.rsqrt %[[HEAD_DIM_F32]] : f32
147-
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention {indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]} ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<?x?x?xf32>, tensor<?x?x?xf32>, tensor<?x?x?xf32>, f32) outs(%[[EMPTY]] : tensor<?x?x?xf32>) {
147+
// CHECK: %[[ATTN:.*]] = iree_linalg_ext.attention <indexing_maps = [#[[$MAP_Q]], #[[$MAP_K]], #[[$MAP_V]], #[[$MAP_S]], #[[$MAP_O]]]> ins(%[[ARG0]], %[[ARG1]], %[[ARG2]], %[[SCALE]] : tensor<?x?x?xf32>, tensor<?x?x?xf32>, tensor<?x?x?xf32>, f32) outs(%[[EMPTY]] : tensor<?x?x?xf32>) {
148148
// CHECK: ^[[BLOCK:.+]](%[[SCORE:.+]]: f32):
149149
// CHECK: linalg_ext.yield %[[SCORE]]
150150
// CHECK: } -> tensor<?x?x?xf32>

‎compiler/plugins/input/Torch/InputConversion/test/torch_to_iree.mlir‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ func.func @forward(%arg0: !torch.vtensor<[128,20],f32>) -> !torch.vtensor<[128,3
2323
%6 = torch.aten.add.Tensor %3, %5, %int1_2 : !torch.vtensor<[128,30],f32>, !torch.vtensor<[30],f32>, !torch.int -> !torch.vtensor<[128,30],f32>
2424
return %6 : !torch.vtensor<[128,30],f32>
2525
}
26-
util.global private @_params.classifier.weight {inlining_policy = #util.inline.never} : tensor<30x20xf32>
27-
util.global private @_params.classifier.bias {inlining_policy = #util.inline.never} : tensor<30xf32>
26+
util.global private @_params.classifier.weight <inlining_policy = #util.inline.never> : tensor<30x20xf32>
27+
util.global private @_params.classifier.bias <inlining_policy = #util.inline.never> : tensor<30xf32>
2828

2929
// -----
3030

‎compiler/plugins/target/CUDA/test/smoketest.mlir‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ stream.executable public @mul_dispatch_executable {
7171
// PTX: mul.rn.f32
7272

7373
// CHECK: hal.executable public @smoketest_linked
74-
// CHECK-NEXT: hal.executable.binary public @cuda_nvptx_fb attributes {
75-
// CHECK-SAME: data = dense
74+
// CHECK-NEXT: hal.executable.binary public @cuda_nvptx_fb <
7675
// CHECK-SAME: format = "cuda-nvptx-fb"
76+
// CHECK-SAME: data = dense

‎compiler/plugins/target/LLVMCPU/builtins/ukernel/test/e2e_inner_tiled_pipeline.mlir‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ hal.executable private @bf16_inner_tiled_ukernel {
6969
%acc_t = iree_tensor_ext.dispatch.tensor.load %out,
7070
offsets = [0, 0, 0, 0], sizes = [2, 2, 1, 16], strides = [1, 1, 1, 1]
7171
: !iree_tensor_ext.dispatch.tensor<readwrite:tensor<2x2x1x16xf32>> -> tensor<2x2x1x16xf32>
72-
%res = iree_codegen.inner_tiled ins(%lhs_t, %rhs_t) outs(%acc_t) {
72+
%res = iree_codegen.inner_tiled ins(%lhs_t, %rhs_t) outs(%acc_t) <
7373
indexing_maps = [
7474
affine_map<(d0, d1, d2) -> (d0, d2)>,
7575
affine_map<(d0, d1, d2) -> (d1, d2)>,
@@ -80,7 +80,7 @@ hal.executable private @bf16_inner_tiled_ukernel {
8080
#linalg.iterator_type<reduction>],
8181
kind = #iree_cpu.data_tiled_mma_layout<intrinsic = MMA_X86_AVX512BF16_1x16x2_F32_BF16>,
8282
semantics = #iree_cpu.mma_semantics<>
83-
} : tensor<2x4x1x2xbf16>, tensor<2x4x16x2xbf16> into tensor<2x2x1x16xf32>
83+
> : tensor<2x4x1x2xbf16>, tensor<2x4x16x2xbf16> into tensor<2x2x1x16xf32>
8484
iree_tensor_ext.dispatch.tensor.store %res, %out,
8585
offsets = [0, 0, 0, 0], sizes = [2, 2, 1, 16], strides = [1, 1, 1, 1]
8686
: tensor<2x2x1x16xf32> -> !iree_tensor_ext.dispatch.tensor<readwrite:tensor<2x2x1x16xf32>>

0 commit comments

Comments
 (0)