pytorch
/
WORKSPACE
350 строк · 8.7 Кб
1workspace(name = "pytorch")
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4load("//tools/rules:workspace.bzl", "new_patched_local_repository")
5
6http_archive(
7name = "rules_cc",
8patches = [
9"//:tools/rules_cc/cuda_support.patch",
10],
11strip_prefix = "rules_cc-40548a2974f1aea06215272d9c2b47a14a24e556",
12urls = [
13"https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/40548a2974f1aea06215272d9c2b47a14a24e556.tar.gz",
14"https://github.com/bazelbuild/rules_cc/archive/40548a2974f1aea06215272d9c2b47a14a24e556.tar.gz",
15],
16)
17
18http_archive(
19name = "rules_cuda",
20strip_prefix = "runtime-b1c7cce21ba4661c17ac72421c6a0e2015e7bef3/third_party/rules_cuda",
21urls = ["https://github.com/tensorflow/runtime/archive/b1c7cce21ba4661c17ac72421c6a0e2015e7bef3.tar.gz"],
22)
23
24load("@rules_cuda//cuda:dependencies.bzl", "rules_cuda_dependencies")
25
26rules_cuda_dependencies(with_rules_cc = False)
27
28load("@rules_cc//cc:repositories.bzl", "rules_cc_toolchains")
29
30rules_cc_toolchains()
31
32http_archive(
33name = "bazel_skylib",
34urls = [
35"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
36],
37)
38
39http_archive(
40name = "pybind11_bazel",
41strip_prefix = "pybind11_bazel-b162c7c88a253e3f6b673df0c621aca27596ce6b",
42urls = ["https://github.com/pybind/pybind11_bazel/archive/b162c7c88a253e3f6b673df0c621aca27596ce6b.zip"],
43)
44
45new_local_repository(
46name = "pybind11",
47build_file = "@pybind11_bazel//:pybind11.BUILD",
48path = "third_party/pybind11",
49)
50
51http_archive(
52name = "com_github_glog",
53build_file_content = """
54licenses(['notice'])
55
56load(':bazel/glog.bzl', 'glog_library')
57# TODO: figure out why enabling gflags leads to SIGSEV on the logging init
58glog_library(with_gflags=0)
59""",
60strip_prefix = "glog-0.4.0",
61urls = [
62"https://github.com/google/glog/archive/v0.4.0.tar.gz",
63],
64)
65
66http_archive(
67name = "com_github_gflags_gflags",
68strip_prefix = "gflags-2.2.2",
69urls = [
70"https://github.com/gflags/gflags/archive/v2.2.2.tar.gz",
71],
72)
73
74new_local_repository(
75name = "gloo",
76build_file = "//third_party:gloo.BUILD",
77path = "third_party/gloo",
78)
79
80new_local_repository(
81name = "onnx",
82build_file = "//third_party:onnx.BUILD",
83path = "third_party/onnx",
84)
85
86new_local_repository(
87name = "foxi",
88build_file = "//third_party:foxi.BUILD",
89path = "third_party/foxi",
90)
91
92local_repository(
93name = "com_google_protobuf",
94path = "third_party/protobuf",
95)
96
97new_local_repository(
98name = "eigen",
99build_file = "//third_party:eigen.BUILD",
100path = "third_party/eigen",
101)
102
103new_local_repository(
104name = "cutlass",
105build_file = "//third_party:cutlass.BUILD",
106path = "third_party/cutlass",
107)
108
109new_local_repository(
110name = "fbgemm",
111build_file = "//third_party:fbgemm/BUILD.bazel",
112path = "third_party/fbgemm",
113repo_mapping = {"@cpuinfo": "@org_pytorch_cpuinfo"},
114)
115
116new_local_repository(
117name = "ideep",
118build_file = "//third_party:ideep.BUILD",
119path = "third_party/ideep",
120)
121
122new_local_repository(
123name = "mkl_dnn",
124build_file = "//third_party:mkl-dnn.BUILD",
125path = "third_party/ideep/mkl-dnn",
126)
127
128new_local_repository(
129name = "org_pytorch_cpuinfo",
130build_file = "//third_party:cpuinfo/BUILD.bazel",
131path = "third_party/cpuinfo",
132)
133
134new_local_repository(
135name = "asmjit",
136build_file = "//third_party:fbgemm/third_party/asmjit.BUILD",
137path = "third_party/fbgemm/third_party/asmjit",
138)
139
140new_local_repository(
141name = "sleef",
142build_file = "//third_party:sleef.BUILD",
143path = "third_party/sleef",
144)
145
146new_local_repository(
147name = "fmt",
148build_file = "//third_party:fmt.BUILD",
149path = "third_party/fmt",
150)
151
152new_local_repository(
153name = "kineto",
154build_file = "//third_party:kineto.BUILD",
155path = "third_party/kineto",
156)
157
158new_patched_local_repository(
159name = "tbb",
160build_file = "//third_party:tbb.BUILD",
161patch_strip = 1,
162patches = [
163"@//third_party:tbb.patch",
164],
165path = "third_party/tbb",
166)
167
168new_local_repository(
169name = "tensorpipe",
170build_file = "//third_party:tensorpipe.BUILD",
171path = "third_party/tensorpipe",
172)
173
174http_archive(
175name = "mkl",
176build_file = "//third_party:mkl.BUILD",
177sha256 = "59154b30dd74561e90d547f9a3af26c75b6f4546210888f09c9d4db8f4bf9d4c",
178strip_prefix = "lib",
179urls = [
180"https://anaconda.org/anaconda/mkl/2020.0/download/linux-64/mkl-2020.0-166.tar.bz2",
181],
182)
183
184http_archive(
185name = "mkl_headers",
186build_file = "//third_party:mkl_headers.BUILD",
187sha256 = "2af3494a4bebe5ddccfdc43bacc80fcd78d14c1954b81d2c8e3d73b55527af90",
188urls = [
189"https://anaconda.org/anaconda/mkl-include/2020.0/download/linux-64/mkl-include-2020.0-166.tar.bz2",
190],
191)
192
193http_archive(
194name = "rules_python",
195# TODO Fix bazel linter to support hashes for release tarballs.
196#
197# sha256 = "94750828b18044533e98a129003b6a68001204038dc4749f40b195b24c38f49f",
198strip_prefix = "rules_python-0.21.0",
199url = "https://github.com/bazelbuild/rules_python/releases/download/0.21.0/rules_python-0.21.0.tar.gz",
200)
201
202load("@rules_python//python:repositories.bzl", "py_repositories")
203
204py_repositories()
205
206load("@rules_python//python:repositories.bzl", "python_register_toolchains")
207
208python_register_toolchains(
209name = "python3_8",
210python_version = "3.8",
211)
212
213load("@python3_8//:defs.bzl", "interpreter")
214load("@rules_python//python:pip.bzl", "pip_parse")
215
216pip_parse(
217name = "pip_deps",
218python_interpreter_target = interpreter,
219requirements_lock = "//:tools/build/bazel/requirements.txt",
220)
221
222load("@pip_deps//:requirements.bzl", "install_deps")
223
224install_deps()
225
226load("@pybind11_bazel//:python_configure.bzl", "python_configure")
227
228python_configure(
229name = "local_config_python",
230python_interpreter_target = interpreter,
231)
232
233load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
234
235protobuf_deps()
236
237new_local_repository(
238name = "cuda",
239build_file = "@//third_party:cuda.BUILD",
240path = "/usr/local/cuda",
241)
242
243new_local_repository(
244name = "cudnn",
245build_file = "@//third_party:cudnn.BUILD",
246path = "/usr/local/cuda",
247)
248
249new_local_repository(
250name = "cudnn_frontend",
251build_file = "@//third_party:cudnn_frontend.BUILD",
252path = "third_party/cudnn_frontend/",
253)
254
255local_repository(
256name = "com_github_google_flatbuffers",
257path = "third_party/flatbuffers",
258)
259
260local_repository(
261name = "google_benchmark",
262path = "third_party/benchmark",
263)
264
265local_repository(
266name = "com_google_googletest",
267path = "third_party/googletest",
268)
269
270local_repository(
271name = "pthreadpool",
272path = "third_party/pthreadpool",
273repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
274)
275
276local_repository(
277name = "FXdiv",
278path = "third_party/FXdiv",
279repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
280)
281
282local_repository(
283name = "XNNPACK",
284path = "third_party/XNNPACK",
285repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
286)
287
288local_repository(
289name = "gemmlowp",
290path = "third_party/gemmlowp/gemmlowp",
291)
292
293### Unused repos start
294
295# `unused` repos are defined to hide bazel files from submodules of submodules.
296# This allows us to run `bazel build //...` and not worry about the submodules madness.
297# Otherwise everything traverses recursively and a lot of submodules of submodules have
298# they own bazel build files.
299
300local_repository(
301name = "unused_tensorpipe_googletest",
302path = "third_party/tensorpipe/third_party/googletest",
303)
304
305local_repository(
306name = "unused_fbgemm",
307path = "third_party/fbgemm",
308)
309
310local_repository(
311name = "unused_ftm_bazel",
312path = "third_party/fmt/support/bazel",
313)
314
315local_repository(
316name = "unused_kineto_fmt_bazel",
317path = "third_party/kineto/libkineto/third_party/fmt/support/bazel",
318)
319
320local_repository(
321name = "unused_kineto_dynolog_googletest",
322path = "third_party/kineto/libkineto/third_party/dynolog/third_party/googletest",
323)
324
325local_repository(
326name = "unused_kineto_dynolog_gflags",
327path = "third_party/kineto/libkineto/third_party/dynolog/third_party/gflags",
328)
329
330local_repository(
331name = "unused_kineto_dynolog_glog",
332path = "third_party/kineto/libkineto/third_party/dynolog/third_party/glog",
333)
334
335local_repository(
336name = "unused_kineto_googletest",
337path = "third_party/kineto/libkineto/third_party/googletest",
338)
339
340local_repository(
341name = "unused_onnx_benchmark",
342path = "third_party/onnx/third_party/benchmark",
343)
344
345local_repository(
346name = "unused_onnx_tensorrt_benchmark",
347path = "third_party/onnx-tensorrt/third_party/onnx/third_party/benchmark",
348)
349
350### Unused repos end
351