Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

[LLVM Integrate] Bump llvm, torch-mlir, stablehlo #104

Merged
merged 5 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def third_party_deps():
path = local_llvm_repo_path(),
)
else:
LLVM_COMMIT = "f9031f00f2c90bc0af274b45ec3e169b5250a688"
LLVM_SHA256 = "695896a5c3b4011043c27a43ac17079ee725e2d72e3b664868f09626a187daf3"
LLVM_COMMIT = "6c64c8a6f3f77c30745c751d4163ff6bf2fc323b"
LLVM_SHA256 = "a27f8452e8a4267acb7bf59ea4dae012cec22e37624a67206b927985554e3640"
http_archive(
name = "llvm-raw",
build_file_content = "# empty",
Expand All @@ -39,8 +39,8 @@ def third_party_deps():
path = local_torch_mlir_repo_path(),
)
else:
TORCH_MLIR_COMMIT = "98e08023bbf71e00ab81e980eac9f7c96f1f24b4"
TORCH_MLIR_SHA256 = "b3bac5863c73dc97bde06a032a928fe0fe586c44c8005bdbb3edd9def056ef0d"
TORCH_MLIR_COMMIT = "30c519369ed7eabad0282d0f874500a9b41fcbbd"
TORCH_MLIR_SHA256 = "9598ab5bb4a75cd63a078fccb19b380f753906153a92ff7ee5dca3eba93deba5"
http_archive(
name = "torch-mlir-raw",
build_file_content = "# empty",
Expand All @@ -55,8 +55,8 @@ def third_party_deps():
path = local_stablehlo_repo_path(),
)
else:
STABLEHLO_COMMIT = "c28d55e91b4a5daaff18a33ce7e9bbd0f171256a"
STABLEHLO_SHA256 = "b7c18132c092ec60604e8869685a745a2b31fc1edfc64caf5b19ddce0f1cee60"
STABLEHLO_COMMIT = "6e403b1aa6a71f5eaa09cc720e4ad42f692745e6"
STABLEHLO_SHA256 = "5b6a207f7c41aa986866103a4929e7146acff05830234df5714a45c7100cae3c"
http_archive(
name = "stablehlo",
sha256 = STABLEHLO_SHA256,
Expand Down
2 changes: 1 addition & 1 deletion include/mlir-tcp/Dialect/IR/TcpOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#pragma once

#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Quant/QuantTypes.h"
#include "mlir/Dialect/Quant/IR/QuantTypes.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
Expand Down
3 changes: 2 additions & 1 deletion lib/Dialect/IR/TcpTilingInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ struct SliceOpTiling
getValueOrCreateConstantIndexOp(b, loc, sizes), sliceOp.getStrides());

return TilingResult{{returnSliceOp},
SmallVector<Value>(returnSliceOp->getResults())};
SmallVector<Value>(returnSliceOp->getResults()),
{extractOp}};
}

LogicalResult
Expand Down
35 changes: 35 additions & 0 deletions temp.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
func.func @fuse_tcp_slice(%arg0: tensor<40x40xf32>) -> tensor<32x32xf32> {
%shape40 = tensor.empty() : tensor<40x40xf32>

%0 = linalg.elemwise_binary ins(%arg0, %arg0 : tensor<40x40xf32>, tensor<40x40xf32>)
outs(%shape40: tensor<40x40xf32>) -> tensor<40x40xf32>

%c32 = arith.constant 32 : index
%c16 = arith.constant 16 : index
%c3 = arith.constant 3 : index
%c5 = arith.constant 5 : index
%c1 = arith.constant 1 : index
%slice = tcp.slice %0 starts ( %c3, %c5 ) sizes ( %c32, %c32 ) strides ( %c1, %c1 ) : tensor<40x40xf32> -> tensor<32x32xf32>

%shape = tensor.empty() : tensor<32x32xf32>
%ret = linalg.elemwise_unary ins(%slice: tensor<32x32xf32>) outs(%shape: tensor<32x32xf32>) -> tensor<32x32xf32>

return %ret : tensor<32x32xf32>
}

module attributes {transform.with_named_sequence} {
transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {
%unary = transform.structured.match ops{["linalg.elemwise_unary"]} in %arg0 : (!transform.any_op) -> !transform.any_op

%1, %loops:2 = transform.structured.fuse %unary {tile_sizes = [1, 1], tile_interchange = [0, 1]}
: (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)

%func_op = transform.structured.match ops{["func.func"]} in %arg0 : (!transform.any_op) -> !transform.op<"func.func">
transform.apply_patterns to %func_op {
transform.apply_patterns.tensor.fold_tensor_empty
transform.apply_patterns.tensor.fold_tensor_subset_ops
} : !transform.op<"func.func">

transform.yield
}
}
Loading