@@ -25,21 +25,30 @@ http_archive(
25
25
load ("@rules_pkg//:deps.bzl" , "rules_pkg_dependencies" )
26
26
rules_pkg_dependencies ()
27
27
28
+ git_repository (
29
+ name = "googletest" ,
30
+ remote = "https://github.com/google/googletest" ,
31
+ commit = "703bd9caab50b139428cea1aaff9974ebee5742e" ,
32
+ shallow_since = "1570114335 -0400"
33
+ )
34
+
28
35
# CUDA should be installed on the system locally
29
36
new_local_repository (
30
37
name = "cuda" ,
31
- path = "/usr/local/cuda-10.2/targets/x86_64-linux/ " ,
38
+ path = "/usr/local/cuda-10.2/" ,
32
39
build_file = "@//third_party/cuda:BUILD" ,
33
40
)
34
41
35
- http_archive (
36
- name = "libtorch_pre_cxx11_abi" ,
37
- build_file = "@//third_party/libtorch:BUILD" ,
38
- strip_prefix = "libtorch" ,
39
- sha256 = "ea8de17c5f70015583f3a7a43c7a5cdf91a1d4bd19a6a7bc11f074ef6cd69e27" ,
40
- urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-shared-with-deps-1.5.0.zip" ],
42
+ new_local_repository (
43
+ name = "cublas" ,
44
+ path = "/usr" ,
45
+ build_file = "@//third_party/cublas:BUILD" ,
41
46
)
42
47
48
+ #############################################################################################################
49
+ # Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
50
+ #############################################################################################################
51
+
43
52
http_archive (
44
53
name = "libtorch" ,
45
54
build_file = "@//third_party/libtorch:BUILD" ,
@@ -48,23 +57,18 @@ http_archive(
48
57
sha256 = "0efdd4e709ab11088fa75f0501c19b0e294404231442bab1d1fb953924feb6b5"
49
58
)
50
59
51
- pip3_import (
52
- name = "trtorch_py_deps" ,
53
- requirements = "//py:requirements.txt"
54
- )
55
-
56
- load ("@trtorch_py_deps//:requirements.bzl" , "pip_install" )
57
- pip_install ()
58
-
59
- pip3_import (
60
- name = "py_test_deps" ,
61
- requirements = "//tests/py:requirements.txt"
60
+ http_archive (
61
+ name = "libtorch_pre_cxx11_abi" ,
62
+ build_file = "@//third_party/libtorch:BUILD" ,
63
+ strip_prefix = "libtorch" ,
64
+ sha256 = "ea8de17c5f70015583f3a7a43c7a5cdf91a1d4bd19a6a7bc11f074ef6cd69e27" ,
65
+ urls = ["https://download.pytorch.org/libtorch/cu102/libtorch-shared-with-deps-1.5.0.zip" ],
62
66
)
63
67
64
- load ("@py_test_deps//:requirements.bzl" , "pip_install" )
65
- pip_install ()
68
+ # Download these tarballs manually from the NVIDIA website
69
+ # Either place them in the distdir directory in third_party and use the --distdir flag
70
+ # or modify the urls to "file:///<PATH TO TARBALL>/<TARBALL NAME>.tar.gz
66
71
67
- # Downloaded distributions to use with --distdir
68
72
http_archive (
69
73
name = "cudnn" ,
70
74
urls = ["https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.5.32/Production/10.2_20191118/cudnn-10.2-linux-x64-v7.6.5.32.tgz" ],
@@ -81,22 +85,57 @@ http_archive(
81
85
strip_prefix = "TensorRT-7.0.0.11"
82
86
)
83
87
84
- ## Locally installed dependencies
85
- # new_local_repository(
88
+ ####################################################################################
89
+ # Locally installed dependencies (use in cases of custom dependencies or aarch64)
90
+ ####################################################################################
91
+
92
+ # NOTE: In the case you are using just the pre-cxx11-abi path or just the cxx11 abi path
93
+ # with your local libtorch, just point deps at the same path to satisfy bazel.
94
+
95
+ # NOTE: NVIDIA's aarch64 PyTorch (python) wheel file uses the CXX11 ABI unlike PyTorch's standard
96
+ # x86_64 python distribution. If using NVIDIA's version just point to the root of the package
97
+ # for both versions here and do not use --config=pre-cxx11-abi
98
+
99
+ #new_local_repository(
100
+ # name = "libtorch",
101
+ # path = "/usr/local/lib/python3.6/dist-packages/torch",
102
+ # build_file = "third_party/libtorch/BUILD"
103
+ #)
104
+
105
+ #new_local_repository(
106
+ # name = "libtorch_pre_cxx11_abi",
107
+ # path = "/usr/local/lib/python3.6/dist-packages/torch",
108
+ # build_file = "third_party/libtorch/BUILD"
109
+ #)
110
+
111
+ #new_local_repository(
86
112
# name = "cudnn",
87
113
# path = "/usr/",
88
114
# build_file = "@//third_party/cudnn/local:BUILD"
89
115
#)
90
116
91
- # new_local_repository(
117
+ #new_local_repository(
92
118
# name = "tensorrt",
93
119
# path = "/usr/",
94
120
# build_file = "@//third_party/tensorrt/local:BUILD"
95
121
#)
96
122
97
- git_repository (
98
- name = "googletest" ,
99
- remote = "https://github.com/google/googletest" ,
100
- commit = "703bd9caab50b139428cea1aaff9974ebee5742e" ,
101
- shallow_since = "1570114335 -0400"
123
+ #########################################################################
124
+ # Testing Dependencies (optional - comment out on aarch64)
125
+ #########################################################################
126
+ pip3_import (
127
+ name = "trtorch_py_deps" ,
128
+ requirements = "//py:requirements.txt"
102
129
)
130
+
131
+ load ("@trtorch_py_deps//:requirements.bzl" , "pip_install" )
132
+ pip_install ()
133
+
134
+ pip3_import (
135
+ name = "py_test_deps" ,
136
+ requirements = "//tests/py:requirements.txt"
137
+ )
138
+
139
+ load ("@py_test_deps//:requirements.bzl" , "pip_install" )
140
+ pip_install ()
141
+
0 commit comments