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.2.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.6.2") 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") 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.9") 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, hub_name = "xprof_nightly", python_version = "3.12", requirements_lock = "//tools/xprof:requirements.lock.txt", ) use_repo(pip, "xprof_nightly") cpu = use_extension("//platforms/cpu:cpu.bzl", "cpu_pjrt_plugin") use_repo(cpu, "libpjrt_cpu_darwin_amd64", "libpjrt_cpu_darwin_arm64", "libpjrt_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", "libpjrt_cuda_linux_amd64", "libpjrt_cuda_linux_arm64", "zlib1g_linux_amd64", "zlib1g_linux_arm64") rocm = use_extension("//platforms/rocm:rocm.bzl", "rocm_packages") use_repo(rocm, "amd-smi-lib", "hipblaslt", "libdrm-amdgpu-amdgpu1", "libdrm2-amdgpu", "libpjrt_rocm", "rocblas", "rocprofiler-sdk", "rocprofiler-sdk-roctx") oneapi = use_extension("//platforms/oneapi:oneapi.bzl", "oneapi_packages") use_repo(oneapi, "libpjrt_oneapi") tpu = use_extension("//platforms/tpu:tpu.bzl", "tpu_packages") use_repo(tpu, "libpjrt_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", "libpjrt_neuron", "libstdcpp6") http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "sevenzip_macos", build_file_content = """exports_files(["7zz"])""", sha256 = "26aa75bc262bb10bf0805617b95569c3035c2c590a99f7db55c7e9607b2685e0", urls = ["https://www.7-zip.org/a/7z2501-mac.tar.xz"], ) 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=", canonical_id = "com.apple.MobileAsset.MetalToolchain-17B54", 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", ], build_file = "//platforms/metal:metal_toolchain.BUILD.bazel", includes = ["Metal.xctoolchain/*"], ) metal = use_extension("//platforms/metal:metal.bzl", "metal_packages") use_repo(metal, "libpjrt_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", "flashattn_linux_amd64", "flashattn_linux_arm64", "iree", "libvaxis", "linenoise", "mnist", "mosaic_tpu", "org_swig_swig", "stb", "translate-c", "uucode", "xla", "zigimg") 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() use_repo(llvm, "llvm-project") apt = use_extension("@rules_distroless//apt:extensions.bzl", "apt") 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_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", )