Skip to content

Commit 6a0427d

Browse files
authored
Merge pull request #2 from tensorflow/master
follow tf branch
2 parents d4e50e0 + 8b330d2 commit 6a0427d

File tree

779 files changed

+33675
-7277
lines changed

Some content is hidden

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

779 files changed

+33675
-7277
lines changed

WORKSPACE

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,34 +49,34 @@ remote_config_workspace()
4949
# Apple and Swift rules.
5050
http_archive(
5151
name = "build_bazel_rules_apple",
52-
sha256 = "6efdde60c91724a2be7f89b0c0a64f01138a45e63ba5add2dca2645d981d23a1",
53-
urls = ["https://github.com/bazelbuild/rules_apple/releases/download/0.17.2/rules_apple.0.17.2.tar.gz"],
52+
sha256 = "a045a436b642c70fb0c10ca84ff0fd2dcbd59cc89100d597a61e8374afafb366",
53+
urls = ["https://github.com/bazelbuild/rules_apple/releases/download/0.18.0/rules_apple.0.18.0.tar.gz"],
5454
) # https://github.com/bazelbuild/rules_apple/releases
5555
http_archive(
5656
name = "build_bazel_rules_swift",
57-
sha256 = "96a86afcbdab215f8363e65a10cf023b752e90b23abf02272c4fc668fcb70311",
58-
urls = ["https://github.com/bazelbuild/rules_swift/releases/download/0.11.1/rules_swift.0.11.1.tar.gz"],
57+
sha256 = "18cd4df4e410b0439a4935f9ca035bd979993d42372ba79e7f2d4fafe9596ef0",
58+
urls = ["https://github.com/bazelbuild/rules_swift/releases/download/0.12.1/rules_swift.0.12.1.tar.gz"],
5959
) # https://github.com/bazelbuild/rules_swift/releases
6060
http_archive(
6161
name = "build_bazel_apple_support",
62-
sha256 = "7356dbd44dea71570a929d1d4731e870622151a5f27164d966dda97305f33471",
63-
urls = ["https://github.com/bazelbuild/apple_support/releases/download/0.6.0/apple_support.0.6.0.tar.gz"],
62+
sha256 = "122ebf7fe7d1c8e938af6aeaee0efe788a3a2449ece5a8d6a428cb18d6f88033",
63+
urls = ["https://github.com/bazelbuild/apple_support/releases/download/0.7.1/apple_support.0.7.1.tar.gz"],
6464
) # https://github.com/bazelbuild/apple_support/releases
6565
http_archive(
6666
name = "bazel_skylib",
67-
sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
68-
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz"],
67+
sha256 = "1dde365491125a3db70731e25658dfdd3bc5dbdfd11b840b3e987ecf043c7ca0",
68+
urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/0.9.0/bazel-skylib.0.9.0.tar.gz"],
6969
) # https://github.com/bazelbuild/bazel-skylib/releases
7070
http_archive(
7171
name = "com_github_apple_swift_swift_protobuf",
7272
type = "zip",
73-
strip_prefix = "swift-protobuf-1.5.0/",
74-
urls = ["https://github.com/apple/swift-protobuf/archive/1.5.0.zip"],
73+
strip_prefix = "swift-protobuf-1.6.0/",
74+
urls = ["https://github.com/apple/swift-protobuf/archive/1.6.0.zip"],
7575
) # https://github.com/apple/swift-protobuf/releases
7676
http_file(
7777
name = "xctestrunner",
7878
executable = 1,
79-
urls = ["https://github.com/google/xctestrunner/releases/download/0.2.7/ios_test_runner.par"],
79+
urls = ["https://github.com/google/xctestrunner/releases/download/0.2.9/ios_test_runner.par"],
8080
) # https://github.com/google/xctestrunner/releases
8181
# Use `swift_rules_dependencies` to fetch the toolchains. With the
8282
# `git_repository` rules above, the following call will skip redefining them.

arm_compiler.BUILD

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,56 @@ package(default_visibility = ["//visibility:public"])
33
filegroup(
44
name = "gcc",
55
srcs = [
6-
"bin/arm-linux-gnueabihf-gcc",
6+
"bin/arm-rpi-linux-gnueabihf-gcc",
77
],
88
)
99

1010
filegroup(
1111
name = "ar",
1212
srcs = [
13-
"bin/arm-linux-gnueabihf-ar",
13+
"bin/arm-rpi-linux-gnueabihf-ar",
1414
],
1515
)
1616

