-
Notifications
You must be signed in to change notification settings - Fork 363
refactor: Upgrade bazel and move to MODULE.bazel #3012
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.3.2 | ||
7.2.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,37 @@ | ||
workspace(name = "Torch-TensorRT") | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "rules_python", | ||
sha256 = "863ba0fa944319f7e3d695711427d9ad80ba92c6edd0b7c7443b84e904689539", | ||
strip_prefix = "rules_python-0.22.0", | ||
url = "https://github.com/bazelbuild/rules_python/releases/download/0.22.0/rules_python-0.22.0.tar.gz", | ||
module( | ||
name = "torch_tensorrt", | ||
version = "2.5.0a0", | ||
repo_name = "org_pytorch_tensorrt", | ||
) | ||
|
||
load("@rules_python//python:repositories.bzl", "py_repositories") | ||
|
||
py_repositories() | ||
bazel_dep(name = "googletest", version = "1.14.0") | ||
bazel_dep(name = "platforms", version = "0.0.10") | ||
bazel_dep(name = "rules_cc", version = "0.0.9") | ||
bazel_dep(name = "rules_python", version = "0.34.0") | ||
|
||
http_archive( | ||
name = "rules_pkg", | ||
sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8", | ||
urls = [ | ||
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", | ||
"https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz", | ||
], | ||
python = use_extension("@rules_python//python/extensions:python.bzl", "python") | ||
python.toolchain( | ||
ignore_root_user_error = True, | ||
python_version = "3.11", | ||
) | ||
|
||
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") | ||
|
||
rules_pkg_dependencies() | ||
|
||
http_archive( | ||
name = "googletest", | ||
sha256 = "755f9a39bc7205f5a0c428e920ddad092c33c8a1b46997def3f1d4a82aded6e1", | ||
strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015", | ||
urls = ["https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip"], | ||
bazel_dep(name = "rules_pkg", version = "1.0.1") | ||
git_override( | ||
module_name = "rules_pkg", | ||
commit = "17c57f4", | ||
remote = "https://github.com/narendasan/rules_pkg", | ||
) | ||
|
||
local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "local_repository") | ||
|
||
# External dependency for torch_tensorrt if you already have precompiled binaries. | ||
local_repository( | ||
name = "torch_tensorrt", | ||
path = "/opt/conda/lib/python3.8/site-packages/torch_tensorrt", | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this still be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we just use this for DLFW CI so @apbose might know There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The DLFW CI uses the WORKSPACE.ngc within the docker folder. python3.10 is used there-
@narendasan based on the MODULE.bazel it will use bazel_dep to handle torchTRT dependencies. So what are the use cases when it will use the local_repository rule as compared to the bazel_dep dependencies? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Local repositories still exist for MODULE.bazel, there is just now a bazel package repository for common packages that we use |
||
|
||
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( | ||
name = "cuda", | ||
|
@@ -52,6 +45,8 @@ new_local_repository( | |
path = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/", | ||
) | ||
|
||
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
############################################################################################################# | ||
# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs) | ||
############################################################################################################# | ||
|
@@ -129,18 +124,3 @@ http_archive( | |
# path = "/usr/", | ||
# build_file = "@//third_party/tensorrt/local:BUILD" | ||
#) | ||
|
||
######################################################################### | ||
# Development Dependencies (optional - comment out on aarch64) | ||
######################################################################### | ||
|
||
load("@rules_python//python:pip.bzl", "pip_parse") | ||
|
||
pip_parse( | ||
name = "devtools_deps", | ||
requirements = "//:requirements-dev.txt", | ||
) | ||
|
||
load("@devtools_deps//:requirements.bzl", "install_deps") | ||
|
||
install_deps() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,11 @@ pip install tensorrt==${TRT_VERSION} tensorrt-${CU_VERSION::4}-bindings==${TRT_V | |
|
||
choco install bazelisk -y | ||
|
||
curl -Lo TensorRT.zip https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.1.0/zip/TensorRT-10.1.0.27.Windows.win10.cuda-12.4.zip | ||
unzip -o TensorRT.zip -d C:/ | ||
#curl -Lo TensorRT.zip https://developer.download.nvidia.com/compute/machine-learning/tensorrt/10.0.1/zip/TensorRT-10.0.1.6.Windows10.win10.cuda-12.4.zip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't need to change to TRT 10.0 I think, although it's commented out. |
||
#unzip -o TensorRT.zip -d C:/ | ||
|
||
export CUDA_HOME="$(echo ${CUDA_PATH} | sed -e 's#\\#\/#g')" | ||
|
||
cat toolchains/ci_workspaces/WORKSPACE.win.release.tmpl | envsubst > WORKSPACE | ||
cat toolchains/ci_workspaces/MODULE.bazel.tmpl | envsubst > MODULE.bazel | ||
|
||
echo "RELEASE=1" >> ${GITHUB_ENV} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for overriding specific commit and for usage of your own repo ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theres an issue with building as root in the container without the patches in my fork