Skip to content

Commit 8f5649c

Browse files
committed
Revert "[mlir][linalg] Add transform operator for Winograd Conv2D algorithm"
This reverts commit 374b0d5.
1 parent 398d00e commit 8f5649c

File tree

5 files changed

+0
-177
lines changed

5 files changed

+0
-177
lines changed

mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,55 +2587,4 @@ def MapCopyToThreadsOp :
25872587
}];
25882588
}
25892589

2590-
//===----------------------------------------------------------------------===//
2591-
// Winograd Conv2D
2592-
//===----------------------------------------------------------------------===//
2593-
2594-
def WinogradConv2DOp : Op<Transform_Dialect,
2595-
"structured.winograd_conv2d",
2596-
[FunctionalStyleTransformOpTrait, MemoryEffectsOpInterface,
2597-
TransformOpInterface, TransformEachOpTrait,
2598-
ReportTrackingListenerFailuresOpTrait]> {
2599-
let description = [{
2600-
Winograd Conv2D algorithm will convert linalg Conv2D operator into batched
2601-
matrix multiply. Before the matrix multiply, it will convert filter and
2602-
input into a format suitable for batched matrix multiply. After the matrix
2603-
multiply, it will convert output to the final result tensor.
2604-
2605-
The algorithm F(m x m, r x r) is
2606-
2607-
Y = A^T x [(G x g x G^T) @ (B^T x d x B)] x A
2608-
2609-
The size of output Y is m x m. The size of filter g is r x r. The size of
2610-
input d is (m + r - 1) x (m + r - 1). A^T, A, G^T, G, B^T, and B are
2611-
transformation matrices.
2612-
2613-
#### Return modes:
2614-
2615-
This operation fails if `target` is unsupported. Otherwise, the operation
2616-
succeeds and returns a handle of the sequence that replaces the original
2617-
convolution.
2618-
}];
2619-
2620-
let arguments = (ins TransformHandleTypeInterface:$target,
2621-
I64Attr:$m,
2622-
I64Attr:$r);
2623-
let results = (outs TransformHandleTypeInterface:$transformed);
2624-
2625-
let assemblyFormat =
2626-
"$target attr-dict `:` functional-type($target, results)";
2627-
2628-
let builders = [
2629-
OpBuilder<(ins "Value":$target)>
2630-
];
2631-
2632-
let extraClassDeclaration = [{
2633-
::mlir::DiagnosedSilenceableFailure applyToOne(
2634-
::mlir::transform::TransformRewriter &rewriter,
2635-
::mlir::linalg::LinalgOp target,
2636-
::mlir::transform::ApplyToEachResultList &results,
2637-
::mlir::transform::TransformState &state);
2638-
}];
2639-
}
2640-
26412590
#endif // LINALG_TRANSFORM_OPS

mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,13 +1312,6 @@ FailureOr<Operation *> transposeBatchMatmul(RewriterBase &rewriter,
13121312
linalg::BatchMatmulOp op,
13131313
bool transposeLHS = true);
13141314

1315-
/// Convert linalg.conv_2d_nhwc_fhwc to Winograd Conv2D algorithm
1316-
/// F(m x m, r x r). m is the dimension size of output and r is the dimension
1317-
/// size of filter.
1318-
FailureOr<Operation *> winogradConv2D(RewriterBase &rewriter,
1319-
linalg::Conv2DNhwcFhwcOp op, int64_t m,
1320-
int64_t r);
1321-
13221315
//===----------------------------------------------------------------------===//
13231316
// Rewrite patterns wrapping transformations.
13241317
// TODO: every single such pattern should be a close to noop wrapper around a

mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,31 +3480,6 @@ DiagnosedSilenceableFailure transform::MapCopyToThreadsOp::applyToOne(
34803480
return DiagnosedSilenceableFailure::success();
34813481
}
34823482

3483-
//===----------------------------------------------------------------------===//
3484-
// WinogradConv2DOp
3485-
//===----------------------------------------------------------------------===//
3486-
3487-
DiagnosedSilenceableFailure transform::WinogradConv2DOp::applyToOne(
3488-
transform::TransformRewriter &rewriter, linalg::LinalgOp target,
3489-
transform::ApplyToEachResultList &results,
3490-
transform::TransformState &state) {
3491-
rewriter.setInsertionPoint(target);
3492-
auto maybeTransformed =
3493-
TypeSwitch<Operation *, FailureOr<Operation *>>(target)
3494-
.Case([&](linalg::Conv2DNhwcFhwcOp op) {
3495-
return winogradConv2D(rewriter, op, getM(), getR());
3496-
})
3497-
.Default([&](Operation *op) {
3498-
return rewriter.notifyMatchFailure(op, "not supported");
3499-
});
3500-
3501-
if (failed(maybeTransformed))
3502-
return emitDefaultSilenceableFailure(target);
3503-
3504-
results.push_back(*maybeTransformed);
3505-
return DiagnosedSilenceableFailure::success();
3506-
}
3507-
35083483
#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOpsEnums.cpp.inc"
35093484

35103485
#define GET_OP_CLASSES

mlir/lib/Dialect/Linalg/Transforms/WinogradConv2D.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,6 @@ class WinogradConv2DNhwcFhwc final
311311
} // end anonymous namespace
312312

313313
//===----------------------------------------------------------------------===//
314-
FailureOr<Operation *> winogradConv2D(RewriterBase &rewriter,
315-
linalg::Conv2DNhwcFhwcOp op, int64_t m,
316-
int64_t r) {
317-
return winogradConv2DHelper(rewriter, op, m, r);
318-
}
319-
320314
void populateWinogradConv2DPatterns(RewritePatternSet &patterns, int64_t m,
321315
int64_t r) {
322316
MLIRContext *context = patterns.getContext();

mlir/test/Dialect/Linalg/transform-winograd-conv2d.mlir

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

0 commit comments

Comments
 (0)