1717
filegroup(
1818
name = "ld",
1919
srcs = [
20-
"bin/arm-linux-gnueabihf-ld",
20+
"bin/arm-rpi-linux-gnueabihf-ld",
2121
],
2222
)
2323

2424
filegroup(
2525
name = "nm",
2626
srcs = [
27-
"bin/arm-linux-gnueabihf-nm",
27+
"bin/arm-rpi-linux-gnueabihf-nm",
2828
],
2929
)
3030

3131
filegroup(
3232
name = "objcopy",
3333
srcs = [
34-
"bin/arm-linux-gnueabihf-objcopy",
34+
"bin/arm-rpi-linux-gnueabihf-objcopy",
3535
],
3636
)
3737

3838
filegroup(
3939
name = "objdump",
4040
srcs = [
41-
"bin/arm-linux-gnueabihf-objdump",
41+
"bin/arm-rpi-linux-gnueabihf-objdump",
4242
],
4343
)
4444

4545
filegroup(
4646
name = "strip",
4747
srcs = [
48-
"bin/arm-linux-gnueabihf-strip",
48+
"bin/arm-rpi-linux-gnueabihf-strip",
4949
],
5050
)
5151

5252
filegroup(
5353
name = "as",
5454
srcs = [
55-
"bin/arm-linux-gnueabihf-as",
55+
"bin/arm-rpi-linux-gnueabihf-as",
5656
],
5757
)
5858

tensorflow/api_template.__init__.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -125,25 +125,6 @@ def _running_from_pip_package():
125125
if _fi.file_exists(plugin_dir):
126126
_ll.load_library(plugin_dir)
127127

128-
# These symbols appear because we import the python package which
129-
# in turn imports from tensorflow.core and tensorflow.python. They
130-
# must come from this module. So python adds these symbols for the
131-
# resolution to succeed.
132-
# pylint: disable=undefined-variable
133-
try:
134-
del python
135-
except NameError:
136-
pass
137-
try:
138-
del core
139-
except NameError:
140-
pass
141-
try:
142-
del compiler
143-
except NameError:
144-
pass
145-
# pylint: enable=undefined-variable
146-
147128
# Add module aliases
148129
if hasattr(_current_module, 'keras'):
149130
losses = keras.losses

tensorflow/api_template_v1.__init__.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -138,22 +138,3 @@ def _running_from_pip_package():
138138
if _fi.file_exists(plugin_dir):
139139
_ll.load_library(plugin_dir)
140140

141-
# These symbols appear because we import the python package which
142-
# in turn imports from tensorflow.core and tensorflow.python. They
143-
# must come from this module. So python adds these symbols for the
144-
# resolution to succeed.
145-
# pylint: disable=undefined-variable
146-
try:
147-
del python
148-
except NameError:
149-
pass
150-
try:
151-
del core
152-
except NameError:
153-
pass
154-
try:
155-
del compiler
156-
except NameError:
157-
pass
158-
159-
# pylint: enable=undefined-variable

tensorflow/c/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ tf_cuda_library(
270270
"//tensorflow/core/platform",
271271
"@com_google_absl//absl/strings",
272272
],
273+
alwayslink = 1,
273274
)
274275

275276
exports_files(

tensorflow/c/eager/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ tf_cuda_library(
8080
"//tensorflow/core/profiler/lib:profiler_session",
8181
"//tensorflow/core:gpu_runtime",
8282
],
83+
alwayslink = 1,
8384
)
8485

8586
tf_cuda_library(
@@ -227,6 +228,7 @@ tf_cuda_library(
227228
"//tensorflow/core/profiler/rpc/client:capture_profile",
228229
"//tensorflow/core:gpu_runtime",
229230
],
231+
alwayslink = 1,
230232
)
231233

