Skip to content

Commit 24c4f95

Browse files
committed
[mlir][linalg] Decompose winograd operators
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)
1 parent 374b0d5 commit 24c4f95

File tree

4 files changed

+892
-0
lines changed

4 files changed

+892
-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
@@ -1703,6 +1703,9 @@ void populateBlockPackMatmulPatterns(RewritePatternSet &patterns,
17031703
void populateWinogradConv2DPatterns(RewritePatternSet &patterns, int64_t m,
17041704
int64_t r);
17051705

1706+
/// Patterns to decompose Winograd operators.
1707+
void populateDecomposeWinogradOpsPatterns(RewritePatternSet &patterns);
1708+
17061709
} // namespace linalg
17071710
} // namespace mlir
17081711

0 commit comments

Comments
 (0)