Skip to content

Commit f9ab16f

Browse files
committed
Fixed paths
Signed-off-by: Boris Fomitchev <[email protected]>
1 parent fda1ca0 commit f9ab16f

File tree

2 files changed

+28
-81
lines changed

2 files changed

+28
-81
lines changed

WORKSPACE

Lines changed: 27 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,33 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
55

66
http_archive(
7-
name = "rules_python",
8-
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
9-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
10-
)
7+
name = "rules_python",
8+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.2.0/rules_python-0.2.0.tar.gz",
9+
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
10+
)
1111

1212
load("@rules_python//python:pip.bzl", "pip_install")
1313

1414
http_archive(
1515
name = "rules_pkg",
16-
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
1716
urls = [
18-
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
19-
"https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
17+
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
18+
"https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
2019
],
20+
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
2121
)
22-
2322
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
24-
2523
rules_pkg_dependencies()
2624

2725
git_repository(
2826
name = "googletest",
29-
commit = "703bd9caab50b139428cea1aaff9974ebee5742e",
3027
remote = "https://github.com/google/googletest",
31-
shallow_since = "1570114335 -0400",
28+
commit = "703bd9caab50b139428cea1aaff9974ebee5742e",
29+
shallow_since = "1570114335 -0400"
3230
)
3331

3432
# External dependency for torch_tensorrt if you already have precompiled binaries.
33+
# This is currently used in pytorch NGC container CI testing.
3534
local_repository(
3635
name = "torch_tensorrt",
3736
path = "/opt/conda/lib/python3.8/site-packages/torch_tensorrt"
@@ -40,94 +39,44 @@ local_repository(
4039
# CUDA should be installed on the system locally
4140
new_local_repository(
4241
name = "cuda",
42+
path = "/usr/local/cuda",
4343
build_file = "@//third_party/cuda:BUILD",
44-
path = "/usr/local/cuda-11.1/",
4544
)
4645

4746
new_local_repository(
4847
name = "cublas",
4948
build_file = "@//third_party/cublas:BUILD",
5049
path = "/usr",
5150
)
52-
#############################################################################################################
53-
# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
54-
#############################################################################################################
5551

56-
http_archive(
52+
####################################################################################
53+
# Locally installed dependencies (use in cases of custom dependencies or aarch64)
54+
####################################################################################
55+
56+
new_local_repository(
5757
name = "libtorch",
58-
build_file = "@//third_party/libtorch:BUILD",
59-
sha256 = "db57b1023fb33768286a98ba22c44cfe03d6ed158bc2dc0ca1d4928ee5f19f60",
60-
strip_prefix = "libtorch",
61-
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-1.9.1%2Bcu111.zip"],
58+
path = "/opt/conda/lib/python3.8/site-packages/torch",
59+
build_file = "third_party/libtorch/BUILD"
6260
)
6361

64-
http_archive(
62+
new_local_repository(
6563
name = "libtorch_pre_cxx11_abi",
66-
build_file = "@//third_party/libtorch:BUILD",
67-
sha256 = "5563ca53b2b5342f1ab7eef9baf308f197673663ad5b1458a031c46dd802f413",
68-
strip_prefix = "libtorch",
69-
urls = ["https://download.pytorch.org/libtorch/cu111/libtorch-shared-with-deps-1.9.1%2Bcu111.zip"],
64+
path = "/opt/conda/lib/python3.8/site-packages/torch",
65+
build_file = "third_party/libtorch/BUILD"
7066
)
7167

72-
# Download these tarballs manually from the NVIDIA website
73-
# Either place them in the distdir directory in third_party and use the --distdir flag
74-
# or modify the urls to "file:///<PATH TO TARBALL>/<TARBALL NAME>.tar.gz
75-
76-
http_archive(
68+
new_local_repository(
7769
name = "cudnn",
78-
build_file = "@//third_party/cudnn/archive:BUILD",
79-
sha256 = "0e5d2df890b9967efa6619da421310d97323565a79f05a1a8cb9b7165baad0d7",
80-
strip_prefix = "cuda",
81-
urls = [
82-
"https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.2.4/11.4_20210831/cudnn-11.4-linux-x64-v8.2.4.15.tgz",
83-
],
70+
path = "/usr/",
71+
build_file = "@//third_party/cudnn/local:BUILD"
8472
)
8573

86-
http_archive(
74+
new_local_repository(
8775
name = "tensorrt",
88-
build_file = "@//third_party/tensorrt/archive:BUILD",
89-
sha256 = "3177435024ff4aa5a6dba8c1ed06ab11cc0e1bf3bb712dfa63a43422f41313f3",
90-
strip_prefix = "TensorRT-8.0.3.4",
91-
urls = [
92-
"https://developer.nvidia.com/compute/machine-learning/tensorrt/secure/8.0.3/tars/tensorrt-8.0.3.4.linux.x86_64-gnu.cuda-11.3.cudnn8.2.tar.gz",
93-
],
76+
path = "/usr/",
77+
build_file = "@//third_party/tensorrt/local:BUILD"
9478
)
9579

96-
####################################################################################
97-
# Locally installed dependencies (use in cases of custom dependencies or aarch64)
98-
####################################################################################
99-
100-
# NOTE: In the case you are using just the pre-cxx11-abi path or just the cxx11 abi path
101-
# with your local libtorch, just point deps at the same path to satisfy bazel.
102-
103-
# NOTE: NVIDIA's aarch64 PyTorch (python) wheel file uses the CXX11 ABI unlike PyTorch's standard
104-
# x86_64 python distribution. If using NVIDIA's version just point to the root of the package
105-
# for both versions here and do not use --config=pre-cxx11-abi
106-
107-
#new_local_repository(
108-
# name = "libtorch",
109-
# path = "/usr/local/lib/python3.6/dist-packages/torch",
110-
# build_file = "third_party/libtorch/BUILD"
111-
#)
112-
113-
#new_local_repository(
114-
# name = "libtorch_pre_cxx11_abi",
115-
# path = "/usr/local/lib/python3.6/dist-packages/torch",
116-
# build_file = "third_party/libtorch/BUILD"
117-
#)
118-
119-
#new_local_repository(
120-
# name = "cudnn",
121-
# path = "/usr/",
122-
# build_file = "@//third_party/cudnn/local:BUILD"
123-
#)
124-
125-
#new_local_repository(
126-
# name = "tensorrt",
127-
# path = "/usr/",
128-
# build_file = "@//third_party/tensorrt/local:BUILD"
129-
#)
130-
13180
#########################################################################
13281
# Testing Dependencies (optional - comment out on aarch64)
13382
#########################################################################

docker/dist-build.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ cd ${TOP_DIR} \
66
&& mkdir -p dist && cd py \
77
&& MAX_JOBS=1 LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 \
88
python3 setup.py bdist_wheel --use-cxx11-abi $* || exit 1
9-
10-
cd ${TOP_DIR} && cp -r dist/* ../dist/
119

1210
pip3 install ipywidgets --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org
1311
jupyter nbextension enable --py widgetsnbextension
1412
pip3 install timm
1513

1614
# test install
17-
pip3 uninstall -y torch_tensorrt && pip3 install dist/*.whl
15+
pip3 uninstall -y torch_tensorrt && pip3 install ${TOP_DIR}/py/dist/*.whl
1816

0 commit comments

Comments
 (0)