Skip to content

Commit

Permalink
[MHLO] Init MHLO pooling-like op conversion (#1141)
Browse files Browse the repository at this point in the history
* [MHLO] Init MHLO pooling-like op conversion and remove 'op' suffix in filenames

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>

See RFC #999
  • Loading branch information
Vremold authored Aug 4, 2022
1 parent f0a24f5 commit d030591
Show file tree
Hide file tree
Showing 10 changed files with 798 additions and 19 deletions.
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
9 changes: 5 additions & 4 deletions lib/Conversion/TorchToMhlo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
add_mlir_conversion_library(TorchMLIRTorchToMhlo
TorchToMhlo.cpp
MhloLegalizeUtils.cpp
BasicOp.cpp
GatherOp.cpp
Basic.cpp
Gather.cpp
Linear.cpp
ViewLikeOps.cpp
ReductionOp.cpp
ViewLike.cpp
Reduction.cpp
Pooling.cpp

ADDITIONAL_HEADER_DIRS
${PROJECT_SOURCE_DIR}/include/torch-mlir/Conversion/TorchToMhlo
Expand Down
File renamed without changes.
Loading

0 comments on commit d030591

Please sign in to comment.