-
Notifications
You must be signed in to change notification settings - Fork 191
Expand file tree
/
Copy pathMODULE.bazel
More file actions
419 lines (368 loc) · 13.1 KB
/
Copy pathMODULE.bazel
File metadata and controls
419 lines (368 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
module(
name = "zml",
)
bazel_dep(name = "abseil-cpp", version = "20260526.0", repo_name = "com_google_absl")
# Work around abseil-cpp#2071 until the BCR release includes the Clang BMI2 fix.
single_version_override(
module_name = "abseil-cpp",
patch_strip = 1,
patches = [
"//:third_party/abseil-cpp/bmi2intrin.patch",
],
version = "20260526.0",
)
bazel_dep(name = "bazel_lib", version = "3.7.2")
bazel_dep(name = "aspect_rules_py", version = "1.8.4")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
## Needed by iree
bazel_dep(name = "libbacktrace", version = "1.0.0-20250926-7939218")
bazel_dep(name = "patchelf", version = "0.18.0.bcr.1")
bazel_dep(name = "pcre2", version = "10.45")
bazel_dep(name = "platforms", version = "1.1.0")
bazel_dep(name = "protobuf", version = "35.0", repo_name = "com_google_protobuf")
bazel_dep(name = "pybind11_bazel", version = "3.0.1")
bazel_dep(name = "re2", version = "2025-11-05", repo_name = "com_googlesource_code_re2")
bazel_dep(name = "rules_cc", version = "0.2.19")
bazel_dep(name = "rules_distroless", version = "0.8.0")
# Once the rules_distroless can parse unspaced apt version constraints
# Update the rules_distroless version and remove the patch
# https://github.com/bazel-contrib/rules_distroless/pull/229
single_version_override(
module_name = "rules_distroless",
patch_strip = 1,
patches = [
"//:third_party/rules_distroless/accept-nospace-version-constraints.patch",
],
version = "0.8.0",
)
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_oci", version = "2.2.7")
bazel_dep(name = "rules_proto", version = "7.1.0")
bazel_dep(name = "rules_python", version = "1.9.0")
bazel_dep(name = "rules_shell", version = "0.6.1")
# repo_name = None prevents rules_swift from eagerly auto-registering toolchains.
bazel_dep(name = "rules_swift", version = "3.6.1", repo_name = None)
bazel_dep(name = "rules_zig", version = "0.15.1")
bazel_dep(name = "tar.bzl", version = "0.10.4")
bazel_dep(name = "llvm", version = "0.8.24")
bazel_dep(name = "zlib-ng", version = "2.3.3", repo_name = "llvm_zlib")
bazel_dep(name = "zstd", version = "1.5.7.bcr.1", repo_name = "llvm_zstd")
bazel_dep(name = "with_cfg.bzl", version = "0.14.4")
bazel_dep(name = "grpc", version = "1.80.0")
single_version_override(
module_name = "grpc",
patch_strip = 1,
patches = [
"//:third_party/grpc/protobuf-35-upb-load.patch",
"//:third_party/grpc/grpc++_unsecure-visibility.patch",
],
version = "1.80.0",
)
single_version_override(
module_name = "envoy_api",
version = "0.0.0-20250128-4de3c74",
)
# Added to support bazel 9+ since an old version is pulled by GRPC.
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
bazel_dep(name = "buildifier_prebuilt", version = "8.5.1", dev_dependency = True)
# BSDTar toolchains
tar_toolchains = use_extension("@tar.bzl//tar:extensions.bzl", "toolchains")
use_repo(
tar_toolchains,
"bsd_tar_toolchains_darwin_amd64",
"bsd_tar_toolchains_darwin_arm64",
"bsd_tar_toolchains_linux_amd64",
"bsd_tar_toolchains_linux_arm64",
"bsd_tar_toolchains_windows_amd64",
"bsd_tar_toolchains_windows_arm64",
)
###
### Zig toolchain
zig = use_extension("@rules_zig//zig:extensions.bzl", "zig")
zig.index(file = "//bazel:zig_index.json")
zig.toolchain(
# Ensure Zig actions are run locally only
extra_exec_compatible_with = ["//platforms:local_execution"],
zig_version = "0.16.0",
)
zig.mirrors(urls = [
"https://pkg.machengine.org/zig",
"https://zigmirror.hryx.net/zig",
"https://zig.linus.dev/zig",
"https://zig.squirl.dev",
"https://zig.florent.dev",
"https://zig.mirror.mschae23.de/zig",
"https://zigmirror.meox.dev",
"https://ziglang.freetls.fastly.net",
"https://zig.tilok.dev",
"https://zig-mirror.tsimnet.eu/zig",
"https://zig.karearl.com/zig",
"https://pkg.earth/zig",
"https://fs.liujiacai.net/zigbuilds",
"https://ziglang.org/builds/",
])
use_repo(zig, "zig_toolchains")
register_toolchains("@rules_zig//zig/target:all")
register_toolchains("@zig_toolchains//:all")
register_toolchains("//:translate_c_toolchain")
# Add the local execution platform to the set of eligible execution platforms
# This is used so that Zig toolchains that are only declared as compatible with
# the constraints described by this platform be selected and matched with only
# this platform only.
# This ensures Zig actions only run locally because they're slower remotely
# due to the Zig compilation model which concentrates one action for the whole
# build graph.
register_execution_platforms("//platforms:local_execution_platform")
zls = use_extension("@rules_zig//zig/zls:extensions.bzl", "zls")
zls.index(file = "@rules_zig//zig/zls/private:versions.json")
zls.toolchain(
zig_version = "0.16.0",
zls_version = "0.16.0",
)
use_repo(zls, "zls_toolchains")
register_toolchains("@zls_toolchains//:all")
###
### LLVM Bootstrapped toolchains
register_toolchains("@llvm//toolchain:all")
###
uv = use_extension("@rules_python//python/uv:uv.bzl", "uv", dev_dependency = True)
uv.configure(version = "0.9.30")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.12")
use_repo(python, "python_3_12", "python_versions")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip_neuron = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip_neuron.parse(
download_only = True,
extra_pip_args = [
"--abi=cp312",
"--implementation=cp",
"--python-version=312",
"--platform=linux_x86_64",
"--platform=manylinux2014_x86_64",
"--platform=manylinux_2_27_x86_64",
"--platform=manylinux_2_28_x86_64",
"--platform=manylinux_2_29_x86_64",
],
hub_name = "neuron_py_deps",
python_version = "3.12",
requirements_lock = "//platforms/neuron:requirements.lock.txt",
target_platforms = ["linux_x86_64"],
)
use_repo(pip_neuron, "neuron_py_deps")
# For downloading models
pip.parse(
download_only = True,
hub_name = "huggingface_hub",
python_version = "3.12",
requirements_lock = "//tools/hf:requirements.lock.txt",
)
use_repo(pip, "huggingface_hub")
pip.parse(
download_only = True,
# fsspec[gcs] -> gcsfs -> fsspec is a circular dependency, install them together.
experimental_requirement_cycles = {
"fsspec": [
"fsspec",
"gcsfs",
],
},
hub_name = "xprof",
python_version = "3.12",
requirements_lock = "//tools/xprof:requirements.lock.txt",
)
use_repo(pip, "xprof")
cpu = use_extension("//platforms/cpu:cpu.bzl", "cpu_plugin")
use_repo(cpu, "libzml_cpu_darwin_amd64", "libzml_cpu_darwin_arm64", "libzml_cpu_linux_amd64")
cuda = use_extension("//platforms/cuda:cuda.bzl", "cuda_packages")
use_repo(cuda, "cuda_nvml_dev_linux_sbsa", "cuda_nvml_dev_linux_x86_64", "cuda_nvtx_linux_sbsa", "cuda_nvtx_linux_x86_64", "libzml_cuda_linux_amd64", "libzml_cuda_linux_arm64", "zlib1g_linux_amd64", "zlib1g_linux_arm64")
rocm = use_extension("//platforms/rocm:rocm.bzl", "rocm_packages")
use_repo(
rocm,
"amdrocm-amdsmi",
"amdrocm-base",
"amdrocm-blas",
"amdrocm-dnn",
"amdrocm-fft",
"amdrocm-llvm",
"amdrocm-math-common",
"amdrocm-profiler-base",
"amdrocm-rccl",
"amdrocm-runtime",
"amdrocm-solver",
"amdrocm-sparse",
"amdrocm-sysdeps",
"libatomic1",
"libdrm-common",
"libzml_rocm",
)
oneapi = use_extension("//platforms/oneapi:oneapi.bzl", "oneapi_packages")
use_repo(oneapi, "libzml_oneapi")
tpu = use_extension("//platforms/tpu:tpu.bzl", "tpu_packages")
use_repo(tpu, "libzml_tpu")
neuron = use_extension("//platforms/neuron:neuron.bzl", "neuron_packages")
use_repo(neuron, "aws-neuronx-collectives", "aws-neuronx-runtime-lib", "aws-neuronx-tools", "libgcc_s1", "libgomp1", "libstdcpp6", "libzml_neuron")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "sevenzip_darwin_amd64",
build_file_content = """exports_files(["7zz"])""",
sha256 = "26aa75bc262bb10bf0805617b95569c3035c2c590a99f7db55c7e9607b2685e0",
urls = ["https://www.7-zip.org/a/7z2501-mac.tar.xz"],
)
# Host tools for the portable AEA extraction path.
http_archive(
name = "sevenzip_darwin_arm64",
build_file_content = """exports_files(["7zz"])""",
sha256 = "26aa75bc262bb10bf0805617b95569c3035c2c590a99f7db55c7e9607b2685e0",
urls = ["https://www.7-zip.org/a/7z2501-mac.tar.xz"],
)
http_archive(
name = "sevenzip_linux_amd64",
build_file_content = """exports_files(["7zz"])""",
sha256 = "4ca3b7c6f2f67866b92622818b58233dc70367be2f36b498eb0bdeaaa44b53f4",
urls = ["https://www.7-zip.org/a/7z2501-linux-x64.tar.xz"],
)
http_archive(
name = "ipsw_linux_amd64",
build_file_content = """exports_files(["ipsw"])""",
sha256 = "923c1caa44d3adaf2b792725c6209e879a13ab68af462ae5adfe1d611e2f3653",
urls = ["https://github.com/blacktop/ipsw/releases/download/v3.1.729/ipsw_3.1.729_linux_x86_64.tar.gz"],
)
http_archive(
name = "sevenzip_linux_arm64",
build_file_content = """exports_files(["7zz"])""",
sha256 = "39c5140f02ce4436599303c59a149f654cb1bbc47cdc105a942120d747ae040d",
urls = ["https://www.7-zip.org/a/7z2501-linux-arm64.tar.xz"],
)
http_archive(
name = "ipsw_linux_arm64",
build_file_content = """exports_files(["ipsw"])""",
sha256 = "fdef33729a0cb1d6be0cbffe677a97fb167e6af07fda3eafd03137ce607e92b4",
urls = ["https://github.com/blacktop/ipsw/releases/download/v3.1.729/ipsw_3.1.729_linux_arm64.tar.gz"],
)
http_aea_archive = use_repo_rule("//bazel:http_aea_archive.bzl", "http_aea_archive")
http_aea_archive(
name = "metal_toolchain",
archive_decryption_key = "v7VbaT39JmQPp5p4N3HoVPAKcZ5vyhY+nnjMRD79z5E=",
build_file = "//platforms/metal:metal_toolchain.BUILD.bazel",
canonical_id = "com.apple.MobileAsset.MetalToolchain-17B54",
includes = ["Metal.xctoolchain/*"],
sha256 = "84f1cec3984878294777349e794f7bff0407e501a728bd600dc8605fa36abf6f",
urls = [
"https://updates.cdn-apple.com/2025/mobileassets/022-20354/192ADD28-31EE-43C8-972D-E5BED5FB1845/com_apple_MobileAsset_MetalToolchain/637B0E26-E00A-488B-BA3B-CB50A8ECFD74.aar",
],
)
metal = use_extension("//platforms/metal:metal.bzl", "metal_packages")
use_repo(metal, "libzml_metal")
non_module_deps = use_extension("//:third_party/non_module_deps.bzl", "non_module_deps")
use_repo(
non_module_deps,
"arocc",
"cloud_accelerator_diagnostics",
"com_google_sentencepiece",
"cuda_tile",
"cute_ir",
"flashattn_linux_amd64",
"flashattn_linux_arm64",
"flashinfer_cutlass_moe_linux_amd64",
"flashinfer_cutlass_moe_linux_arm64",
"flydsl",
"iree",
"libvaxis",
"linenoise",
"mnist",
"mosaic_tpu",
"org_swig_swig",
"stb",
"translate-c",
"uucode",
"xla",
"zigimg",
"zio",
)
xla = use_extension("//third_party/xla:xla.bzl", "xla")
use_repo(
xla,
"com_github_grpc_grpc",
"eigen_archive",
"farmhash_archive",
"farmhash_gpu_archive",
"highwayhash",
"hwloc",
"llvm-raw",
"local_config_cuda",
"local_config_remote_execution",
"local_config_rocm",
"local_config_sycl",
"local_config_tensorrt",
"ml_dtypes_py",
"python_version_repo",
"rules_ml_toolchain",
"shardy",
"snappy",
"stablehlo",
"sycl_configure",
"sycl_configure_ext",
"triton",
"tsl",
)
llvm = use_extension("//third_party/xla:llvm.bzl", "llvm")
llvm.configure(targets = [
"X86",
"NVPTX",
"AMDGPU",
"AArch64",
])
use_repo(llvm, "llvm-project")
apt = use_extension("@rules_distroless//apt:extensions.bzl", "apt")
apt.install(
name = "apt_cpu",
lock = "//platforms/cpu:packages.lock.json",
manifest = "//platforms/cpu:packages.yaml",
)
use_repo(apt, "apt_cpu")
apt.install(
name = "apt_cuda",
lock = "//platforms/cuda:packages.lock.json",
manifest = "//platforms/cuda:packages.yaml",
)
use_repo(apt, "apt_cuda")
apt.install(
name = "apt_rocm",
lock = "//platforms/rocm:packages.lock.json",
manifest = "//platforms/rocm:packages.yaml",
)
use_repo(apt, "apt_rocm")
apt.install(
name = "apt_oneapi",
lock = "//platforms/oneapi:packages.lock.json",
manifest = "//platforms/oneapi:packages.yaml",
resolve_transitive = False,
)
use_repo(apt, "apt_oneapi")
apt.install(
name = "apt_neuron",
lock = "//platforms/neuron:packages.lock.json",
manifest = "//platforms/neuron:packages.yaml",
)
use_repo(apt, "apt_neuron")
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "distroless_cc_debian12",
digest = "sha256:eccec5274132c1be0ce5d2c8e6fe41033e64af5e987ccee9007826e4c012069d",
image = "gcr.io/distroless/cc-debian12",
platforms = ["linux/amd64"],
)
oci.pull(
name = "debian_12",
digest = "sha256:bc960ef50e6feed90686c593361df158517556ed1d2d98e5d1df3724024e0f49",
image = "mirror.gcr.io/library/debian:12",
platforms = ["linux/amd64"],
)
use_repo(
oci,
"debian_12",
"debian_12_linux_amd64",
"distroless_cc_debian12",
"distroless_cc_debian12_linux_amd64",
)