232234
tf_cuda_cc_test(

tensorflow/c/eager/c_api_experimental_test.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ void ExecuteWithProfiling(bool async) {
8484
string profile_proto_str = profile_proto.DebugString();
8585
if (!gpu_device_name.empty()) {
8686
EXPECT_TRUE(HasSubstr(profile_proto_str, "/device:GPU:0"));
87-
// device name with "stream:all" is collected by Device Tracer.
88-
#ifndef TENSORFLOW_USE_ROCM
89-
// ROCm platform does not yet support stream level tracing
90-
EXPECT_TRUE(HasSubstr(profile_proto_str, "stream:all"));
91-
#endif
9287
}
9388
// "/host:CPU" is collected by TraceMe
9489
EXPECT_TRUE(HasSubstr(profile_proto_str, "/host:CPU"));

tensorflow/c/eager/tape.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,11 @@ ForwardAccumulator<Gradient, BackwardFunction, TapeTensor>::ForwardpropFromTape(
922922
for (const TapeTensor& output_tensor : output_tensors) {
923923
// Ownership of `aid` transferred to CallBackwardFunction below.
924924
Gradient* aid = vspace_.Ones(output_tensor);
925+
if (TF_PREDICT_FALSE(aid == nullptr)) {
926+
return tensorflow::errors::Internal(
927+
"Failed to create ones tensor for tensor ", output_tensor.GetID(),
928+
" with dtype ", output_tensor.GetDType());
929+
}
925930
forwardprop_aids.push_back(aid);
926931
int64 aid_id = vspace_.TensorId(aid);
927932
sources.push_back(aid_id);

tensorflow/cc/saved_model/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ cc_library(
123123
"//tensorflow/core/util/tensor_bundle:naming",
124124
# mobile not supported yet
125125
]),
126+
alwayslink = 1,
126127
)
127128

128129
tf_cc_test(

tensorflow/compiler/jit/compilability_check_util.cc

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,24 @@ RecursiveCompilabilityChecker::FindUncompilableNodes(
130130
return uncompilable_nodes;
131131
}
132132

133-
bool RecursiveCompilabilityChecker::HasXLAKernel(const Node& node) const {
133+
bool RecursiveCompilabilityChecker::HasXLAKernel(
134+
const Node& node, string* uncompilable_reason) const {
134135
// There is a SymbolicGradient kernel on the XLA_JIT device, but the gradient
135136
// is really a kind of function call and will be handled by
136137
// IsCompilableCall().
137-
if (node.type_string() == "SymbolicGradient") return false;
138+
if (node.type_string() == "SymbolicGradient") {
139+
*uncompilable_reason =
140+
"SymbolicGradient should be handled by IsCompilableCall().";
141+
return false;
142+
}
138143
if (node.type_string() == "Const") {
139144
// Skip Const op with type DT_STRING, since XLA doesn't support it, but the
140145
// registered Const KernelDef says that it does, to support no-op Assert for
141146
// tfcompile.
142147
const AttrValue* attr = node.attrs().Find("dtype");
143148
if (attr != nullptr && attr->type() == DT_STRING) {
149+
*uncompilable_reason =
150+
"Const op with type DT_STRING is not supported by XLA.";
144151
return false;
145152
}
146153
}
@@ -150,10 +157,16 @@ bool RecursiveCompilabilityChecker::HasXLAKernel(const Node& node) const {
150157
// such nodes out of XLA clusters.
151158
if (HasForwardedRefInput(node)) {
152159
VLOG(2) << "Rejecting " << node.name() << ": Identity with unsafe cast.";
160+
*uncompilable_reason = "Identity with unsafe cast.";
153161
return false;
154162
}
155163

156-
return FindKernelDef(jit_device_type_, node.def(), nullptr, nullptr).ok();
164+
Status s = FindKernelDef(jit_device_type_, node.def(), nullptr, nullptr);
165+
if (!s.ok()) {
166+
*uncompilable_reason = s.error_message();
167+
return false;
168+
}
169+
return true;
157170
}
158171

159172
// Tests whether 'if_node' is compilable. Every operator in the then_branch and
@@ -336,16 +349,17 @@ bool RecursiveCompilabilityChecker::IsCompilableNode(
336349
return false;
337350
}
338351

352+
string uncompilable_reason;
339353
if (IsFunctionCall(*lib_runtime->GetFunctionLibraryDefinition(), node)) {
340354
if (!IsCompilableCall(node.def(), lib_runtime, stack_trace,
341355
encapsulating_function, uncompilable_nodes)) {
342356
LogNotCompilable(node, "unsupported function");
343357
return false;
344358
}
345-
} else if (!HasXLAKernel(node)) {
346-
absl::string_view uncompilable_reason = "unsupported op";
347-
MaybeMarkUncompilableNode(uncompilable_reason, *stack_trace,
348-
encapsulating_function, uncompilable_nodes);
359+
} else if (!HasXLAKernel(node, &uncompilable_reason)) {
360+
MaybeMarkUncompilableNode(
361+
absl::StrCat("unsupported op: ", uncompilable_reason), *stack_trace,
362+
encapsulating_function, uncompilable_nodes);
349363
LogNotCompilable(node, uncompilable_reason);
350364
return false;
351365
}

0 commit comments

Comments
 (0)