Skip to content

Commit 4d165c7

Browse files
committed
Merge remote-tracking branch 'staging/master' into pushsync
2 parents 054b515 + eabee43 commit 4d165c7

760 files changed

Lines changed: 87036 additions & 3755 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

configure.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,9 @@ def setup_python(environ_cp):
229229
# Set-up env variables used by python_configure.bzl
230230
write_action_env_to_bazelrc('PYTHON_BIN_PATH', python_bin_path)
231231
write_action_env_to_bazelrc('PYTHON_LIB_PATH', python_lib_path)
232-
write_to_bazelrc('build --define PYTHON_BIN_PATH="%s"' % python_bin_path)
233-
write_to_bazelrc('build --define PYTHON_LIB_PATH="%s"' % python_lib_path)
234232
write_to_bazelrc('build --force_python=py%s' % python_major_version)
235233
write_to_bazelrc('build --host_force_python=py%s' % python_major_version)
236234
write_to_bazelrc('build --python_path=\"%s"' % python_bin_path)
237-
write_to_bazelrc('test --force_python=py%s' % python_major_version)
238-
write_to_bazelrc('test --host_force_python=py%s' % python_major_version)
239-
write_to_bazelrc('test --define PYTHON_BIN_PATH="%s"' % python_bin_path)
240-
write_to_bazelrc('test --define PYTHON_LIB_PATH="%s"' % python_lib_path)
241-
write_to_bazelrc('run --define PYTHON_BIN_PATH="%s"' % python_bin_path)
242-
write_to_bazelrc('run --define PYTHON_LIB_PATH="%s"' % python_lib_path)
243235
environ_cp['PYTHON_BIN_PATH'] = python_bin_path
244236

245237
# Write tools/python_bin_path.sh
@@ -488,10 +480,14 @@ def set_cc_opt_flags(environ_cp):
488480
cc_opt_flags = get_from_env_or_user_or_default(environ_cp, 'CC_OPT_FLAGS',
489481
question, default_cc_opt_flags)
490482
for opt in cc_opt_flags.split():
491-
host_opt = '-march=native' # It should be safe on the same build host.
492-
write_to_bazelrc(
493-
'build:opt --cxxopt=%s --copt=%s' % (opt, opt) +
494-
' --host_cxxopt=%s --host_copt=%s' % (host_opt, host_opt))
483+
write_to_bazelrc('build:opt --copt=%s' % opt)
484+
# It should be safe on the same build host.
485+
write_to_bazelrc('build:opt --host_copt=-march=native')
486+
write_to_bazelrc('build:opt --define with_default_optimizations=true')
487+
# TODO(mikecase): Remove these default defines once we are able to get
488+
# TF Lite targets building without them.
489+
write_to_bazelrc('build --copt=-DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK')
490+
write_to_bazelrc('build --host_copt=-DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK')
495491

496492

