Skip to content

Commit

Permalink
[MHLO] Init MHLO pooling-like op conversion
Browse files Browse the repository at this point in the history
Co-authored-by: Bairen Yi <yibairen.byron@bytedance.com>
Co-authored-by: Jiawei Wu <xremold@gmail.com>
Co-authored-by: Tianyou Guo tianyou.gty@alibaba-inc.com
Co-authored-by: Xu Yan <yancey.yx@alibaba-inc.com>
Co-authored-by: Ziheng Jiang <ziheng.jiang@bytedance.com>
  • Loading branch information
Vremold committed Aug 4, 2022
1 parent 48ec300 commit 144c4e9
Show file tree
Hide file tree
Showing 6 changed files with 791 additions and 11 deletions.
7 changes: 2 additions & 5 deletions lib/Conversion/TorchToMhlo/BasicOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "torch-mlir/Dialect/Torch/Utils/TorchUpstream.h"
#include "torch-mlir/Dialect/Torch/Utils/Utils.h"
#include "torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.h"
#include "mlir-hlo/Dialect/mhlo/IR/chlo_ops.h"
#include <iostream>
#include <numeric>

Expand Down Expand Up @@ -618,9 +617,8 @@ LogicalResult ConvertAtenOp<AtenReluOp>::matchAndRewrite(
namespace {
template <>
LogicalResult ConvertAtenOp<AtenGeluOp>::matchAndRewrite(
AtenGeluOp op,
OpAdaptor adaptor,
ConversionPatternRewriter& rewriter) const {
AtenGeluOp op, OpAdaptor adaptor,
ConversionPatternRewriter &rewriter) const {
Location loc = op.getLoc();
Value input = adaptor.self();
auto inputTy = input.getType().template dyn_cast<RankedTensorType>();
Expand All @@ -641,7 +639,6 @@ LogicalResult ConvertAtenOp<AtenGeluOp>::matchAndRewrite(
}
} // namespace


// AtenErfOp
namespace {
template <>
Expand Down
1 change: 1 addition & 0 deletions lib/Conversion/TorchToMhlo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ add_mlir_conversion_library(TorchMLIRTorchToMhlo
GatherOp.cpp
ViewLikeOps.cpp
ReductionOp.cpp
PoolingOp.cpp

ADDITIONAL_HEADER_DIRS
${PROJECT_SOURCE_DIR}/include/torch-mlir/Conversion/TorchToMhlo
Expand Down
Loading

0 comments on commit 144c4e9

Please sign in to comment.