Skip to content

Commit

Permalink
Changes to build with rebase on HEAD. Lit tests are now broken again.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjain-stanford committed Oct 23, 2024
1 parent cbe09e3 commit 375eac7
Show file tree
Hide file tree
Showing 5 changed files with 216 additions and 144 deletions.
213 changes: 73 additions & 140 deletions mlir-tensorrt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ td_library(
],
)

td_library(
name = "TensorKindInterfaceTdFiles",
srcs = [
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td",
],
includes = ["tensorrt/include"],
deps = [
"@llvm-project//mlir:OpBaseTdFiles",
],
)

gentbl_cc_library(
name = "TensorRTOpsIncGen",
strip_include_prefix = "tensorrt/include",
Expand Down Expand Up @@ -159,50 +170,31 @@ gentbl_cc_library(
],
)

cc_library(
name = "TensorRTDialect",
srcs = [
"tensorrt/lib/TensorRT/IR/EinsumHelper.cpp",
"tensorrt/lib/TensorRT/IR/EinsumHelper.h",
"tensorrt/lib/TensorRT/IR/TensorKindOpInterfaceImpl.cpp",
"tensorrt/lib/TensorRT/IR/TensorRT.cpp",
"tensorrt/lib/TensorRT/IR/TypeInferenceInterfaceImpls.cpp",
"tensorrt/lib/TensorRT/IR/Verification.cpp",
],
hdrs = [
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h",
"tensorrt/include/mlir-tensorrt-dialect/TensorRT/IR/TensorRTDialect.h",
],
gentbl_cc_library(
name = "TensorRTTensorKindInterfacesIncGen",
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTAttrInterfacesIncGen",
":TensorRTAttributesIncGen",
":TensorRTCommonUtils",
":TensorRTEnumsIncGen",
":TensorRTInterfacesIncGen",
":TensorRTOpsIncGen",
":TensorRTTensorKindInterfacesIncGen",
"@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:DestinationStyleOpInterface",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:LoopLikeInterface",
"@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:TensorDialect",
],
)

