diff --git a/WORKSPACE b/WORKSPACE index b5b90f39b..30627523e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,34 +4,34 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "icu", - strip_prefix = "icu-release-64-2", + build_file = "//third_party/icu:BUILD.bzl", + patch_args = ["-p1"], + patches = ["//third_party/icu:udata.patch"], sha256 = "dfc62618aa4bd3ca14a3df548cd65fe393155edd213e49c39f3a30ccd618fc27", + strip_prefix = "icu-release-64-2", urls = [ "https://storage.googleapis.com/mirror.tensorflow.org/github.com/unicode-org/icu/archive/release-64-2.zip", "https://github.com/unicode-org/icu/archive/release-64-2.zip", ], - build_file = "//third_party/icu:BUILD.bzl", - patches = ["//third_party/icu:udata.patch"], - patch_args = ["-p1"], ) http_archive( name = "com_google_sentencepiece", - strip_prefix = "sentencepiece-0.1.96", + build_file = "//third_party/sentencepiece:BUILD", + patch_args = ["-p1"], + patches = ["//third_party/sentencepiece:sp.patch"], sha256 = "8409b0126ebd62b256c685d5757150cf7fcb2b92a2f2b98efb3f38fc36719754", + strip_prefix = "sentencepiece-0.1.96", urls = [ - "https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip" + "https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip", ], - build_file = "//third_party/sentencepiece:BUILD", - patches = ["//third_party/sentencepiece:sp.patch"], - patch_args = ["-p1"], ) http_archive( name = "cppitertools", - urls = ["https://github.com/ryanhaining/cppitertools/archive/refs/tags/v2.0.zip"], sha256 = "e56741b108d6baced98c4ccd83fd0d5a545937f2845978799c28d0312c0dee3d", strip_prefix = "cppitertools-2.0", + urls = ["https://github.com/ryanhaining/cppitertools/archive/refs/tags/v2.0.zip"], ) http_archive( @@ -56,10 +56,10 @@ http_archive( http_archive( name = "org_tensorflow", - strip_prefix = "tensorflow-40998f44c0c500ce0f6e3b1658dfbc54f838a82a", sha256 = "5a5bc4599964c71277dcac0d687435291e5810d2ac2f6283cc96736febf73aaf", + strip_prefix = "tensorflow-40998f44c0c500ce0f6e3b1658dfbc54f838a82a", urls = [ - "https://github.com/tensorflow/tensorflow/archive/40998f44c0c500ce0f6e3b1658dfbc54f838a82a.zip" + "https://github.com/tensorflow/tensorflow/archive/40998f44c0c500ce0f6e3b1658dfbc54f838a82a.zip", ], ) @@ -74,13 +74,13 @@ http_archive( http_archive( name = "pybind11", + build_file = "//third_party/pybind11:BUILD.bzl", + sha256 = "efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240", + strip_prefix = "pybind11-2.13.4", urls = [ "https://storage.googleapis.com/mirror.tensorflow.org/github.com/pybind/pybind11/archive/v2.13.4.tar.gz", "https://github.com/pybind/pybind11/archive/v2.13.4.tar.gz", ], - sha256 = "efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240", - strip_prefix = "pybind11-2.13.4", - build_file = "//third_party/pybind11:BUILD.bzl", ) http_archive( @@ -90,6 +90,23 @@ http_archive( url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.4.1/rules_shell-v0.4.1.tar.gz", ) +# Initialize Rules ML Toolchain +http_archive( + name = "rules_ml_toolchain", + sha256 = "874a69ad71ed76ca425fb2ce4906cb38da0f624b7fd678807858e010f4f3eff3", + strip_prefix = "rules_ml_toolchain-extra-download-clang-fix", + urls = [ + "https://github.com/google-ml-infra/rules_ml_toolchain/archive/refs/heads/extra-download-clang-fix.tar.gz", + ], +) + +load( + "@rules_ml_toolchain//cc/deps:cc_toolchain_deps.bzl", + "cc_toolchain_deps", +) + +cc_toolchain_deps() + # Initialize hermetic Python load("@org_tensorflow//third_party/py:python_init_rules.bzl", "python_init_rules") @@ -99,27 +116,31 @@ load("//tensorflow_text:tftext.bzl", "py_deps_profile") py_deps_profile( name = "release_or_nightly", - requirements_in = "//oss_scripts/pip_package:requirements.in", - pip_repo_name = "pypi", deps_map = { - "tensorflow": ["tf-nightly", "tf_header_lib", "libtensorflow_framework"], - "tf-keras": ["tf-keras-nightly"] + "tensorflow": [ + "tf-nightly", + "tf_header_lib", + "libtensorflow_framework", + ], + "tf-keras": ["tf-keras-nightly"], }, + pip_repo_name = "pypi", + requirements_in = "//oss_scripts/pip_package:requirements.in", switch = { - "IS_NIGHTLY": "nightly" - } + "IS_NIGHTLY": "nightly", + }, ) load("@org_tensorflow//third_party/py:python_init_repositories.bzl", "python_init_repositories") python_init_repositories( + default_python_version = "system", requirements = { "3.9": "//oss_scripts/pip_package:requirements_lock_3_9.txt", "3.10": "//oss_scripts/pip_package:requirements_lock_3_10.txt", "3.11": "//oss_scripts/pip_package:requirements_lock_3_11.txt", "3.12": "//oss_scripts/pip_package:requirements_lock_3_12.txt", }, - default_python_version = "system", ) load("@org_tensorflow//third_party/py:python_init_toolchains.bzl", "python_init_toolchains") @@ -136,18 +157,28 @@ install_deps() # Initialize TensorFlow dependencies. load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3") + tf_workspace3() + load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2") + tf_workspace2() + load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1") + tf_workspace1() + load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0") + tf_workspace0() # Set up Android. load("@org_tensorflow//third_party/android:android_configure.bzl", "android_configure") -android_configure(name="local_config_android") + +android_configure(name = "local_config_android") + load("@local_config_android//:android.bzl", "android_workspace") + android_workspace() load( @@ -158,7 +189,7 @@ load( python_wheel_version_suffix_repository(name = "tf_wheel_version_suffix") load( - "@local_xla//third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl", + "@rules_ml_toolchain//gpu/cuda:cuda_json_init_repository.bzl", "cuda_json_init_repository", ) @@ -170,7 +201,7 @@ load( "CUDNN_REDISTRIBUTIONS", ) load( - "@local_xla//third_party/gpus/cuda/hermetic:cuda_redist_init_repositories.bzl", + "@rules_ml_toolchain//gpu/cuda:cuda_redist_init_repositories.bzl", "cuda_redist_init_repositories", "cudnn_redist_init_repository", ) @@ -184,21 +215,21 @@ cudnn_redist_init_repository( ) load( - "@local_xla//third_party/gpus/cuda/hermetic:cuda_configure.bzl", + "@rules_ml_toolchain//gpu/cuda:cuda_configure.bzl", "cuda_configure", ) cuda_configure(name = "local_config_cuda") load( - "@local_xla//third_party/nccl/hermetic:nccl_redist_init_repository.bzl", + "@rules_ml_toolchain//gpu/nccl:nccl_redist_init_repository.bzl", "nccl_redist_init_repository", ) nccl_redist_init_repository() load( - "@local_xla//third_party/nccl/hermetic:nccl_configure.bzl", + "@rules_ml_toolchain//gpu/nccl:nccl_configure.bzl", "nccl_configure", )