2022-04-07 02:20:39 +08:00
|
|
|
# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
2022-08-19 13:42:58 +08:00
|
|
|
load("@llvm-project//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
|
2022-11-16 04:34:27 +08:00
|
|
|
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
|
2022-04-07 02:20:39 +08:00
|
|
|
|
|
|
|
package(
|
|
|
|
default_visibility = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"//visibility:public",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-11-16 04:34:27 +08:00
|
|
|
# Format bazel BUILD and .bzl files with a standard convention
|
|
|
|
# Invoke as `bazel run @torch-mlir//:buildifier`
|
|
|
|
buildifier(
|
|
|
|
name = "buildifier",
|
|
|
|
)
|
|
|
|
|
2022-04-07 02:20:39 +08:00
|
|
|
# Torch Dialect/IR
|
|
|
|
td_library(
|
|
|
|
name = "MLIRTorchOpsIncGenTdFiles",
|
2023-01-12 06:18:35 +08:00
|
|
|
srcs = glob([
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/*.td",
|
|
|
|
]),
|
2022-04-07 02:20:39 +08:00
|
|
|
includes = ["include"],
|
|
|
|
deps = [
|
|
|
|
"@llvm-project//mlir:CastInterfacesTdFiles",
|
|
|
|
"@llvm-project//mlir:ControlFlowInterfacesTdFiles",
|
|
|
|
"@llvm-project//mlir:InferTypeOpInterfaceTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:OpBaseTdFiles",
|
|
|
|
"@llvm-project//mlir:SideEffectInterfacesTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "MLIRTorchOpsIncGen",
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-op-decls"],
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchOps.h.inc",
|
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-op-defs"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchOps.cpp.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
[
|
|
|
|
"-gen-dialect-decls",
|
|
|
|
"-dialect=torch",
|
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchDialect.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
[
|
|
|
|
"-gen-dialect-defs",
|
|
|
|
"-dialect=torch",
|
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchDialect.cpp.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
|
|
|
td_file = "include/torch-mlir/Dialect/Torch/IR/TorchOps.td",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":MLIRTorchOpsIncGenTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "MLIRTorchTypesIncGen",
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-typedef-decls"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-typedef-defs"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.cpp.inc",
|
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
|
|
|
td_file = "include/torch-mlir/Dialect/Torch/IR/TorchTypes.td",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":MLIRTorchOpsIncGenTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchDialectUtils",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Dialect/Torch/Utils/TorchUpstream.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Dialect/Torch/Utils/Utils.cpp",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchOps.h",
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchTraits.h",
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.h",
|
|
|
|
"include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h",
|
|
|
|
"include/torch-mlir/Dialect/Torch/Utils/Utils.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
strip_include_prefix = "include",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":MLIRTorchOpsIncGen",
|
|
|
|
":MLIRTorchTypesIncGen",
|
2023-06-29 23:45:35 +08:00
|
|
|
"@llvm-project//mlir:CastInterfaces",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:ControlFlowInterfaces",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:IR",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:InferTypeOpInterface",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchDialect",
|
|
|
|
srcs = [
|
|
|
|
"lib/Dialect/Torch/IR/TorchDialect.cpp",
|
|
|
|
"lib/Dialect/Torch/IR/TorchOps.cpp",
|
|
|
|
"lib/Dialect/Torch/IR/TorchOpsODSGenerated.cpp",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Dialect/Torch/IR/TorchTypes.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Dialect/Torch/IR/UtilsForODSGenerated.cpp",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Dialect/Torch/IR/UtilsForODSGenerated.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = glob([
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/*.h",
|
|
|
|
]),
|
|
|
|
includes = ["include"],
|
|
|
|
deps = [
|
|
|
|
":MLIRTorchOpsIncGen",
|
|
|
|
":MLIRTorchTypesIncGen",
|
|
|
|
":TorchMLIRTorchDialectUtils",
|
|
|
|
"@llvm-project//mlir:ControlFlowInterfaces",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:FuncDialect",
|
|
|
|
"@llvm-project//mlir:IR",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:InferTypeOpInterface",
|
|
|
|
"@llvm-project//mlir:TransformUtils",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Torch Dialect/Transforms
|
|
|
|
td_library(
|
|
|
|
name = "TorchMLIRTorchPassesTdFiles",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/Transforms/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
includes = ["include"],
|
|
|
|
deps = [
|
|
|
|
"@llvm-project//mlir:OpBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRTorchPassesIncGen",
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-pass-decls"],
|
|
|
|
"include/torch-mlir/Dialect/Torch/Transforms/Passes.h.inc",
|
2022-08-19 13:42:58 +08:00
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "include/torch-mlir/Dialect/Torch/Transforms/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":TorchMLIRTorchPassesTdFiles",
|
|
|
|
"@llvm-project//mlir:PassBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchPasses",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Dialect/Torch/Transforms/*.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/*.h",
|
|
|
|
]),
|
2022-04-07 02:20:39 +08:00
|
|
|
hdrs = [
|
|
|
|
"include/torch-mlir/Dialect/Torch/Transforms/Passes.h",
|
|
|
|
],
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRTorchDialect",
|
|
|
|
":TorchMLIRTorchPassesIncGen",
|
|
|
|
"@llvm-project//mlir:FuncDialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:IR",
|
|
|
|
"@llvm-project//mlir:Parser",
|
|
|
|
"@llvm-project//mlir:Pass",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:Transforms",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# TorchConversion diaelct
|
|
|
|
td_library(
|
|
|
|
name = "MLIRTorchConversionOpsTdFiles",
|
|
|
|
srcs = [
|
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionBase.td",
|
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.td",
|
|
|
|
],
|
|
|
|
includes = ["include"],
|
|
|
|
deps = [
|
|
|
|
":MLIRTorchOpsIncGenTdFiles",
|
2022-04-27 10:21:52 +08:00
|
|
|
"@llvm-project//mlir:AttrTdFiles",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:CastInterfacesTdFiles",
|
|
|
|
"@llvm-project//mlir:ControlFlowInterfacesTdFiles",
|
|
|
|
"@llvm-project//mlir:InferTypeOpInterfaceTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:OpBaseTdFiles",
|
|
|
|
"@llvm-project//mlir:SideEffectInterfacesTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "MLIRTorchConversionOpsIncGen",
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-op-decls"],
|
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.h.inc",
|
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-op-defs"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.cpp.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
[
|
|
|
|
"-gen-dialect-decls",
|
|
|
|
"-dialect=torch_c",
|
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
[
|
|
|
|
"-gen-dialect-defs",
|
|
|
|
"-dialect=torch_c",
|
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.cpp.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
|
|
|
td_file = "include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.td",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":MLIRTorchConversionOpsTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchConversionDialect",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob(["lib/Dialect/TorchConversion/IR/*.cpp"]),
|
|
|
|
hdrs = glob(["include/torch-mlir/Dialect/TorchConversion/IR/*.h"]),
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":MLIRTorchConversionOpsIncGen",
|
|
|
|
":TorchMLIRTorchDialect",
|
|
|
|
"@llvm-project//mlir:IR",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:InferTypeOpInterface",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Conversion
|
|
|
|
td_library(
|
|
|
|
name = "TorchMLIRConversionPassesTdFiles",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/Passes.td",
|
|
|
|
],
|
|
|
|
includes = ["include"],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRConversionPassesIncGen",
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
2022-08-19 13:42:58 +08:00
|
|
|
[
|
|
|
|
"-gen-pass-decls",
|
2023-02-02 21:29:47 +08:00
|
|
|
"-DTORCH_MLIR_ENABLE_STABLEHLO",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
"include/torch-mlir/Conversion/Passes.h.inc",
|
2022-08-19 13:42:58 +08:00
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "include/torch-mlir/Conversion/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":TorchMLIRConversionPassesTdFiles",
|
|
|
|
"@llvm-project//mlir:PassBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# TorchConversion transforms
|
|
|
|
td_library(
|
|
|
|
name = "TorchMLIRTorchConversionPassesTdFiles",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
"@llvm-project//mlir:OpBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
2022-08-19 13:42:58 +08:00
|
|
|
|
2022-04-07 02:20:39 +08:00
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRTorchConversionPassesIncGen",
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
2022-09-08 04:11:19 +08:00
|
|
|
["-gen-pass-decls"],
|
2022-04-07 02:20:39 +08:00
|
|
|
"include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h.inc",
|
2022-08-19 13:42:58 +08:00
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":TorchMLIRTorchConversionPassesTdFiles",
|
|
|
|
"@llvm-project//mlir:PassBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRConversionUtils",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/Utils/Utils.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/Utils/Utils.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRTorchDialect",
|
2022-10-06 14:51:00 +08:00
|
|
|
"@llvm-project//mlir:ArithDialect",
|
2022-06-23 11:50:39 +08:00
|
|
|
"@llvm-project//mlir:ControlFlowDialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:IR",
|
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
|
|
|
"@llvm-project//mlir:Transforms",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchToLinalg",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Conversion/*.h",
|
|
|
|
"lib/Conversion/TorchToLinalg/*.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/*.h",
|
|
|
|
]),
|
|
|
|
hdrs = glob(["include/torch-mlir/Conversion/TorchToLinalg/*.h"]),
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRConversionPassesIncGen",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRConversionUtils",
|
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchDialect",
|
2022-10-06 14:51:00 +08:00
|
|
|
"@llvm-project//mlir:ArithDialect",
|
2022-06-23 11:50:39 +08:00
|
|
|
"@llvm-project//mlir:ControlFlowDialect",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:Dialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
|
|
|
"@llvm-project//mlir:Pass",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:TensorUtils",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:TransformUtils",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchToSCF",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Conversion/*.h",
|
|
|
|
"lib/Conversion/TorchToSCF/*.cpp",
|
|
|
|
]),
|
|
|
|
hdrs = glob(["include/torch-mlir/Conversion/TorchToSCF/*.h"]),
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRConversionPassesIncGen",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
2022-10-06 14:51:00 +08:00
|
|
|
"@llvm-project//mlir:ArithDialect",
|
2022-06-23 11:50:39 +08:00
|
|
|
"@llvm-project//mlir:ControlFlowDialect",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:Dialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
|
|
|
"@llvm-project//mlir:Pass",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:TensorUtils",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:TransformUtils",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
2022-08-11 05:51:13 +08:00
|
|
|
name = "TorchMLIRTorchToArith",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Conversion/*.h",
|
|
|
|
"lib/Conversion/TorchToArith/*.cpp",
|
|
|
|
]),
|
|
|
|
hdrs = glob([
|
|
|
|
"include/torch-mlir/Conversion/TorchToArith/*.h",
|
|
|
|
]),
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRConversionPassesIncGen",
|
2022-04-28 14:22:27 +08:00
|
|
|
":TorchMLIRConversionUtils",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
"@llvm-project//mlir:Dialect",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
2022-12-09 01:49:54 +08:00
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchConversionToMLProgram",
|
|
|
|
srcs = glob([
|
|
|
|
"lib/Conversion/*.h",
|
|
|
|
"lib/Conversion/TorchConversionToMLProgram/*.cpp",
|
|
|
|
]),
|
|
|
|
hdrs = glob([
|
|
|
|
"include/torch-mlir/Conversion/TorchConversionToMLProgram/*.h",
|
|
|
|
]),
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRConversionPassesIncGen",
|
|
|
|
":TorchMLIRConversionUtils",
|
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
"@llvm-project//mlir:Dialect",
|
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
|
|
|
"@llvm-project//mlir:MLProgramDialect",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-04-07 02:20:39 +08:00
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchToTMTensor",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Conversion/*.h",
|
|
|
|
"lib/Conversion/TorchToTMTensor/*.cpp",
|
|
|
|
]),
|
|
|
|
hdrs = glob(["include/torch-mlir/Conversion/TorchToTMTensor/*.h"]),
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRConversionPassesIncGen",
|
|
|
|
":TorchMLIRConversionUtils",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTMTensorDialect",
|
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
2022-07-29 14:24:42 +08:00
|
|
|
cc_library(
|
2023-02-02 21:29:47 +08:00
|
|
|
name = "TorchMLIRTorchToStablehlo",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Conversion/*.h",
|
2023-02-02 21:29:47 +08:00
|
|
|
"lib/Conversion/TorchToStablehlo/*.h",
|
|
|
|
"lib/Conversion/TorchToStablehlo/*.cpp",
|
2022-10-26 03:23:24 +08:00
|
|
|
]),
|
2023-02-02 21:29:47 +08:00
|
|
|
hdrs = glob(["include/torch-mlir/Conversion/TorchToStablehlo/*.h"]),
|
2022-07-29 14:24:42 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRConversionPassesIncGen",
|
|
|
|
":TorchMLIRConversionUtils",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
"@llvm-project//mlir:Dialect",
|
2022-08-03 03:28:53 +08:00
|
|
|
"@mlir-hlo//:mlir_hlo",
|
2023-02-25 07:07:34 +08:00
|
|
|
"@mlir-hlo//:transforms_passes",
|
2023-03-15 11:04:09 +08:00
|
|
|
"@mlir-hlo//stablehlo:register",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-07-29 14:24:42 +08:00
|
|
|
)
|
|
|
|
|
2022-04-07 02:20:39 +08:00
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRConversionPasses",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/Passes.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/Passes.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
2023-02-25 07:07:34 +08:00
|
|
|
defines = [
|
|
|
|
"TORCH_MLIR_ENABLE_STABLEHLO",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
2022-12-09 07:56:57 +08:00
|
|
|
":TorchMLIRTorchConversionToMLProgram",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchToArith",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchToLinalg",
|
|
|
|
":TorchMLIRTorchToSCF",
|
2023-02-02 21:29:47 +08:00
|
|
|
":TorchMLIRTorchToStablehlo",
|
2022-07-29 14:24:42 +08:00
|
|
|
":TorchMLIRTorchToTMTensor",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchToTosa",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchConversionPasses",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Dialect/TorchConversion/Transforms/*.cpp",
|
2022-10-27 04:28:00 +08:00
|
|
|
"lib/Dialect/TorchConversion/Transforms/*.h",
|
2022-10-26 03:23:24 +08:00
|
|
|
]),
|
|
|
|
hdrs = glob(["include/torch-mlir/Dialect/TorchConversion/Transforms/*.h"]),
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
":TorchMLIRTorchConversionPassesIncGen",
|
2022-12-09 07:56:57 +08:00
|
|
|
":TorchMLIRTorchConversionToMLProgram",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchDialect",
|
|
|
|
":TorchMLIRTorchPasses",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchToArith",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchToLinalg",
|
|
|
|
":TorchMLIRTorchToSCF",
|
2023-02-02 21:29:47 +08:00
|
|
|
":TorchMLIRTorchToStablehlo",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchToTMTensor",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchToTosa",
|
|
|
|
"@llvm-project//mlir:ConversionPasses",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:FuncDialect",
|
2022-06-23 11:50:39 +08:00
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:LinalgTransforms",
|
|
|
|
"@llvm-project//mlir:MemRefDialect",
|
|
|
|
"@llvm-project//mlir:MemRefTransforms",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:Pass",
|
|
|
|
"@llvm-project//mlir:TosaDialect",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchToTosa",
|
2022-10-26 03:23:24 +08:00
|
|
|
srcs = glob([
|
|
|
|
"lib/Conversion/*.h",
|
|
|
|
"lib/Conversion/TorchToTosa/*.cpp",
|
|
|
|
]),
|
|
|
|
hdrs = glob(["include/torch-mlir/Conversion/TorchToTosa/*.h"]),
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRConversionPassesIncGen",
|
2022-12-22 13:27:03 +08:00
|
|
|
":TorchMLIRConversionUtils",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
"@llvm-project//mlir:Dialect",
|
|
|
|
"@llvm-project//mlir:QuantOps",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:TosaDialect",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Dialects.TorchConversion
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchBackendTypeConversion",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Dialect/TorchConversion/Transforms/BackendTypeConversion.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/TorchConversion/Transforms/BackendTypeConversion.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:FuncTransforms",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# External dialects
|
|
|
|
td_library(
|
|
|
|
name = "TorchMLIRTMTensorOpsTdFiles",
|
|
|
|
srcs = [
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td",
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td",
|
|
|
|
],
|
|
|
|
includes = ["externals/llvm-external-projects/torch-mlir-dialects/include"],
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:ControlFlowInterfacesTdFiles",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:OpBaseTdFiles",
|
|
|
|
"@llvm-project//mlir:SideEffectInterfacesTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRTMTensorInterfacesIncGen",
|
|
|
|
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-op-interface-decls"],
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterfaces.h.inc",
|
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-op-interface-defs"],
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOpInterfaces.cpp.inc",
|
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-type-interface-decls"],
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypeInterfaces.h.inc",
|
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-type-interface-defs"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypeInterfaces.cpp.inc",
|
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":TorchMLIRTMTensorOpsTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRTMTensorScalarLoopOpInterfaceIncGen",
|
|
|
|
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-op-interface-decls"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-op-interface-defs"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp.inc",
|
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":TorchMLIRTMTensorOpsTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRTMTensorOpsIncGen",
|
|
|
|
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-op-decls"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-op-defs"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.cpp.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-typedef-decls"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypes.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
[
|
|
|
|
"-gen-dialect-decls",
|
2022-08-19 13:42:58 +08:00
|
|
|
"-dialect=tm_tensor",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
[
|
|
|
|
"-gen-dialect-defs",
|
2022-08-19 13:42:58 +08:00
|
|
|
"-dialect=tm_tensor",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.cpp.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTMTensorOpsTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTMTensorDialect",
|
2022-10-27 04:28:00 +08:00
|
|
|
srcs = [
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorDialect.cpp",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorInterfaces.cpp",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTMTensorInterfacesIncGen",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTMTensorOpsIncGen",
|
|
|
|
":TorchMLIRTMTensorScalarLoopOpInterfaceIncGen",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:AffineDialect",
|
|
|
|
"@llvm-project//mlir:ControlFlowInterfaces",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:Dialect",
|
|
|
|
"@llvm-project//mlir:DialectUtils",
|
2022-06-23 11:50:39 +08:00
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:ViewLikeInterface",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
td_library(
|
|
|
|
name = "TorchMLIRTMTensorTransformsPassesTdFiles",
|
|
|
|
srcs = [
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
"@llvm-project//mlir:OpBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:PassBaseTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRTMTensorTransformsPassesIncGen",
|
|
|
|
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-pass-decls"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-pass-capi-header"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h.cpi.inc",
|
2022-04-07 02:20:39 +08:00
|
|
|
),
|
|
|
|
(
|
|
|
|
["-gen-pass-capi-impl"],
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.cpi.cpp.inc",
|
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTMTensorTransformsPassesTdFiles",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTMTensorPasses",
|
2022-10-27 04:28:00 +08:00
|
|
|
srcs = [
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Bufferize.cpp",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Passes.cpp",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h",
|
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h",
|
|
|
|
],
|
2022-08-19 13:42:58 +08:00
|
|
|
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":TorchMLIRTMTensorDialect",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTMTensorTransformsPassesIncGen",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:BufferizationTransforms",
|
|
|
|
"@llvm-project//mlir:FuncTransforms",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
|
|
|
"@llvm-project//mlir:LinalgTransforms",
|
|
|
|
"@llvm-project//mlir:Pass",
|
|
|
|
"@llvm-project//mlir:Transforms",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# RefBackend
|
|
|
|
filegroup(
|
|
|
|
name = "TorchMLIRRefBackendPassesDetails",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/RefBackend/PassDetail.h",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
td_library(
|
|
|
|
name = "TorchMLIRRefBackendPassTdFiles",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/RefBackend/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
"@llvm-project//mlir:OpBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
gentbl_cc_library(
|
|
|
|
name = "TorchMLIRRefBackendPassIncGen",
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
tbl_outs = [
|
|
|
|
(
|
|
|
|
["-gen-pass-decls"],
|
|
|
|
"include/torch-mlir/RefBackend/Passes.h.inc",
|
2022-08-19 13:42:58 +08:00
|
|
|
),
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
tblgen = "@llvm-project//mlir:mlir-tblgen",
|
2022-08-19 13:42:58 +08:00
|
|
|
td_file = "include/torch-mlir/RefBackend/Passes.td",
|
2022-04-07 02:20:39 +08:00
|
|
|
deps = [
|
|
|
|
":TorchMLIRRefBackendPassTdFiles",
|
|
|
|
"@llvm-project//mlir:PassBaseTdFiles",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRRefBackendPass",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/RefBackend/RefBackend.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
] + [":TorchMLIRRefBackendPassesDetails"],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/RefBackend/Passes.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRRefBackendPassIncGen",
|
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchConversionDialect",
|
2022-10-06 14:51:00 +08:00
|
|
|
"@llvm-project//mlir:ArithTransforms",
|
2022-06-23 11:50:39 +08:00
|
|
|
"@llvm-project//mlir:LinalgDialect",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:LinalgTransforms",
|
2022-12-09 07:56:57 +08:00
|
|
|
"@llvm-project//mlir:MLProgramDialect",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:MathTransforms",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:MemRefDialect",
|
|
|
|
"@llvm-project//mlir:Pass",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRInitAll",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/InitAll.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/InitAll.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRConversionPasses",
|
|
|
|
":TorchMLIRRefBackendPass",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTMTensorDialect",
|
|
|
|
":TorchMLIRTMTensorPasses",
|
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
":TorchMLIRTorchConversionPasses",
|
|
|
|
":TorchMLIRTorchDialect",
|
|
|
|
":TorchMLIRTorchPasses",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:Dialect",
|
|
|
|
"@llvm-project//mlir:DialectUtils",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:IR",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# tools
|
|
|
|
cc_binary(
|
|
|
|
name = "torch-mlir-opt",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"tools/torch-mlir-opt/torch-mlir-opt.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRInitAll",
|
|
|
|
":TorchMLIRTorchDialect",
|
|
|
|
":TorchMLIRTorchPasses",
|
2023-06-29 23:45:35 +08:00
|
|
|
"@llvm-project//mlir:AllExtensions",
|
2022-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:AllPassesAndDialects",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:MlirOptLib",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|