497493
def set_tf_cuda_clang(environ_cp):
@@ -968,7 +964,6 @@ def set_other_mpi_vars(environ_cp):
968964
def set_mkl():
969965
write_to_bazelrc('build:mkl --define using_mkl=true')
970966
write_to_bazelrc('build:mkl -c opt')
971-
write_to_bazelrc('build:mkl --copt="-DEIGEN_USE_VML"')
972967
print(
973968
'Add "--config=mkl" to your bazel command to build with MKL '
974969
'support.\nPlease note that MKL on MacOS or windows is still not '
@@ -1023,7 +1018,6 @@ def main():
10231018
environ_cp['TF_NEED_OPENCL_SYCL'] = '0'
10241019
environ_cp['TF_NEED_COMPUTECPP'] = '0'
10251020
environ_cp['TF_NEED_OPENCL'] = '0'
1026-
environ_cp['TF_NEED_S3'] = '0'
10271021
environ_cp['TF_CUDA_CLANG'] = '0'
10281022

10291023
if is_macos():

tensorflow/BUILD

Lines changed: 103 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ config_setting(
119119

120120
config_setting(
121121
name = "no_tensorflow_py_deps",
122-
values = {"define": "no_tensorflow_py_deps=true"},
122+
define_values = {"no_tensorflow_py_deps": "true"},
123123
visibility = ["//visibility:public"],
124124
)
125125

@@ -175,55 +175,122 @@ config_setting(
175175
# TODO(jhseu): Enable on other platforms other than Linux.
176176
config_setting(
177177
name = "with_jemalloc_linux_x86_64",
178-
values = {
179-
"cpu": "k8",
180-
"define": "with_jemalloc=true",
181-
},
178+
define_values = {"with_jemalloc": "true"},
179+
values = {"cpu": "k8"},
182180
visibility = ["//visibility:public"],
183181
)
184182

185183
config_setting(
186184
name = "with_jemalloc_linux_ppc64le",
187-
values = {
188-
"cpu": "ppc",
189-
"define": "with_jemalloc=true",
190-
},
185+
define_values = {"with_jemalloc": "true"},
186+
values = {"cpu": "ppc"},
187+
visibility = ["//visibility:public"],
188+
)
189+
190+
config_setting(
191+
name = "with_default_optimizations",
192+
define_values = {"with_default_optimizations": "true"},
191193
visibility = ["//visibility:public"],
192194
)
193195

194196
config_setting(
195197
name = "with_gcp_support",
196-
values = {"define": "with_gcp_support=true"},
198+
define_values = {"with_gcp_support": "true"},
197199
visibility = ["//visibility:public"],
198200
)
199201

200202
config_setting(
201203
name = "with_hdfs_support",
202-
values = {"define": "with_hdfs_support=true"},
204+
define_values = {"with_hdfs_support": "true"},
203205
visibility = ["//visibility:public"],
204206
)
205207

206208
config_setting(
207209
name = "with_s3_support",
208-
values = {"define": "with_s3_support=true"},
210+
define_values = {"with_s3_support": "true"},
211+
visibility = ["//visibility:public"],
212+
)
213+
214+
# Crosses between platforms and file system libraries not supported on those
215+
# platforms due to limitations in nested select() statements.
216+
config_setting(
217+
name = "with_gcp_support_windows_override",
218+
define_values = {"with_gcp_support": "true"},
219+
values = {"cpu": "x64_windows"},
220+
visibility = ["//visibility:public"],
221+
)
222+
223+
config_setting(
224+
name = "with_hdfs_support_windows_override",
225+
define_values = {"with_hdfs_support": "true"},
226+
values = {"cpu": "x64_windows"},
227+
visibility = ["//visibility:public"],
228+
)
229+
230+
config_setting(
231+
name = "with_s3_support_windows_override",
232+
define_values = {"with_s3_support": "true"},
233+
values = {"cpu": "x64_windows"},
234+
visibility = ["//visibility:public"],
235+
)
236+
237+
config_setting(
238+
name = "with_gcp_support_android_override",
239+
define_values = {"with_gcp_support": "true"},
240+
values = {"crosstool_top": "//external:android/crosstool"},
241+
visibility = ["//visibility:public"],
242+
)
243+
244+
config_setting(
245+
name = "with_hdfs_support_android_override",
246+
define_values = {"with_hdfs_support": "true"},
247+
values = {"crosstool_top": "//external:android/crosstool"},
248+
visibility = ["//visibility:public"],
249+
)
250+
251+
config_setting(
252+
name = "with_s3_support_android_override",
253+
define_values = {"with_s3_support": "true"},
254+
values = {"crosstool_top": "//external:android/crosstool"},
255+
visibility = ["//visibility:public"],
256+
)
257+
258+
config_setting(
259+
name = "with_gcp_support_ios_override",
260+
define_values = {"with_gcp_support": "true"},
261+
values = {"crosstool_top": "//tools/osx/crosstool:crosstool"},
262+
visibility = ["//visibility:public"],
263+
)
264+
265+
config_setting(
266+
name = "with_hdfs_support_ios_override",
267+
define_values = {"with_hdfs_support": "true"},
268+
values = {"crosstool_top": "//tools/osx/crosstool:crosstool"},
269+
visibility = ["//visibility:public"],
270+
)
271+
272+
config_setting(
273+
name = "with_s3_support_ios_override",
274+
define_values = {"with_s3_support": "true"},
275+
values = {"crosstool_top": "//tools/osx/crosstool:crosstool"},
209276
visibility = ["//visibility:public"],
210277
)
211278

212279
config_setting(
213280
name = "with_xla_support",
214-
values = {"define": "with_xla_support=true"},
281+
define_values = {"with_xla_support": "true"},
215282
visibility = ["//visibility:public"],
216283
)
217284

218285
config_setting(
219286
name = "with_gdr_support",
220-
values = {"define": "with_gdr_support=true"},
287+
define_values = {"with_gdr_support": "true"},
221288
visibility = ["//visibility:public"],
222289
)
223290

224291
config_setting(
225292
name = "with_verbs_support",
226-
values = {"define": "with_verbs_support=true"},
293+
define_values = {"with_verbs_support": "true"},
227294
visibility = ["//visibility:public"],
228295
)
229296

@@ -297,7 +364,7 @@ config_setting(
297364
visibility = ["//visibility:public"],
298365
)
299366

300-
# Make a dummy rule that we can chaqnge "default" in select statements to.
367+
# Make a dummy rule that we can change "default" in select statements to.
301368
# to disable dependencies in copybara.
302369
config_setting(
303370
name = "dummy_disabled_internal",
@@ -353,6 +420,7 @@ filegroup(
353420
"//tensorflow/compiler/tf2xla:all_files",
354421
"//tensorflow/compiler/tf2xla/cc:all_files",
355422
"//tensorflow/compiler/tf2xla/kernels:all_files",
423+
"//tensorflow/compiler/tf2xla/lib:all_files",
356424
"//tensorflow/compiler/tf2xla/ops:all_files",
357425
"//tensorflow/compiler/xla:all_files",
358426
"//tensorflow/compiler/xla/client:all_files",
@@ -425,6 +493,25 @@ filegroup(
425493
"//tensorflow/contrib/learn/python/learn/datasets:all_files",
426494
"//tensorflow/contrib/linalg:all_files",
427495
"//tensorflow/contrib/linear_optimizer:all_files",
496+
"//tensorflow/contrib/lite:all_files",
497+
"//tensorflow/contrib/lite/java:all_files",
498+
"//tensorflow/contrib/lite/java/demo/app/src/main:all_files",
499+
"//tensorflow/contrib/lite/java/demo/app/src/main/assets:all_files",
500+
"//tensorflow/contrib/lite/java/src/main/native:all_files",
501+
"//tensorflow/contrib/lite/java/src/testhelper/java/org/tensorflow/lite:all_files",
502+
"//tensorflow/contrib/lite/kernels:all_files",
503+
"//tensorflow/contrib/lite/kernels/internal:all_files",
504+
"//tensorflow/contrib/lite/models/smartreply:all_files",
505+
"//tensorflow/contrib/lite/nnapi:all_files",
506+
"//tensorflow/contrib/lite/python:all_files",
507+
"//tensorflow/contrib/lite/schema:all_files",
508+
"//tensorflow/contrib/lite/testing:all_files",
509+
"//tensorflow/contrib/lite/toco:all_files",
510+
"//tensorflow/contrib/lite/toco/graph_transformations/tests:all_files",
511+
"//tensorflow/contrib/lite/toco/python:all_files",
512+
"//tensorflow/contrib/lite/toco/tensorflow_graph_matching:all_files",
513+
"//tensorflow/contrib/lite/toco/tflite:all_files",
514+
"//tensorflow/contrib/lite/tools:all_files",
428515
"//tensorflow/contrib/lookup:all_files",
429516
"//tensorflow/contrib/losses:all_files",
430517
"//tensorflow/contrib/makefile:all_files",

tensorflow/c/c_api.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,8 +890,8 @@ const tensorflow::AttrValue* GetAttrValue(TF_Operation* oper,
890890
TF_Status* status) {
891891
const tensorflow::AttrValue* attr = oper->node.attrs().Find(attr_name);
892892
if (attr == nullptr) {
893-
status->status =
894-
InvalidArgument("Operation has no attr named '", attr_name, "'.");
893+
status->status = InvalidArgument("Operation '", oper->node.name(),
894+
"' has no attr named '", attr_name, "'.");
895895
}
896896
return attr;
897897
}

tensorflow/c/c_api_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ TEST(CAPI, Graph) {
383383
EXPECT_EQ(TF_INVALID_ARGUMENT, TF_GetCode(s));
384384

385385
ASSERT_FALSE(GetAttrValue(feed, "missing", &attr_value, s));
386-
EXPECT_EQ(string("Operation has no attr named 'missing'."),
386+
EXPECT_EQ(string("Operation 'feed' has no attr named 'missing'."),
387387
string(TF_Message(s)));
388388

389389
// Make a constant oper with the scalar "3".
@@ -1054,7 +1054,7 @@ class CApiColocationTest : public ::testing::Test {
10541054
TF_OperationGetAttrMetadata(op, tensorflow::kColocationAttrName, s_);
10551055
if (expected.empty()) {
10561056
ASSERT_EQ(TF_INVALID_ARGUMENT, TF_GetCode(s_)) << TF_Message(s_);
1057-
EXPECT_EQ(std::string("Operation has no attr named '_class'."),
1057+
EXPECT_EQ(std::string("Operation 'add' has no attr named '_class'."),
10581058
std::string(TF_Message(s_)));
10591059
return;
10601060
}

tensorflow/c/eager/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ tf_cuda_library(
3939
tf_cuda_library(
4040
name = "c_api_internal",
4141
hdrs = ["c_api_internal.h"],
42+
visibility = ["//tensorflow:internal"],
4243
deps = [
4344
":c_api",
4445
":runtime",
@@ -105,7 +106,6 @@ tf_cc_test(
105106

106107
cc_library(
107108
name = "tape",
108-
srcs = ["tape.cc"],
109109
hdrs = ["tape.h"],
110110
visibility = ["//tensorflow:internal"],
111111
deps = [

tensorflow/c/eager/tape.cc

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)