cc_library(
name = "TensorRTUtils",
srcs = [
"tensorrt/lib/TensorRT/Utils/Utils.cpp",
],
hdrs = [
"tensorrt/include/mlir-tensorrt-dialect/TensorRT/Utils/Utils.h",
tbl_outs = [
(
["-gen-op-interface-decls"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.cpp.inc",
),
(
["-gen-attr-interface-decls"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.h.inc",
),
(
["-gen-attr-interface-defs"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.cpp.inc",
),
],
strip_include_prefix = "tensorrt/include",
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td",
deps = [
":TensorRTDialect",
":TensorKindInterfaceTdFiles",
],
)

Expand Down Expand Up @@ -234,107 +226,75 @@ cc_library(
],
)

td_library(
name = "TensorKindInterfaceTdFiles",
srcs = [
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td",
],
includes = ["tensorrt/include"],
deps = [
"@llvm-project//mlir:OpBaseTdFiles",
],
)

gentbl_cc_library(
name = "TensorRTTensorKindInterfacesIncGen",
strip_include_prefix = "tensorrt/include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.cpp.inc",
),
(
["-gen-attr-interface-decls"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.h.inc",
),
(
["-gen-attr-interface-defs"],
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindAttrInterface.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.td",
deps = [
":TensorKindInterfaceTdFiles",
],
)

cc_library(
name = "TensorRTTensorKindInterfaces",
name = "TensorRTDialect",
srcs = [
"tensorrt/lib/Interface/TensorKindOpInterface.cpp",
"tensorrt/lib/TensorRT/IR/EinsumHelper.cpp",
"tensorrt/lib/TensorRT/IR/EinsumHelper.h",
"tensorrt/lib/TensorRT/IR/TensorKindOpInterfaceImpl.cpp",
"tensorrt/lib/TensorRT/IR/TensorRT.cpp",
"tensorrt/lib/TensorRT/IR/TypeInferenceInterfaceImpls.cpp",
"tensorrt/lib/TensorRT/IR/Verification.cpp",
],
hdrs = [
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h",
"tensorrt/include/mlir-tensorrt-dialect/TensorRT/IR/TensorRTDialect.h",
],
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTAttrInterfacesIncGen",
":TensorRTAttributesIncGen",
":TensorRTEnumsIncGen",
":TensorRTInterfacesIncGen",
":TensorRTOpsIncGen",
":TensorRTTensorKindInterfacesIncGen",
"@llvm-project//mlir:Analysis",
":TensorRTCommonUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:QuantOps",
],
)

cc_library(
name = "TensorRTAnalysis",
name = "TensorRTUtils",
srcs = [
"tensorrt/lib/Analysis/TensorKindAnalysis.cpp",
"tensorrt/lib/TensorRT/Utils/Utils.cpp",
],
hdrs = [
"tensorrt/include/mlir-tensorrt-dialect/Analysis/TensorKindAnalysis.h",
"tensorrt/include/mlir-tensorrt-dialect/TensorRT/Utils/Utils.h",
],
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTDialect",
":TensorRTTensorKindInterfaces",
"@llvm-project//mlir:BufferizationDialect",
],
)

cc_library(
name = "TensorRTCompilerUtils",
name = "TensorRTTensorKindInterfaces",
srcs = [
"compiler/lib/Utils/RegionUtils.cpp",
"tensorrt/lib/Interface/TensorKindOpInterface.cpp",
],
hdrs = [
"compiler/include/mlir-tensorrt/Utils/RegionUtils.h",
"tensorrt/include/mlir-tensorrt-dialect/Interface/TensorKindOpInterface.h",
],
strip_include_prefix = "compiler/include",
strip_include_prefix = "tensorrt/include",
deps = [
"@llvm-project//mlir:IR",
"@llvm-project//mlir:TransformUtils",
":TensorRTTensorKindInterfacesIncGen",
"@llvm-project//mlir:Analysis",
],
)

cc_library(
name = "TensorRTGenericClustering",
name = "TensorRTAnalysis",
srcs = [
"compiler/lib/Transforms/Clustering/Clustering.cpp",
"compiler/lib/Transforms/Clustering/Patterns.cpp",
"tensorrt/lib/Analysis/TensorKindAnalysis.cpp",
],
hdrs = [
"compiler/include/mlir-tensorrt/Transforms/Clustering/Clustering.h",
"compiler/include/mlir-tensorrt/Transforms/Clustering/Patterns.h",
"tensorrt/include/mlir-tensorrt-dialect/Analysis/TensorKindAnalysis.h",
],
strip_include_prefix = "compiler/include",
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTCompilerUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:Transforms",
":TensorRTTensorKindInterfaces",
"@llvm-project//mlir:BufferizationDialect",
],
)

Expand Down Expand Up @@ -408,20 +368,12 @@ cc_library(
hdrs = [
"tensorrt/include/mlir-tensorrt-dialect/TensorRT/Transforms/Passes.h",
],
copts = [
"-DMLIR_TRT_TARGET_TENSORRT",
],
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTAnalysis",
":TensorRTDialect",
":TensorRTGenericClustering",
":TensorRTTransformsActivationsPdllGen",
":TensorRTTransformsNormalizationsPdllGen",
":TensorRTTransformsPassesIncGen",
":TensorRTUtils",
"@rules_cuda//cuda:runtime",
"@tensorrt10_x86//:tensorrt10",
],
)

Expand Down Expand Up @@ -460,12 +412,8 @@ cc_library(
deps = [
":TensorRTAnalysis",
":TensorRTGenericTransformPassesIncGen",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:FuncTransforms",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:TransformDialectTransforms",
"@llvm-project//mlir:SCFDialect",
],
)

Expand Down Expand Up @@ -519,14 +467,11 @@ cc_library(
],
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTAnalysis",
":TensorRTCommonUtils",
":TensorRTDialect",
":TensorRTEncodingOpInterfaceIncGen",
":TensorRTEnumConverterGen",
":TensorRTTensorKindInterfaces",
":TensorRTUtils",
"@rules_cuda//cuda:runtime",
"@tensorrt10_x86//:tensorrt10",
],
)

