@@ -2,6 +2,28 @@ workspace(name = "org_tensorflow_text")
22
33load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
44
5+ # Toolchains for ML projects hermetic builds. 
6+ # Details: https://github.com/google-ml-infra/rules_ml_toolchain 
7+ http_archive (
8+     name  =  "rules_ml_toolchain" ,
9+     sha256  =  "de3b14418657eeacd8afc2aa89608be6ec8d66cd6a5de81c4f693e77bc41bee1" ,
10+     strip_prefix  =  "rules_ml_toolchain-5653e5a0ca87c1272069b4b24864e55ce7f129a1" ,
11+     urls  =  [
12+         "https://github.com/google-ml-infra/rules_ml_toolchain/archive/5653e5a0ca87c1272069b4b24864e55ce7f129a1.tar.gz" ,
13+     ],
14+ )
15+ 
16+ load (
17+     "@rules_ml_toolchain//cc_toolchain/deps:cc_toolchain_deps.bzl" ,
18+     "cc_toolchain_deps" ,
19+ )
20+ 
21+ cc_toolchain_deps ()
22+ 
23+ register_toolchains ("@rules_ml_toolchain//cc_toolchain:lx64_lx64" )
24+ 
25+ register_toolchains ("@rules_ml_toolchain//cc_toolchain:lx64_lx64_cuda" )
26+ 
527http_archive (
628    name  =  "icu" ,
729    strip_prefix  =  "icu-release-64-2" ,
@@ -56,10 +78,10 @@ http_archive(
5678
5779http_archive (
5880    name  =  "org_tensorflow" ,
59-     strip_prefix  =  "tensorflow-40998f44c0c500ce0f6e3b1658dfbc54f838a82a " ,
60-     sha256  =  "5a5bc4599964c71277dcac0d687435291e5810d2ac2f6283cc96736febf73aaf " ,
81+     sha256  =  "1a25308b15036bf8006ada5c9955ddc9a217792e6fc24deee04626ec07013f2c " ,
82+     strip_prefix  =  "tensorflow-72fbba3d20f4616d7312b5e2b7f79daf6e82f2fa " ,
6183    urls  =  [
62-         "https://github.com/tensorflow/tensorflow/archive/40998f44c0c500ce0f6e3b1658dfbc54f838a82a .zip" 
84+         "https://github.com/tensorflow/tensorflow/archive/72fbba3d20f4616d7312b5e2b7f79daf6e82f2fa .zip" , 
6385    ],
6486)
6587
@@ -134,6 +156,14 @@ load("@pypi//:requirements.bzl", "install_deps")
134156
135157install_deps ()
136158
159+ load ("//oss_scripts/pip_package:tensorflow_text_python_wheel.bzl" , "tensorflow_text_python_wheel_repository" )
160+ 
161+ tensorflow_text_python_wheel_repository (
162+     name  =  "tensorflow_text_wheel" ,
163+     version_key  =  "__version__" ,
164+     version_source  =  "//tensorflow_text:__init__.py" ,
165+ )
166+ 
137167# Initialize TensorFlow dependencies. 
138168load ("@org_tensorflow//tensorflow:workspace3.bzl" , "tf_workspace3" )
139169tf_workspace3 ()
@@ -151,14 +181,16 @@ load("@local_config_android//:android.bzl", "android_workspace")
151181android_workspace ()
152182
153183load (
154-     "@local_xla/ /third_party/py:python_wheel.bzl" ,
184+     "@org_tensorflow//third_party/xla /third_party/py:python_wheel.bzl" ,
155185    "python_wheel_version_suffix_repository" ,
156186)
157187
158- python_wheel_version_suffix_repository (name  =  "tf_wheel_version_suffix" )
188+ python_wheel_version_suffix_repository (
189+     name  =  "tf_wheel_version_suffix" ,
190+ )
159191
160192load (
161-     "@local_xla //third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl" ,
193+     "@rules_ml_toolchain //third_party/gpus/cuda/hermetic:cuda_json_init_repository.bzl" ,
162194    "cuda_json_init_repository" ,
163195)
164196
@@ -170,7 +202,7 @@ load(
170202    "CUDNN_REDISTRIBUTIONS" ,
171203)
172204load (
173-     "@local_xla //third_party/gpus/cuda/hermetic:cuda_redist_init_repositories.bzl" ,
205+     "@rules_ml_toolchain //third_party/gpus/cuda/hermetic:cuda_redist_init_repositories.bzl" ,
174206    "cuda_redist_init_repositories" ,
175207    "cudnn_redist_init_repository" ,
176208)
@@ -184,21 +216,21 @@ cudnn_redist_init_repository(
184216)
185217
186218load (
187-     "@local_xla //third_party/gpus/cuda/hermetic:cuda_configure.bzl" ,
219+     "@rules_ml_toolchain //third_party/gpus/cuda/hermetic:cuda_configure.bzl" ,
188220    "cuda_configure" ,
189221)
190222
191223cuda_configure (name  =  "local_config_cuda" )
192224
193225load (
194-     "@local_xla //third_party/nccl/hermetic:nccl_redist_init_repository.bzl" ,
226+     "@rules_ml_toolchain //third_party/nccl/hermetic:nccl_redist_init_repository.bzl" ,
195227    "nccl_redist_init_repository" ,
196228)
197229
198230nccl_redist_init_repository ()
199231
200232load (
201-     "@local_xla //third_party/nccl/hermetic:nccl_configure.bzl" ,
233+     "@rules_ml_toolchain //third_party/nccl/hermetic:nccl_configure.bzl" ,
202234    "nccl_configure" ,
203235)
204236
0 commit comments