Skip to content

Commit

Permalink
Single line syntax + introduce wrapConsectutiveOp header to fuseDequant.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Winata authored and monorimet committed Jan 15, 2024
1 parent 46492ed commit 2473cb4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "iree/compiler/Dialect/Flow/Transforms/RegionOpUtils.h"
#include "iree/compiler/GlobalOptimization/PassDetail.h"
#include "iree/compiler/GlobalOptimization/Passes.h"
#include "iree/compiler/GlobalOptimization/Utils.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
#include "mlir/Dialect/Linalg/IR/LinalgInterfaces.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

#define DEBUG_TYPE "iree-flow-convert-conv-nchw-to-nhwc"

namespace mlir {
namespace iree_compiler {
namespace IREE {
namespace mlir::iree_compiler::Preprocessing {

using TransposeIndices = SmallVector<int64_t, 4>;

Expand Down Expand Up @@ -559,6 +557,4 @@ createConvertConvNchwToNhwcPass() {
return std::make_unique<ConvertConvNchwToNhwcPass>();
}

} // namespace IREE
} // namespace iree_compiler
} // namespace mlir
} // namespace mlir::iree_compiler::Preprocessing
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@

#define DEBUG_TYPE "iree-preprocessing-convert-conv-to-channels-last"

namespace mlir {
namespace iree_compiler {
namespace IREE {
namespace mlir::iree_compiler::Preprocessing {

static const StringLiteral fullTileTransposeMarker = "__fully_transpose_tile__";

Expand Down Expand Up @@ -885,6 +883,4 @@ std::unique_ptr<Pass> createConvertConvToChannelsLastPass() {
return std::make_unique<ConvertConvToChannelsLastPass>();
}

} // namespace IREE
} // namespace iree_compiler
} // namespace mlir
} // namespace mlir::iree_compiler::Preprocessing
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"

namespace mlir {
namespace iree_compiler {
namespace IREE {
namespace mlir::iree_compiler::Preprocessing {

namespace {

Expand Down Expand Up @@ -63,6 +61,4 @@ std::unique_ptr<Pass> createGeneralizeConvolutionsPass() {
return std::make_unique<GeneralizeConvolutionsPass>();
}

} // namespace IREE
} // namespace iree_compiler
} // namespace mlir
} // namespace mlir::iree_compiler::Preprocessing
6 changes: 3 additions & 3 deletions compiler/src/iree/compiler/Preprocessing/Common/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def ConvertConvNchwToNhwc :
InterfacePass<"iree-flow-convert-conv-nchw-to-nhwc", "mlir::FunctionOpInterface"> {
let summary = "Convert linalg NCHW Convolutions to NHWC";
let constructor =
"mlir::iree_compiler::IREE::createConvertConvNchwToNhwcPass()";
"mlir::iree_compiler::Preprocessing::createConvertConvNchwToNhwcPass()";
}

def MakeSingleDispatchForFunction :
Expand All @@ -31,14 +31,14 @@ def MakeSingleDispatchForFunction :
def GeneralizeConvolutions :
Pass<"iree-preprocessing-generalize-convolutions", ""> {
let summary = "Generalize all convolution ops";
let constructor = "mlir::iree_compiler::IREE::createGeneralizeConvolutionsPass()";
let constructor = "mlir::iree_compiler::Preprocessing::createGeneralizeConvolutionsPass()";
}

def ConvertConvToChannelsLast :
Pass<"iree-preprocessing-convert-conv-to-channels-last", ""> {
let summary = "Convert linalg convolutions to channels last.";
let constructor =
"mlir::iree_compiler::IREE::createConvertConvToChannelsLastPass()";
"mlir::iree_compiler::Preprocessing::createConvertConvToChannelsLastPass()";
let options = [
Option<"tileSize", "tile-size", "int",
/*default=*/"0",
Expand Down

0 comments on commit 2473cb4

Please sign in to comment.