Skip to content

Removal of BAZEL build files from python package and changes to make cpp tests work #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 4 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
6 changes: 2 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ pkg_tar(
name = "libtorchtrt",
srcs = [
"//:LICENSE",
"//bzl_def:BUILD",
"//bzl_def:WORKSPACE",
"//third_party/torch_tensorrt:BUILD",
],
extension = "tar.gz",
package_dir = "torch_tensorrt",
Expand All @@ -107,8 +106,7 @@ pkg_tar(
name = "libtorchtrt_runtime",
srcs = [
"//:LICENSE",
"//bzl_def:BUILD",
"//bzl_def:WORKSPACE",
"//third_party/torch_tensorrt:BUILD",
],
extension = "tar.gz",
package_dir = "torch_tensorrt_runtime",
Expand Down
10 changes: 6 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ 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",
path = "/opt/conda/lib/python3.11/site-packages/torch_tensorrt",
build_file = "@//third_party/torch_tensorrt:BUILD",
path = "/usr/local/lib/python3.12/site-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
# for linux x86_64 and aarch64
new_local_repository(
Expand Down
1 change: 0 additions & 1 deletion bzl_def/WORKSPACE

This file was deleted.

27 changes: 24 additions & 3 deletions docker/MODULE.bazel.ngc
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/torch_tensorrt: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 @@ -613,8 +613,6 @@ def run(self):
package_data.update(
{
"torch_tensorrt": [
"BUILD",
"WORKSPACE",
"include/torch_tensorrt/*.h",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just delete the bzl folder now?

"include/torch_tensorrt/core/*.h",
"include/torch_tensorrt/core/conversion/*.h",
Expand Down Expand Up @@ -644,8 +642,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
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package(default_visibility = ["//visibility:public"])

exports_files([
"WORKSPACE",
"BUILD",
])
])
Loading