@@ -4,34 +4,34 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4
4
5
5
http_archive (
6
6
name = "icu" ,
7
- strip_prefix = "icu-release-64-2" ,
7
+ build_file = "//third_party/icu:BUILD.bzl" ,
8
+ patch_args = ["-p1" ],
9
+ patches = ["//third_party/icu:udata.patch" ],
8
10
sha256 = "dfc62618aa4bd3ca14a3df548cd65fe393155edd213e49c39f3a30ccd618fc27" ,
11
+ strip_prefix = "icu-release-64-2" ,
9
12
urls = [
10
13
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/unicode-org/icu/archive/release-64-2.zip" ,
11
14
"https://github.com/unicode-org/icu/archive/release-64-2.zip" ,
12
15
],
13
- build_file = "//third_party/icu:BUILD.bzl" ,
14
- patches = ["//third_party/icu:udata.patch" ],
15
- patch_args = ["-p1" ],
16
16
)
17
17
18
18
http_archive (
19
19
name = "com_google_sentencepiece" ,
20
- strip_prefix = "sentencepiece-0.1.96" ,
20
+ build_file = "//third_party/sentencepiece:BUILD" ,
21
+ patch_args = ["-p1" ],
22
+ patches = ["//third_party/sentencepiece:sp.patch" ],
21
23
sha256 = "8409b0126ebd62b256c685d5757150cf7fcb2b92a2f2b98efb3f38fc36719754" ,
24
+ strip_prefix = "sentencepiece-0.1.96" ,
22
25
urls = [
23
- "https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip"
26
+ "https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip" ,
24
27
],
25
- build_file = "//third_party/sentencepiece:BUILD" ,
26
- patches = ["//third_party/sentencepiece:sp.patch" ],
27
- patch_args = ["-p1" ],
28
28
)
29
29
30
30
http_archive (
31
31
name = "cppitertools" ,
32
- urls = ["https://github.com/ryanhaining/cppitertools/archive/refs/tags/v2.0.zip" ],
33
32
sha256 = "e56741b108d6baced98c4ccd83fd0d5a545937f2845978799c28d0312c0dee3d" ,
34
33
strip_prefix = "cppitertools-2.0" ,
34
+ urls = ["https://github.com/ryanhaining/cppitertools/archive/refs/tags/v2.0.zip" ],
35
35
)
36
36
37
37
http_archive (
@@ -56,10 +56,10 @@ http_archive(
56
56
57
57
http_archive (
58
58
name = "org_tensorflow" ,
59
- strip_prefix = "tensorflow-40998f44c0c500ce0f6e3b1658dfbc54f838a82a" ,
60
59
sha256 = "5a5bc4599964c71277dcac0d687435291e5810d2ac2f6283cc96736febf73aaf" ,
60
+ strip_prefix = "tensorflow-40998f44c0c500ce0f6e3b1658dfbc54f838a82a" ,
61
61
urls = [
62
- "https://github.com/tensorflow/tensorflow/archive/40998f44c0c500ce0f6e3b1658dfbc54f838a82a.zip"
62
+ "https://github.com/tensorflow/tensorflow/archive/40998f44c0c500ce0f6e3b1658dfbc54f838a82a.zip" ,
63
63
],
64
64
)
65
65
@@ -74,13 +74,13 @@ http_archive(
74
74
75
75
http_archive (
76
76
name = "pybind11" ,
77
+ build_file = "//third_party/pybind11:BUILD.bzl" ,
78
+ sha256 = "efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240" ,
79
+ strip_prefix = "pybind11-2.13.4" ,
77
80
urls = [
78
81
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/pybind/pybind11/archive/v2.13.4.tar.gz" ,
79
82
"https://github.com/pybind/pybind11/archive/v2.13.4.tar.gz" ,
80
83
],
81
- sha256 = "efc901aa0aab439a3fea6efeaf930b5a349fb06394bf845c64ce15a9cf8f0240" ,
82
- strip_prefix = "pybind11-2.13.4" ,
83
- build_file = "//third_party/pybind11:BUILD.bzl" ,
84
84
)
85
85
86
86
http_archive (
@@ -90,6 +90,16 @@ http_archive(
90
90
url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.4.1/rules_shell-v0.4.1.tar.gz" ,
91
91
)
92
92
93
+ # Initialize Rules ML Toolchain
94
+ http_archive (
95
+ name = "rules_ml_toolchain" ,
96
+ sha256 = "874a69ad71ed76ca425fb2ce4906cb38da0f624b7fd678807858e010f4f3eff3" ,
97
+ strip_prefix = "rules_ml_toolchain-extra-download-clang-fix" ,
98
+ urls = [
99
+ "https://github.com/google-ml-infra/rules_ml_toolchain/archive/refs/heads/extra-download-clang-fix.tar.gz" ,
100
+ ],
101
+ )
102
+
93
103
# Initialize hermetic Python
94
104
load ("@org_tensorflow//third_party/py:python_init_rules.bzl" , "python_init_rules" )
95
105
@@ -99,27 +109,31 @@ load("//tensorflow_text:tftext.bzl", "py_deps_profile")
99
109
100
110
py_deps_profile (
101
111
name = "release_or_nightly" ,
102
- requirements_in = "//oss_scripts/pip_package:requirements.in" ,
103
- pip_repo_name = "pypi" ,
104
112
deps_map = {
105
- "tensorflow" : ["tf-nightly" , "tf_header_lib" , "libtensorflow_framework" ],
106
- "tf-keras" : ["tf-keras-nightly" ]
113
+ "tensorflow" : [
114
+ "tf-nightly" ,
115
+ "tf_header_lib" ,
116
+ "libtensorflow_framework" ,
117
+ ],
118
+ "tf-keras" : ["tf-keras-nightly" ],
107
119
},
120
+ pip_repo_name = "pypi" ,
121
+ requirements_in = "//oss_scripts/pip_package:requirements.in" ,
108
122
switch = {
109
- "IS_NIGHTLY" : "nightly"
110
- }
123
+ "IS_NIGHTLY" : "nightly" ,
124
+ },
111
125
)
112
126
113
127
load ("@org_tensorflow//third_party/py:python_init_repositories.bzl" , "python_init_repositories" )
114
128
115
129
python_init_repositories (
130
+ default_python_version = "system" ,
116
131
requirements = {
117
132
"3.9" : "//oss_scripts/pip_package:requirements_lock_3_9.txt" ,
118
133
"3.10" : "//oss_scripts/pip_package:requirements_lock_3_10.txt" ,
119
134
"3.11" : "//oss_scripts/pip_package:requirements_lock_3_11.txt" ,
120
135
"3.12" : "//oss_scripts/pip_package:requirements_lock_3_12.txt" ,
121
136
},
122
- default_python_version = "system" ,
123
137
)
124
138
125
139
load ("@org_tensorflow//third_party/py:python_init_toolchains.bzl" , "python_init_toolchains" )
@@ -136,18 +150,28 @@ install_deps()
136
150
137
151
# Initialize TensorFlow dependencies.
138
152
load ("@org_tensorflow//tensorflow:workspace3.bzl" , "tf_workspace3" )
153
+
139
154
tf_workspace3 ()
155
+
140
156
load ("@org_tensorflow//tensorflow:workspace2.bzl" , "tf_workspace2" )
157
+
141
158
tf_workspace2 ()
159
+
142
160
load ("@org_tensorflow//tensorflow:workspace1.bzl" , "tf_workspace1" )
161
+
143
162
tf_workspace1 ()
163
+
144
164
load ("@org_tensorflow//tensorflow:workspace0.bzl" , "tf_workspace0" )
165
+
145
166
tf_workspace0 ()
146
167
147
168
# Set up Android.
148
169
load ("@org_tensorflow//third_party/android:android_configure.bzl" , "android_configure" )
149
- android_configure (name = "local_config_android" )
170
+
171
+ android_configure (name = "local_config_android" )
172
+
150
173
load ("@local_config_android//:android.bzl" , "android_workspace" )
174
+
151
175
android_workspace ()
152
176
153
177
load (
@@ -158,7 +182,7 @@ load(
158
182
python_wheel_version_suffix_repository (name = "tf_wheel_version_suffix" )
159
183
160
184
load (
161
- "@local_xla//third_party/gpus/ cuda/hermetic :cuda_json_init_repository.bzl" ,
185
+ "@rules_ml_toolchain//gpu/ cuda:cuda_json_init_repository.bzl" ,
162
186
"cuda_json_init_repository" ,
163
187
)
164
188
@@ -170,7 +194,7 @@ load(
170
194
"CUDNN_REDISTRIBUTIONS" ,
171
195
)
172
196
load (
173
- "@local_xla//third_party/gpus/ cuda/hermetic :cuda_redist_init_repositories.bzl" ,
197
+ "@rules_ml_toolchain//gpu/ cuda:cuda_redist_init_repositories.bzl" ,
174
198
"cuda_redist_init_repositories" ,
175
199
"cudnn_redist_init_repository" ,
176
200
)
@@ -184,21 +208,21 @@ cudnn_redist_init_repository(
184
208
)
185
209
186
210
load (
187
- "@local_xla//third_party/gpus/ cuda/hermetic :cuda_configure.bzl" ,
211
+ "@rules_ml_toolchain//gpu/ cuda:cuda_configure.bzl" ,
188
212
"cuda_configure" ,
189
213
)
190
214
191
215
cuda_configure (name = "local_config_cuda" )
192
216
193
217
load (
194
- "@local_xla//third_party /nccl/hermetic :nccl_redist_init_repository.bzl" ,
218
+ "@rules_ml_toolchain//gpu /nccl:nccl_redist_init_repository.bzl" ,
195
219
"nccl_redist_init_repository" ,
196
220
)
197
221
198
222
nccl_redist_init_repository ()
199
223
200
224
load (
201
- "@local_xla//third_party /nccl/hermetic :nccl_configure.bzl" ,
225
+ "@rules_ml_toolchain//gpu /nccl:nccl_configure.bzl" ,
202
226
"nccl_configure" ,
203
227
)
204
228
0 commit comments