[Mlir-commits] [mlir] f2f65ed - [mlir][transform] Add support for transform.param pad multiples in `PadOp` (#90755)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat May 4 15:34:44 PDT 2024
Author: srcarroll
Date: 2024-05-04T17:34:40-05:00
New Revision: f2f65eddc5d9804a32a2427cd2ac96647005f889
URL: https://github.com/llvm/llvm-project/commit/f2f65eddc5d9804a32a2427cd2ac96647005f889
DIFF: https://github.com/llvm/llvm-project/commit/f2f65eddc5d9804a32a2427cd2ac96647005f889.diff
LOG: [mlir][transform] Add support for transform.param pad multiples in `PadOp` (#90755)
This patch modifies the definition of `PadOp` to take transform params
and handles for the `pad_to_multiple_of` operand.
---------
Co-authored-by: Oleksandr "Alex" Zinenko <ftynse at gmail.com>
Added:
Modified:
mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
mlir/python/mlir/dialects/transform/structured.py
mlir/test/Dialect/Linalg/transform-op-pad.mlir
mlir/test/python/dialects/transform_structured_ext.py
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td b/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
index d0ad4ccdf031d9..55d82fd5825bf7 100644
--- a/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
+++ b/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
@@ -978,8 +978,8 @@ def PackTransposeOp : Op<Transform_Dialect, "structured.pack_transpose", [
//===----------------------------------------------------------------------===//
def PadOp : Op<Transform_Dialect, "structured.pad",
- [FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
- DeclareOpInterfaceMethods<TransformOpInterface>,
+ [FunctionalStyleTransformOpTrait, DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
+ TransformOpInterface,
ReportTrackingListenerFailuresOpTrait]> {
let description = [{
Pads the operations pointed to by the target handle using the options
@@ -1011,7 +1011,9 @@ def PadOp : Op<Transform_Dialect, "structured.pad",
(ins TransformHandleTypeInterface:$target,
DefaultValuedAttr<ArrayAttr, "{}">:$padding_values,
DefaultValuedAttr<I64ArrayAttr, "{}">:$padding_dimensions,
- OptionalAttr<I64ArrayAttr>:$pad_to_multiple_of,
+ Variadic<TransformAnyParamTypeOrAnyHandle>:$pad_to_multiple_of,
+ DefaultValuedOptionalAttr<DenseI64ArrayAttr, "{}">:
+ $static_pad_to_multiple_of,
DefaultValuedAttr<I64ArrayAttr, "{}">:$pack_paddings,
DefaultValuedAttr<
TypedArrayAttrBase<I64ArrayAttr, "array of arrays of i64">,
@@ -1021,8 +1023,13 @@ def PadOp : Op<Transform_Dialect, "structured.pad",
TransformHandleTypeInterface:$pad,
TransformHandleTypeInterface:$copy);
- let assemblyFormat =
- "$target attr-dict `:` functional-type(operands, results)";
+ let assemblyFormat = [{
+ $target
+ (`pad_to_multiple_of` custom<DynamicIndexList>($pad_to_multiple_of, $static_pad_to_multiple_of)^)?
+ attr-dict
+ `:` functional-type(operands, results)
+ }];
+
let hasVerifier = 1;
let builders = [
@@ -1033,7 +1040,13 @@ def PadOp : Op<Transform_Dialect, "structured.pad",
// TODO: support other operations (e.g. min, max etc).
OpBuilder<(ins "Value":$target,
"ArrayRef<int64_t>":$paddingDimensions,
- CArg<"ArrayRef<int64_t>", "{}">:$padToMultipleOf,
+ CArg<"ArrayRef<int64_t>", "{}">:$staticPadToMultipleOf,
+ CArg<"ArrayRef<int64_t>", "{}">:$packPaddings,
+ CArg<"ArrayRef<Attribute>", "{}">:$transposePaddings,
+ CArg<"StringRef", "::mlir::bufferization::MaterializeInDestinationOp::getOperationName()">:$copyBackOp)>,
+ OpBuilder<(ins "Value":$target,
+ "ArrayRef<int64_t>":$paddingDimensions,
+ "ArrayRef<OpFoldResult>":$mixedPadToMultipleOf,
CArg<"ArrayRef<int64_t>", "{}">:$packPaddings,
CArg<"ArrayRef<Attribute>", "{}">:$transposePaddings,
CArg<"StringRef", "::mlir::bufferization::MaterializeInDestinationOp::getOperationName()">:$copyBackOp)>
@@ -1043,11 +1056,13 @@ def PadOp : Op<Transform_Dialect, "structured.pad",
/// copy_back_op attribute value indicating that no copy back is desired.
static constexpr StringRef kCopyOpNone = "none";
- ::mlir::DiagnosedSilenceableFailure applyToOne(
- ::mlir::transform::TransformRewriter &rewriter,
- ::mlir::linalg::LinalgOp target,
- ::mlir::transform::ApplyToEachResultList &results,
- ::mlir::transform::TransformState &state);
+ /// Returns a mix of dynamic `pad_to_multiple_of` and static `static_pad_to_multiple_of`.
+ SmallVector<OpFoldResult> getMixedPadToMultipleOf();
+
+ ::mlir::DiagnosedSilenceableFailure apply(
+ ::mlir::transform::TransformRewriter &rewriter,
+ ::mlir::transform::TransformResults &results,
+ ::mlir::transform::TransformState &state);
}];
}
diff --git a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
index 156784f0e67402..eadd819bee740c 100644
--- a/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
+++ b/mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
@@ -171,6 +171,54 @@ static DiagnosedSilenceableFailure unpackSingleIndexResultPayloadOperations(
return DiagnosedSilenceableFailure::success();
}
+/// When possible, converts each `OpFoldResult` in `mixedResult` to
+/// an integer if the value can be statically inferred. If a result
+/// is a `Value` then it must be either a `ParamType` or a handle
+/// to an a constant like op.
+static DiagnosedSilenceableFailure reifyMixedParamAndHandleResults(
+ TransformState &state, TransformOpInterface &transformOp,
+ ArrayRef<OpFoldResult> mixedResults, SmallVectorImpl<int64_t> &reified) {
+ for (OpFoldResult paramOrHandle : mixedResults) {
+ if (isa<Attribute>(paramOrHandle)) {
+ reified.push_back(
+ cast<IntegerAttr>(paramOrHandle.get<Attribute>()).getInt());
+ continue;
+ } else if (isa<ParamType>(paramOrHandle.get<Value>().getType())) {
+ ArrayRef<Attribute> params = state.getParams(paramOrHandle.get<Value>());
+ if (params.size() != 1)
+ return transformOp.emitSilenceableError() << "expected a single param";
+ reified.push_back(
+ cast<IntegerAttr>(params.front()).getValue().getSExtValue());
+ continue;
+ }
+
+ Value handle = paramOrHandle.get<Value>();
+ if (!isa<TransformHandleTypeInterface>(handle.getType()))
+ return transformOp.emitSilenceableError() << "unexpected value handle";
+ auto payload = state.getPayloadOps(handle);
+ if (!llvm::hasSingleElement(payload))
+ return transformOp.emitSilenceableError()
+ << "requires param or handle that is mapped to 1 payload op";
+
+ Operation *paramOrHandlePayloadOp = *payload.begin();
+ if (paramOrHandlePayloadOp->getNumResults() != 1 ||
+ !paramOrHandlePayloadOp->getResult(0).getType().isIndex()) {
+ return transformOp.emitSilenceableError()
+ << "requires param or handle to be result of op with 1 index "
+ "result";
+ }
+
+ IntegerAttr attr;
+ if (!matchPattern(paramOrHandlePayloadOp->getResult(0), m_Constant(&attr)))
+ return transformOp.emitSilenceableError()
+ << "requires param or handle to be the result of a constant like "
+ "op";
+
+ reified.push_back(attr.getInt());
+ }
+ return DiagnosedSilenceableFailure::success();
+}
+
//===----------------------------------------------------------------------===//
// Apply...PatternsOp
//===----------------------------------------------------------------------===//
@@ -1664,6 +1712,8 @@ transform::PackTransposeOp::apply(transform::TransformRewriter &rewriter,
// PadOp
//===---------------------------------------------------------------------===//
+static const StringLiteral kPadToMultipleOfKeyword = "pad_to_multiple_of";
+
void transform::PadOp::build(OpBuilder &b, OperationState &result, Value target,
ArrayRef<int64_t> paddingDimensions,
ArrayRef<int64_t> padToMultipleOf,
@@ -1677,18 +1727,60 @@ void transform::PadOp::build(OpBuilder &b, OperationState &result, Value target,
/*target=*/target,
/*paddingValues=*/ArrayAttr(), // let inference handle this
/*paddingDimensions=*/b.getI64ArrayAttr(paddingDimensions),
+ /*padToMultipleOf=*/ValueRange{},
/*padToMultipleOf=*/
- (padToMultipleOf.empty() ? ArrayAttr()
- : b.getI64ArrayAttr(padToMultipleOf)),
+ (padToMultipleOf.empty()
+ ? DenseI64ArrayAttr()
+ : b.getDenseI64ArrayAttr(padToMultipleOf)),
+ /*packPaddings=*/b.getI64ArrayAttr(packPaddings),
+ /*transposePaddings=*/b.getArrayAttr(transposePaddings),
+ /*copyBackOp=*/b.getStringAttr(copyBackOp));
+}
+
+void transform::PadOp::build(OpBuilder &b, OperationState &result, Value target,
+ ArrayRef<int64_t> paddingDimensions,
+ ArrayRef<OpFoldResult> mixedPadToMultipleOf,
+ ArrayRef<int64_t> packPaddings,
+ ArrayRef<Attribute> transposePaddings,
+ StringRef copyBackOp) {
+ auto resultType = transform::AnyOpType::get(b.getContext());
+ SmallVector<int64_t> staticPadToMultipleOf;
+ SmallVector<Value> dynamicPadToMultipleOf;
+ dispatchIndexOpFoldResults(mixedPadToMultipleOf, dynamicPadToMultipleOf,
+ staticPadToMultipleOf);
+ return build(/*builder=*/b,
+ /*result=*/result,
+ /*types=*/TypeRange{resultType, resultType},
+ /*target=*/target,
+ /*paddingValues=*/ArrayAttr(), // let inference handle this
+ /*paddingDimensions=*/b.getI64ArrayAttr(paddingDimensions),
+ /*padToMultipleOf=*/dynamicPadToMultipleOf,
+ /*padToMultipleOf=*/staticPadToMultipleOf,
/*packPaddings=*/b.getI64ArrayAttr(packPaddings),
/*transposePaddings=*/b.getArrayAttr(transposePaddings),
/*copyBackOp=*/b.getStringAttr(copyBackOp));
}
+void PadOp::getEffects(
+ SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
+ consumesHandle(getTarget(), effects);
+ onlyReadsHandle(getPadToMultipleOf(), effects);
+ producesHandle(getPadded(), effects);
+ producesHandle(getPad(), effects);
+ producesHandle(getCopy(), effects);
+ modifiesPayload(effects);
+}
+
+SmallVector<OpFoldResult> PadOp::getMixedPadToMultipleOf() {
+ Builder b(getContext());
+ return getMixedValues(getStaticPadToMultipleOf(), getPadToMultipleOf(), b);
+}
+
DiagnosedSilenceableFailure
transform::PadOp::apply(transform::TransformRewriter &rewriter,
transform::TransformResults &results,
transform::TransformState &state) {
+ auto transformOp = cast<TransformOpInterface>(getOperation());
SmallVector<Operation *> paddedOps, padOps, copyBackOps;
for (Operation *target : state.getPayloadOps(getTarget())) {
@@ -1749,10 +1841,16 @@ transform::PadOp::apply(transform::TransformRewriter &rewriter,
LinalgPaddingOptions options;
options.paddingDimensions =
extractFromIntegerArrayAttr<int64_t>(getPaddingDimensions());
- SmallVector<int64_t> padToMultipleOf(options.paddingDimensions.size(), 1);
- if (getPadToMultipleOf().has_value())
+
+ SmallVector<int64_t> padToMultipleOf;
+ DiagnosedSilenceableFailure status = reifyMixedParamAndHandleResults(
+ state, transformOp, getMixedPadToMultipleOf(), padToMultipleOf);
+ if (!status.succeeded())
+ return status;
+ if (padToMultipleOf.empty())
padToMultipleOf =
- extractFromIntegerArrayAttr<int64_t>(*getPadToMultipleOf());
+ SmallVector<int64_t>(options.paddingDimensions.size(), 1);
+
options.padToMultipleOf = padToMultipleOf;
options.paddingValues = paddingValues;
options.packPaddings = packPaddings;
@@ -1819,8 +1917,8 @@ LogicalResult transform::PadOp::verify() {
"integers, found "
<< getPaddingDimensions();
}
- if (getPadToMultipleOf().has_value()) {
- if (getPadToMultipleOf()->size() != paddingDimensions.size()) {
+ if (!getMixedPadToMultipleOf().empty()) {
+ if (getMixedPadToMultipleOf().size() != paddingDimensions.size()) {
return emitOpError() << "expects as many multiples as padding_dimensions";
}
}
@@ -3204,49 +3302,12 @@ DiagnosedSilenceableFailure transform::VectorizeOp::apply(
auto targets = state.getPayloadOps(getTarget());
if (std::empty(targets))
return DiagnosedSilenceableFailure::success();
-
+ auto transformOp = cast<TransformOpInterface>(getOperation());
SmallVector<int64_t> vectorSizes;
- for (OpFoldResult sz : getMixedVectorSizes()) {
- if (sz.is<Attribute>()) {
- auto attr = sz.get<Attribute>();
- vectorSizes.push_back(cast<IntegerAttr>(attr).getInt());
- continue;
- } else if (sz.is<Value>() && isa<ParamType>(sz.get<Value>().getType())) {
- ArrayRef<Attribute> params = state.getParams(sz.get<Value>());
- if (params.size() != 1)
- return emitSilenceableFailure(getLoc()) << "expected a single param";
- vectorSizes.push_back(
- cast<IntegerAttr>(params.front()).getValue().getSExtValue());
- continue;
- }
-
- auto szPayloads = state.getPayloadOps(sz.get<Value>());
- if (!llvm::hasSingleElement(szPayloads)) {
- auto diag = this->emitOpError(
- "requires vector size handle that is mapped to 1 payload op");
- diag.attachNote(sz.get<Value>().getLoc())
- << "mapped to " << llvm::range_size(szPayloads) << " payload ops";
- return DiagnosedSilenceableFailure::definiteFailure();
- }
-
- Operation *szPayloadOp = *szPayloads.begin();
- if (szPayloadOp->getNumResults() != 1 ||
- !szPayloadOp->getResult(0).getType().isIndex()) {
- auto diag = this->emitOpError(
- "requires vector size payload op with 1 index result");
- diag.attachNote(szPayloadOp->getLoc()) << "vector size payload op";
- return DiagnosedSilenceableFailure::definiteFailure();
- }
-
- IntegerAttr attr;
- if (!matchPattern(szPayloadOp->getResult(0), m_Constant(&attr))) {
- auto diag = this->emitOpError("requires constant vector size");
- diag.attachNote(szPayloadOp->getLoc()) << "vector size payload op";
- return DiagnosedSilenceableFailure::definiteFailure();
- }
-
- vectorSizes.push_back(attr.getInt());
- }
+ DiagnosedSilenceableFailure status = reifyMixedParamAndHandleResults(
+ state, transformOp, getMixedVectorSizes(), vectorSizes);
+ if (!status.succeeded())
+ return status;
// TODO: Check that the correct number of vectorSizes was provided.
for (Operation *target : targets) {
diff --git a/mlir/python/mlir/dialects/transform/structured.py b/mlir/python/mlir/dialects/transform/structured.py
index d7b41c0bd2207d..2c49ef0960c756 100644
--- a/mlir/python/mlir/dialects/transform/structured.py
+++ b/mlir/python/mlir/dialects/transform/structured.py
@@ -374,9 +374,9 @@ def __init__(
self,
target: Union[Operation, OpView, Value],
*,
+ pad_to_multiple_of: Optional[Union[DynamicIndexList, ArrayAttr]] = None,
padding_values: Optional[Union[ArrayAttr, Sequence[Attribute]]] = None,
padding_dimensions: OptionalIntList = None,
- pad_to_multiple_of: OptionalIntList = None,
pack_paddings: OptionalIntList = None,
transpose_paddings: Optional[
Union[ArrayAttr, Sequence[Union[ArrayAttr, IntOrAttrList]]]
@@ -385,6 +385,16 @@ def __init__(
loc=None,
ip=None,
):
+ if pad_to_multiple_of is None:
+ dynamic_pad_to_multiple_of = []
+ static_pad_to_multiple_of = None
+ else:
+ (
+ dynamic_pad_to_multiple_of,
+ static_pad_to_multiple_of,
+ _,
+ ) = _dispatch_dynamic_index_list(pad_to_multiple_of)
+
transpose_paddings = _get_int_array_array_attr(transpose_paddings)
any_op_type = transform.AnyOpType.get()
@@ -393,9 +403,10 @@ def __init__(
any_op_type,
any_op_type,
target,
+ pad_to_multiple_of=dynamic_pad_to_multiple_of,
padding_values=padding_values,
padding_dimensions=padding_dimensions,
- pad_to_multiple_of=pad_to_multiple_of,
+ static_pad_to_multiple_of=static_pad_to_multiple_of,
pack_paddings=pack_paddings,
transpose_paddings=transpose_paddings,
copy_back_op=copy_back_op,
diff --git a/mlir/test/Dialect/Linalg/transform-op-pad.mlir b/mlir/test/Dialect/Linalg/transform-op-pad.mlir
index d27276cda49dc4..47bb5ddf4afc3e 100644
--- a/mlir/test/Dialect/Linalg/transform-op-pad.mlir
+++ b/mlir/test/Dialect/Linalg/transform-op-pad.mlir
@@ -73,10 +73,9 @@ func.func @pad_to_multiple(%arg0: tensor<24x12xf32>,
module attributes {transform.with_named_sequence} {
transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) {
%0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
- %padded, %pad, %copy_back = transform.structured.pad %0 {
+ %padded, %pad, %copy_back = transform.structured.pad %0 pad_to_multiple_of [2, 2, 1] {
padding_values=[0.0 : f32, 0.0 : f32, 0.0 : f32],
padding_dimensions=[0, 1, 2],
- pad_to_multiple_of=[2, 2, 1],
pack_paddings=[1, 1, 0]
} : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
transform.yield
@@ -87,6 +86,42 @@ module attributes {transform.with_named_sequence} {
#map = affine_map<()[s0] -> (-s0 + 12, 7)>
+// CHECK-LABEL: @parametrized_pad_to_multiple
+func.func @parametrized_pad_to_multiple(%arg0: tensor<24x12xf32>,
+ %arg1: tensor<12x25xf32>,
+ %arg2: tensor<24x25xf32>,
+ %iv0 : index, %iv1 : index, %iv2 : index) -> tensor<24x25xf32> {
+ %0 = affine.min #map()[%iv2]
+ %1 = tensor.extract_slice %arg0[%iv0, %iv2] [4, %0] [1, 1] : tensor<24x12xf32> to tensor<4x?xf32>
+ %2 = tensor.extract_slice %arg1[%iv2, %iv1] [%0, 5] [1, 1] : tensor<12x25xf32> to tensor<?x5xf32>
+ %3 = tensor.extract_slice %arg2[%iv0, %iv1] [4, 5] [1, 1] : tensor<24x25xf32> to tensor<4x5xf32>
+
+ // CHECK: linalg.matmul
+ // CHECK-SAME: ins(%{{.*}}, %{{.*}} : tensor<4x7xf32>, tensor<7x6xf32>)
+ // CHECK-SAME: outs(%{{.*}} : tensor<4x6xf32>)
+ %4 = linalg.matmul ins(%1, %2 : tensor<4x?xf32>, tensor<?x5xf32>) outs(%3 : tensor<4x5xf32>) -> tensor<4x5xf32>
+ %5 = tensor.insert_slice %4 into %arg2[%iv0, %iv1] [4, 5] [1, 1] : tensor<4x5xf32> into tensor<24x25xf32>
+ func.return %5 : tensor<24x25xf32>
+}
+
+
+module attributes {transform.with_named_sequence} {
+ transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) {
+ %0 = transform.structured.match ops{["linalg.matmul"]} in %arg1 : (!transform.any_op) -> !transform.any_op
+ %c2 = transform.param.constant 2 : i64 -> !transform.param<i64>
+ %padded, %pad, %copy_back = transform.structured.pad %0 pad_to_multiple_of [%c2, 2, 1] {
+ padding_values=[0.0 : f32, 0.0 : f32, 0.0 : f32],
+ padding_dimensions=[0, 1, 2],
+ pack_paddings=[1, 1, 0]
+ } : (!transform.any_op, !transform.param<i64>) -> (!transform.any_op, !transform.any_op, !transform.any_op)
+ transform.yield
+ }
+}
+
+// -----
+
+#map = affine_map<()[s0] -> (-s0 + 12, 7)>
+
// CHECK-LABEL: @static_sizes_output_divisible_on_empty_op
func.func @static_sizes_output_divisible_on_empty_op(%arg0: tensor<24x12xf32>,
%arg1: tensor<12x25xf32>, %arg2: tensor<24x25xf32>, %iv0: index,
diff --git a/mlir/test/python/dialects/transform_structured_ext.py b/mlir/test/python/dialects/transform_structured_ext.py
index 91ecd0fc38e174..f4c092ba9ee98f 100644
--- a/mlir/test/python/dialects/transform_structured_ext.py
+++ b/mlir/test/python/dialects/transform_structured_ext.py
@@ -8,6 +8,7 @@
from mlir.dialects import pdl
from mlir.dialects.transform import structured
from mlir.dialects.transform import pdl as transform_pdl
+from mlir.dialects.transform.extras import constant_param
def run(f):
@@ -315,9 +316,9 @@ def testPadOpNoArgs(target):
def testPadOpArgs(target):
structured.PadOp(
target,
+ pad_to_multiple_of=[128],
padding_values=[FloatAttr.get_f32(42.0), StringAttr.get("0")],
padding_dimensions=Attribute.parse("[1]"),
- pad_to_multiple_of=[128],
pack_paddings=[0],
transpose_paddings=[[1, Attribute.parse("0")], Attribute.parse("[0, 1]")],
copy_back_op="linalg.copy",
@@ -325,14 +326,30 @@ def testPadOpArgs(target):
# CHECK-LABEL: TEST: testPadOpArgs
# CHECK: transform.sequence
# CHECK: transform.structured.pad
+ # CHECK-DAG: pad_to_multiple_of [128]
# CHECK-DAG: copy_back_op = "linalg.copy"
# CHECK-DAG: pack_paddings = [0]
- # CHECK-DAG: pad_to_multiple_of = [128]
# CHECK-DAG: padding_dimensions = [1]
# CHECK-DAG: padding_values = [4.200000e+01 : f32, "0"]
# CHECK-DAG: transpose_paddings = {{\[}}[1, 0], [0, 1]]
+ at run
+ at create_sequence
+def testPadOpArgsParam(target):
+ structured.PadOp(
+ target,
+ pad_to_multiple_of=[constant_param(128), Attribute.parse("2"), 10],
+ padding_dimensions=Attribute.parse("[0, 1, 2]"),
+ )
+ # CHECK-LABEL: TEST: testPadOpArgsParam
+ # CHECK: transform.sequence
+ # CHECK-DAG: %[[P:.*]] = transform.param.constant 128
+ # CHECK: transform.structured.pad
+ # CHECK-DAG: pad_to_multiple_of [%[[P]], 2, 10]
+ # CHECK-DAG: padding_dimensions = [0, 1, 2]
+
+
@run
@create_sequence
def testScalarize(target):
More information about the Mlir-commits
mailing list