Skip to content

Commit 27ee33d

Browse files
authored
[mlir][linalg] Decompose winograd operators (#96183)
Convert Linalg winograd_filter_transform, winograd_input_transform, and winograd_output_transform into nested loops with matrix multiplication with constant transform matrices. Support several configurations of Winograd Conv2D, including F(2, 3), F(4, 3) and F(2, 5). These configurations show that the implementation can support different kernel size (3 and 5) and different output size (2 and 4). Besides symetric kernel size 3x3 and 5x5, this patch also supports 1x3, 3x1, 1x5, and 5x1 kernels. The implementation is based on the paper, Fast Algorithm for Convolutional Neural Networks. (https://arxiv.org/abs/1509.09308) Reviewers: ftynse, Max191, GeorgeARM, nicolasvasilache, MaheshRavishankar, dcaballe, rengolin Reviewed By: ftynse, Max191 Pull Request: #96183
1 parent 5338bd3 commit 27ee33d

File tree

4 files changed

+990
-0
lines changed

4 files changed

+990
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,9 @@ void populateBlockPackMatmulPatterns(RewritePatternSet &patterns,
17461746
void populateWinogradConv2DPatterns(RewritePatternSet &patterns, int64_t m,
17471747
int64_t r);
17481748

1749+
/// Patterns to decompose Winograd operators.
1750+
void populateDecomposeWinogradOpsPatterns(RewritePatternSet &patterns);
1751+
17491752
/// Adds patterns that reduce the rank of named contraction ops that have
17501753
/// unit dimensions in the operand(s) by converting to a sequence of `collapse_shape`,
17511754
/// `<corresponding linalg named op>`, `expand_shape` (if on tensors). For example a

0 commit comments

Comments
 (0)