Skip to content

Commit

Permalink
Optionally apply Conv -> Img2col transformation at the flow level (ir…
Browse files Browse the repository at this point in the history
…ee-org#5596)

- An alternative is to apply this after dispatching into workgroup tiles but its running throw multiple hops of issues related to
reshapes semantics subtensor inserts.
  • Loading branch information
asaadaldien authored and simon-camp committed Apr 29, 2021
1 parent d2757e4 commit 0f4f09e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions iree/compiler/Dialect/Flow/Transforms/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ static llvm::cl::opt<bool> clEnable1x1ConvToMatmul(
"matmul ops pass."),
llvm::cl::init(true));

static llvm::cl::opt<bool> clEnableConvToImg2Col(
"iree-flow-enable-conv-img2col-transform",
llvm::cl::desc("Enable converting convolution ops to img2col form."),
llvm::cl::init(false));

namespace mlir {
namespace iree_compiler {
namespace IREE {
Expand Down Expand Up @@ -207,6 +212,10 @@ void buildFlowTransformPassPipeline(OpPassManager &passManager,
passManager.addNestedPass<FuncOp>(
mlir::iree_compiler::createConvert1x1ConvToMatmulPass());
}
if (clEnableConvToImg2Col) {
passManager.addNestedPass<FuncOp>(
mlir::iree_compiler::createConvertConv2DToImg2ColPass());
}

passManager.addNestedPass<FuncOp>(
mlir::createConvertElementwiseToLinalgPass());
Expand Down

0 comments on commit 0f4f09e

Please sign in to comment.