Expand Down Expand Up @@ -557,7 +502,6 @@ cc_library(
],
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTDialect",
":TensorRTEncodingIncGen",
":TensorRTEncodingOpInterface",
],
Expand Down Expand Up @@ -607,14 +551,10 @@ cc_library(
copts = ["-DMLIR_TRT_TARGET_TENSORRT"],
strip_include_prefix = "tensorrt/include",
deps = [
":TensorRTCommonUtils",
":TensorRTDialect",
":TensorRTDynamicLoader",
":TensorRTEncodingImpl",
":TensorRTEncodingOpInterface",
":TensorRTTranslationPassIncGen",
"@llvm-project//llvm:BitWriter",
"@llvm-project//mlir:FuncExtensions",
"@llvm-project//mlir:TranslateLib",
],
)
Expand Down Expand Up @@ -644,13 +584,10 @@ cc_library(
"compiler/lib/Conversion/TensorRTCommon/ConvertToTensorRTCommon.cpp",
],
hdrs = [
"compiler/include/mlir-tensorrt/Conversion/Passes.h",
"compiler/include/mlir-tensorrt/Conversion/Passes.h",
"compiler/include/mlir-tensorrt/Conversion/Patterns.h",
"compiler/include/mlir-tensorrt/Conversion/TensorRTCommon/ConvertToTensorRTCommon.h",
],
copts = [
"-DMLIR_TRT_TARGET_TENSORRT",
],
strip_include_prefix = "compiler/include",
deps = [
":TensorRTConversionPassIncGen",
Expand All @@ -670,16 +607,16 @@ cc_library(
"compiler/include/mlir-tensorrt/Registration/RegisterMlirTensorRtPasses.h",
"compiler/include/mlir-tensorrt/Registration/RegisterMlirTensorRtTranslations.h",
],
copts = [
"-DMLIR_TRT_TARGET_TENSORRT",
],
copts = ["-DMLIR_TRT_TARGET_TENSORRT"],
strip_include_prefix = "compiler/include",
deps = [
":TensorRTConversion",
":TensorRTGeneralTransforms",
":TensorRTTarget",
":TensorRTTransforms",
"@llvm-project//mlir:ShapeDialect",
"@llvm-project//mlir:FuncExtensions",
"@llvm-project//mlir:TransformDialectTransforms",

],
)

Expand All @@ -694,9 +631,7 @@ cc_binary(
cc_binary(
name = "tensorrt-opt",
srcs = ["tensorrt/tensorrt-opt/tensorrt-opt.cpp"],
copts = [
"-DMLIR_TRT_TARGET_TENSORRT",
],
copts = ["-DMLIR_TRT_TARGET_TENSORRT"],
linkopts = ["-Wl,-rpath,/opt/src/mlir-tensorrt/bazel-mlir-tensorrt/external/tensorrt10_x86/targets/x86_64-linux-gnu/lib"],
deps = [
":TensorRTRegistration",
Expand All @@ -707,9 +642,7 @@ cc_binary(
cc_binary(
name = "mlir-tensorrt-opt",
srcs = ["tools/MlirTensorRtOpt.cpp"],
copts = [
"-DMLIR_TRT_TARGET_TENSORRT",
],
copts = ["-DMLIR_TRT_TARGET_TENSORRT"],
linkopts = ["-Wl,-rpath,/opt/src/mlir-tensorrt/bazel-mlir-tensorrt/external/tensorrt10_x86/targets/x86_64-linux-gnu/lib"],
deps = [
":TensorRTRegistration",
Expand Down
4 changes: 2 additions & 2 deletions mlir-tensorrt/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def third_party_deps():
LLVM_COMMIT = "c8b5d30f707757a4fe4d9d0bb01f762665f6942f"
LLVM_SHA256 = "2f45df5b22f3b9db8080bd67899158cf040b4d3fbff3a049cfe1979313e51638"
LLVM_COMMIT = "c49770c60f26e449379447109f7d915bd8de0384"
LLVM_SHA256 = "d4de275d04babe573d8634b9b19c8397de370c6544c01afae121f19413bbfba2"
http_archive(
name = "llvm-raw",
build_file_content = "# empty",
Expand Down
Loading

0 comments on commit 375eac7

Please sign in to comment.