8000 Removal of BAZEL build files from python package and changes to make cpp tests work [WIP] by apbose · Pull Request #3641 · pytorch/TensorRT · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Removal of BAZEL build files from python package and changes to make cpp tests work [WIP] #3641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
27 changes: 24 additions & 3 deletions docker/MODULE.bazel.ngc
< 8000 td id="diff-a3fd65c5db8150776684188b0f8e40c4f1b7afd57ee836d02df4b6c2d2622209R24" data-line-number="24" class="blob-num blob-num-context js-linkable-line-number js-blob-rnum">
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ git_override(

local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository")


new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")


# External dependency for torch_tensorrt if you already have precompiled binaries.
local_repository(
new_local_repository(
name = "torch_tensorrt",
build_file = "@//third_party:BUILD",
path = "/usr/local/lib/python3.12/dist-packages/torch_tensorrt/",
)

new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")


# CUDA should be installed on the system locally
new_local_repository(
Expand All @@ -55,8 +58,26 @@ new_local_repository(
build_file = "third_party/libtorch/BUILD"
)

new_local_repository(
name = "torch_l4t",
path = "/usr/local/lib/python3.12/dist-packages/torch/",
build_file = "third_party/libtorch/BUILD"
)

new_local_repository(
name = "tensorrt",
path = "/usr/",
build_file = "@//third_party/tensorrt/local:BUILD"
)

new_local_repository(
name = "tensorrt_sbsa",
path = "/usr/",
build_file = "@//third_party/tensorrt/local:BUILD"
)

new_local_repository(
name = "tensorrt_l4t",
path = "/usr/",
build_file = "@//third_party/tensorrt/local:BUILD"
)
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,6 @@ def run(self):
package_data.update(
{
"torch_tensorrt": [
"BUILD",
"WORKSPACE",
"include/torch_tensorrt/*.h",
"include/torch_tensorrt/core/*.h",
"include/torch_tensorrt/core/conversion/*.h",
Expand Down Expand Up @@ -643,8 +641,6 @@ def run(self):
package_data.update(
{
"torch_tensorrt": [
"BUILD",
"WORKSPACE",
"include/torch_tensorrt/*.h",
"include/torch_tensorrt/core/*.h",
"include/torch_tensorrt/core/runtime/*.h",
Expand Down
83 changes: 83 additions & 0 deletions third_party/BUILD
94E9
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
load("@rules_cc//cc:cc_library.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

oad("@rules_cc//cc:defs.bzl", "cc_library")

config_setting(
name = "aarch64_linux",
constraint_values = [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
],
)

config_setting(
name = "windows",
constraint_values = [
"@platforms//os:windows",
],
)

cc_library(
name = "libtorchtrt",
srcs = select({
":windows": [
"lib/x64/torchtrt.dll",
],
"//conditions:default": [
"lib/libtorchtrt.so",
],
}),
hdrs = glob([
"include/**/*.h",
]),
includes = ["include/"],
strip_include_prefix = "include",
)

cc_library(
name = "libtorchtrt_runtime",
srcs = select({
":windows": [
"lib/x64/torchtrt_runtime.dll",
],
"//conditions:default": [
"lib/libtorchtrt_runtime.so",
],
}),
)

cc_library(
name = "libtorchtrt_plugins",
srcs = select({
":windows": [
"lib/x64/torchtrt_plugins.dll",
],
"//conditions:default": [
"lib/libtorchtrt_plugins.so",
],
}),
hdrs = glob([
"include/torch_tensorrt/core/plugins/**/*.h",
]),
includes = ["include/"],
strip_include_prefix = "include",
)

cc_library(
name = "torch_tensorrt_core_hdrs",
hdrs = glob([
"include/torch_tensorrt/core/**/*.h",
]),
includes = ["include/torch_tensorrt/"],
strip_include_prefix = "include/torch_tensorrt",
)

# Alias for ease of use
cc_library(
name = "torch_tensorrt",
deps = [
":libtorchtrt",
],
)
Loading
0