pytorch
/
WORKSPACE
354 строки · 8.8 Кб
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
74http_archive(
75name = "com_github_opentelemetry-cpp",
76urls = [
77"https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.14.2.tar.gz",
78],
79)
80
81new_local_repository(
82name = "gloo",
83build_file = "//third_party:gloo.BUILD",
84path = "third_party/gloo",
85)
86
87new_local_repository(
88name = "onnx",
89build_file = "//third_party:onnx.BUILD",
90path = "third_party/onnx",
91)
92
93local_repository(
94name = "com_google_protobuf",
95path = "third_party/protobuf",
96)
97
98new_local_repository(
99name = "eigen",
100build_file = "//third_party:eigen.BUILD",
101path = "third_party/eigen",
102)
103
104new_local_repository(
105name = "cutlass",
106build_file = "//third_party:cutlass.BUILD",
107path = "third_party/cutlass",
108)
109
110new_local_repository(
111name = "fbgemm",
112build_file = "//third_party:fbgemm/BUILD.bazel",
113path = "third_party/fbgemm",
114repo_mapping = {"@cpuinfo": "@org_pytorch_cpuinfo"},
115)
116
117new_local_repository(
118name = "ideep",
119build_file = "//third_party:ideep.BUILD",
120path = "third_party/ideep",
121)
122
123new_local_repository(
124name = "mkl_dnn",
125build_file = "//third_party:mkl-dnn.BUILD",
126path = "third_party/ideep/mkl-dnn",
127)
128
129new_local_repository(
130name = "org_pytorch_cpuinfo",
131build_file = "//third_party:cpuinfo/BUILD.bazel",
132path = "third_party/cpuinfo",
133)
134
135new_local_repository(
136name = "asmjit",
137build_file = "//third_party:fbgemm/third_party/asmjit.BUILD",
138path = "third_party/fbgemm/third_party/asmjit",
139)
140
141new_local_repository(
142name = "sleef",
143build_file = "//third_party:sleef.BUILD",
144path = "third_party/sleef",
145)
146
147new_local_repository(
148name = "fmt",
149build_file = "//third_party:fmt.BUILD",
150path = "third_party/fmt",
151)
152
153new_local_repository(
154name = "kineto",
155build_file = "//third_party:kineto.BUILD",
156path = "third_party/kineto",
157)
158
159new_local_repository(
160name = "opentelemetry-cpp",
161build_file = "//third_party::opentelemetry-cpp.BUILD",
162path = "third_party/opentelemetry-cpp",
163)
164
165new_local_repository(
166name = "cpp-httplib",
167build_file = "//third_party:cpp-httplib.BUILD",
168path = "third_party/cpp-httplib",
169)
170
171new_local_repository(
172name = "nlohmann",
173build_file = "//third_party:nlohmann.BUILD",
174path = "third_party/nlohmann",
175)
176
177new_local_repository(
178name = "tensorpipe",
179build_file = "//third_party:tensorpipe.BUILD",
180path = "third_party/tensorpipe",
181)
182
183http_archive(
184name = "mkl",
185build_file = "//third_party:mkl.BUILD",
186sha256 = "59154b30dd74561e90d547f9a3af26c75b6f4546210888f09c9d4db8f4bf9d4c",
187strip_prefix = "lib",
188urls = [
189"https://anaconda.org/anaconda/mkl/2020.0/download/linux-64/mkl-2020.0-166.tar.bz2",
190],
191)
192
193http_archive(
194name = "mkl_headers",
195build_file = "//third_party:mkl_headers.BUILD",
196sha256 = "2af3494a4bebe5ddccfdc43bacc80fcd78d14c1954b81d2c8e3d73b55527af90",
197urls = [
198"https://anaconda.org/anaconda/mkl-include/2020.0/download/linux-64/mkl-include-2020.0-166.tar.bz2",
199],
200)
201
202http_archive(
203name = "rules_python",
204# TODO Fix bazel linter to support hashes for release tarballs.
205#
206# sha256 = "94750828b18044533e98a129003b6a68001204038dc4749f40b195b24c38f49f",
207strip_prefix = "rules_python-0.21.0",
208url = "https://github.com/bazelbuild/rules_python/releases/download/0.21.0/rules_python-0.21.0.tar.gz",
209)
210
211load("@rules_python//python:repositories.bzl", "py_repositories")
212
213py_repositories()
214
215load("@rules_python//python:repositories.bzl", "python_register_toolchains")
216
217python_register_toolchains(
218name = "python3_10",
219python_version = "3.10",
220)
221
222load("@python3_10//:defs.bzl", "interpreter")
223load("@rules_python//python:pip.bzl", "pip_parse")
224
225pip_parse(
226name = "pip_deps",
227python_interpreter_target = interpreter,
228requirements_lock = "//:tools/build/bazel/requirements.txt",
229)
230
231load("@pip_deps//:requirements.bzl", "install_deps")
232
233install_deps()
234
235load("@pybind11_bazel//:python_configure.bzl", "python_configure")
236
237python_configure(
238name = "local_config_python",
239python_interpreter_target = interpreter,
240)
241
242load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
243
244protobuf_deps()
245
246new_local_repository(
247name = "cuda",
248build_file = "@//third_party:cuda.BUILD",
249path = "/usr/local/cuda",
250)
251
252new_local_repository(
253name = "cudnn",
254build_file = "@//third_party:cudnn.BUILD",
255path = "/usr/local/cuda",
256)
257
258new_local_repository(
259name = "cudnn_frontend",
260build_file = "@//third_party:cudnn_frontend.BUILD",
261path = "third_party/cudnn_frontend/",
262)
263
264local_repository(
265name = "com_github_google_flatbuffers",
266path = "third_party/flatbuffers",
267)
268
269local_repository(
270name = "google_benchmark",
271path = "third_party/benchmark",
272)
273
274local_repository(
275name = "com_google_googletest",
276path = "third_party/googletest",
277)
278
279local_repository(
280name = "pthreadpool",
281path = "third_party/pthreadpool",
282repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
283)
284
285local_repository(
286name = "FXdiv",
287path = "third_party/FXdiv",
288repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
289)
290
291local_repository(
292name = "XNNPACK",
293path = "third_party/XNNPACK",
294repo_mapping = {"@com_google_benchmark": "@google_benchmark"},
295)
296
297local_repository(
298name = "gemmlowp",
299path = "third_party/gemmlowp/gemmlowp",
300)
301
302### Unused repos start
303
304# `unused` repos are defined to hide bazel files from submodules of submodules.
305# This allows us to run `bazel build //...` and not worry about the submodules madness.
306# Otherwise everything traverses recursively and a lot of submodules of submodules have
307# they own bazel build files.
308
309local_repository(
310name = "unused_tensorpipe_googletest",
311path = "third_party/tensorpipe/third_party/googletest",
312)
313
314local_repository(
315name = "unused_fbgemm",
316path = "third_party/fbgemm",
317)
318
319local_repository(
320name = "unused_ftm_bazel",
321path = "third_party/fmt/support/bazel",
322)
323
324local_repository(
325name = "unused_kineto_fmt_bazel",
326path = "third_party/kineto/libkineto/third_party/fmt/support/bazel",
327)
328
329local_repository(
330name = "unused_kineto_dynolog_googletest",
331path = "third_party/kineto/libkineto/third_party/dynolog/third_party/googletest",
332)
333
334local_repository(
335name = "unused_kineto_dynolog_gflags",
336path = "third_party/kineto/libkineto/third_party/dynolog/third_party/gflags",
337)
338
339local_repository(
340name = "unused_kineto_dynolog_glog",
341path = "third_party/kineto/libkineto/third_party/dynolog/third_party/glog",
342)
343
344local_repository(
345name = "unused_kineto_googletest",
346path = "third_party/kineto/libkineto/third_party/googletest",
347)
348
349local_repository(
350name = "unused_onnx_benchmark",
351path = "third_party/onnx/third_party/benchmark",
352)
353
354### Unused repos end
355