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-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
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Torch Dialect/IR
|
|
|
|
td_library(
|
|
|
|
name = "MLIRTorchOpsIncGenTdFiles",
|
|
|
|
srcs = [
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td",
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchBase.td",
|
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchOps.td",
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.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",
|
|
|
|
"@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",
|
|
|
|
srcs = [
|
|
|
|
"lib/Dialect/Torch/Transforms/AdjustCallingConventions.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/DropShapeCalculations.cpp",
|
2022-08-10 04:34:59 +08:00
|
|
|
"lib/Dialect/Torch/Transforms/EraseModuleInitializer.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Dialect/Torch/Transforms/GlobalizeObjectGraph.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/InlineGlobalSlots.cpp",
|
2022-08-18 09:15:23 +08:00
|
|
|
"lib/Dialect/Torch/Transforms/LowerToBackendContract.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Dialect/Torch/Transforms/MaximizeValueSemantics.cpp",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Dialect/Torch/Transforms/PassDetail.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Dialect/Torch/Transforms/Passes.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/PrepareForGlobalizeObjectGraph.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/RefinePublicReturn.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/RefineTypes.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/ReifyShapeCalculations.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/ShapeLibrary.cpp",
|
|
|
|
"lib/Dialect/Torch/Transforms/SimplifyShapeCalculations.cpp",
|
|
|
|
],
|
|
|
|
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",
|
|
|
|
srcs = [
|
|
|
|
"lib/Dialect/TorchConversion/IR/TorchConversionDialect.cpp",
|
|
|
|
"lib/Dialect/TorchConversion/IR/TorchConversionOps.cpp",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.h",
|
|
|
|
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.h",
|
|
|
|
],
|
|
|
|
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",
|
|
|
|
"-DTORCH_MLIR_ENABLE_MHLO",
|
|
|
|
],
|
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",
|
|
|
|
"@llvm-project//mlir:ArithmeticDialect",
|
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",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/PassDetail.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Conversion/TorchToLinalg/DataMovement.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/IndirectDataMovement.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/Linear.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/Pooling.cpp",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/TorchToLinalg/PopulatePatterns.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Conversion/TorchToLinalg/Random.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/Reduction.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/TensorConstructors.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/TensorScalarInterop.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/TorchToLinalg.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/Uncategorized.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/Utils.cpp",
|
|
|
|
"lib/Conversion/TorchToLinalg/Utils.h",
|
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/TorchToLinalg/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-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:ArithmeticDialect",
|
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",
|
|
|
|
srcs = [
|
|
|
|
"lib/Conversion/PassDetail.h",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/TorchToSCF/TorchToSCF.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/TorchToSCF/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",
|
|
|
|
"@llvm-project//mlir:ArithmeticDialect",
|
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-04-07 02:20:39 +08:00
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/PassDetail.h",
|
2022-08-11 05:51:13 +08:00
|
|
|
"lib/Conversion/TorchToArith/TorchToArith.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/TorchToArith/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
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "TorchMLIRTorchToTMTensor",
|
|
|
|
srcs = [
|
|
|
|
"lib/Conversion/PassDetail.h",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/TorchToTMTensor/TorchToTMTensor.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/TorchToTMTensor/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(
|
|
|
|
name = "TorchMLIRTorchToMhlo",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/PassDetail.h",
|
2022-08-04 12:34:22 +08:00
|
|
|
"lib/Conversion/TorchToMhlo/Basic.cpp",
|
|
|
|
"lib/Conversion/TorchToMhlo/Gather.cpp",
|
2022-08-04 10:10:54 +08:00
|
|
|
"lib/Conversion/TorchToMhlo/Linear.cpp",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/TorchToMhlo/MhloLegalizeUtils.cpp",
|
2022-07-29 14:24:42 +08:00
|
|
|
"lib/Conversion/TorchToMhlo/MhloLegalizeUtils.h",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/TorchToMhlo/Pooling.cpp",
|
2022-07-29 14:24:42 +08:00
|
|
|
"lib/Conversion/TorchToMhlo/PopulatePatterns.h",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/TorchToMhlo/Reduction.cpp",
|
|
|
|
"lib/Conversion/TorchToMhlo/TorchToMhlo.cpp",
|
|
|
|
"lib/Conversion/TorchToMhlo/ViewLike.cpp",
|
2022-07-29 14:24:42 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/TorchToMhlo/TorchToMhlo.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",
|
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
|
|
|
],
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchToArith",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchToLinalg",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchToMhlo",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchToSCF",
|
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",
|
|
|
|
srcs = [
|
|
|
|
"lib/Dialect/TorchConversion/Transforms/BackendTypeConversionPasses.cpp",
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Dialect/TorchConversion/Transforms/PassDetail.h",
|
|
|
|
"lib/Dialect/TorchConversion/Transforms/Passes.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Dialect/TorchConversion/Transforms/VerifyLinalgOnTensorsBackendContract.cpp",
|
|
|
|
"lib/Dialect/TorchConversion/Transforms/VerifyTosaBackendContract.cpp",
|
2022-09-01 17:08:17 +08:00
|
|
|
"lib/Dialect/TorchConversion/Transforms/VerifyMhloBackendContract.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h",
|
|
|
|
],
|
|
|
|
strip_include_prefix = "include",
|
|
|
|
deps = [
|
|
|
|
":TorchMLIRTorchBackendTypeConversion",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchConversionDialect",
|
|
|
|
":TorchMLIRTorchConversionPassesIncGen",
|
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",
|
2022-08-19 13:42:58 +08:00
|
|
|
":TorchMLIRTorchToMhlo",
|
2022-04-07 02:20:39 +08:00
|
|
|
":TorchMLIRTorchToSCF",
|
|
|
|
":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",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"lib/Conversion/PassDetail.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
"lib/Conversion/TorchToTosa/TorchToTosa.cpp",
|
|
|
|
"lib/Conversion/TorchToTosa/TosaLegalizeCommon.cpp",
|
|
|
|
"lib/Conversion/TorchToTosa/TosaLegalizeUtils.cpp",
|
2022-08-19 13:42:58 +08:00
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
hdrs = [
|
|
|
|
"include/torch-mlir/Conversion/TorchToTosa/TorchToTosa.h",
|
|
|
|
"include/torch-mlir/Conversion/TorchToTosa/TosaLegalizeCommon.h",
|
2022-08-19 13:42:58 +08:00
|
|
|
"include/torch-mlir/Conversion/TorchToTosa/TosaLegalizeUtils.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",
|
|
|
|
"@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",
|
|
|
|
srcs = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp",
|
2022-04-07 02:20:39 +08:00
|
|
|
"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",
|
2022-08-19 13:42:58 +08:00
|
|
|
"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",
|
|
|
|
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 = [
|
2022-08-19 13:42:58 +08:00
|
|
|
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h",
|
2022-04-07 02:20:39 +08:00
|
|
|
"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-04-07 02:20:39 +08:00
|
|
|
"@llvm-project//mlir:ArithmeticTransforms",
|
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: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",
|
|
|
|
"@llvm-project//mlir:AllPassesAndDialects",
|
2022-08-19 13:42:58 +08:00
|
|
|
"@llvm-project//mlir:MlirOptLib",
|
|
|
|
],
|
2022-04-07 02:20:39 +08:00
|
|
|
)
|