Skip to content

Commit 64edd34

Browse files
authored
Merge pull request tensorflow#6461 from jhseu/branch_142778020
Branch 142778020
2 parents b542970 + 3b5862f commit 64edd34

File tree

264 files changed

+17878
-7660
lines changed

Some content is hidden

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

264 files changed

+17878
-7660
lines changed

RELEASE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
* tf.image.decode_jpeg by default uses the faster DCT method, sacrificing
5858
a little fidelity for improved speed. One can revert to the old
5959
behavior by specifying the attribute dct_method='INTEGER_ACCURATE'.
60+
* `tf.complex_abs` has been removed from the Python interface. `tf.abs`
61+
supports complex tensors and should be used instead.
6062

6163
# Release 0.12.0
6264

libxsmm.BUILD

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ exports_files(["LICENSE"])
77

88
# Arguments to ./scripts/libxsmm_interface.py, see that file for detailed description.
99
# precision: SP & DP
10-
# ilp64: no
1110
# prefetch: 1 (auto)
12-
libxsmm_interface_arguments = "0 0 1"
11+
libxsmm_interface_arguments = "0 1"
1312

1413
# Arguments to ./scripts/libxsmm_config.py, see that file for detailed description.
1514
# ilp64: no
15+
# big: no
1616
# offload: no
1717
# alignment [b]
1818
# prefetch: 1 (auto)
@@ -22,7 +22,11 @@ libxsmm_interface_arguments = "0 0 1"
2222
# flags
2323
# alpha = 1
2424
# beta = 1
25-
libxsmm_config_arguments = "0 0 64 1 0 1 1 0 1 1"
25+
libxsmm_config_arguments = "0 0 0 64 1 0 1 1 0 1 1"
26+
27+
# Arguments to ./scripts/libxsmm_dispatch.py, see that file for detailed description.
28+
# (dummy argument)
29+
libxsmm_dispatch_arguments = "0"
2630

2731
genrule(
2832
name = "libxsmm_headers",
@@ -33,13 +37,20 @@ genrule(
3337
outs = [
3438
"include/libxsmm.h",
3539
"include/libxsmm_config.h",
40+
"include/libxsmm_dispatch.h",
3641
],
3742
cmd = "$(location :libxsmm_interface) $(location src/template/libxsmm.h) " + libxsmm_interface_arguments + " > $(location include/libxsmm.h);" +
38-
"$(location :libxsmm_config) $(location src/template/libxsmm_config.h) " + libxsmm_config_arguments + " > $(location include/libxsmm_config.h)",
43+
"$(location :libxsmm_config) $(location src/template/libxsmm_config.h) " + libxsmm_config_arguments + " > $(location include/libxsmm_config.h);" +
44+
"$(location :libxsmm_dispatch) " + libxsmm_dispatch_arguments + " > $(location include/libxsmm_dispatch.h)",
3945
tools = [
4046
":libxsmm_config",
47+
":libxsmm_dispatch",
4148
":libxsmm_interface",
4249
],
50+
visibility = [
51+
"//tensorflow/core/kernels:__pkg__",
52+
"//third_party/eigen3:__pkg__",
53+
],
4354
)
4455

4556
cc_library(
@@ -49,37 +60,40 @@ cc_library(
4960
"src/libxsmm_dump.c",
5061
"src/libxsmm_malloc.c",
5162
"src/libxsmm_gemm.c",
63+
"src/libxsmm_gemm_diff.c",
64+
"src/libxsmm_hash.c",
5265
"src/libxsmm_timer.c",
5366
"src/libxsmm_trace.c",
5467
"src/libxsmm_trans.c",
5568
"src/libxsmm_sync.c",
5669
"src/libxsmm_perf.c",
70+
"src/libxsmm_spmdm.c",
5771
"src/libxsmm_dnn.c",
72+
"src/libxsmm_dnn_handle.c",
5873
"src/libxsmm_dnn_convolution_forward.c",
74+
"src/libxsmm_dnn_convolution_backward.c",
75+
"src/libxsmm_dnn_convolution_weight_update.c",
5976
"src/libxsmm_cpuid_x86.c",
6077
] + glob([
6178
"src/generator_*.c",
6279
]),
6380
hdrs = [
81+
"include/libxsmm_cpuid.h",
6482
"include/libxsmm_dnn.h",
6583
"include/libxsmm_frontend.h",
6684
"include/libxsmm_generator.h",
85+
"include/libxsmm_intrinsics_x86.h",
6786
"include/libxsmm_macros.h",
6887
"include/libxsmm_malloc.h",
88+
"include/libxsmm_spmdm.h",
6989
"include/libxsmm_sync.h",
7090
"include/libxsmm_timer.h",
7191
"include/libxsmm_typedefs.h",
72-
"include/libxsmm_dispatch.h",
73-
"src/libxsmm_gemm_diff.c",
74-
"src/libxsmm_cpuid_x86.c",
75-
"src/libxsmm_hash.c",
7692
# Generated:
7793
"include/libxsmm.h",
7894
"include/libxsmm_config.h",
79-
] + glob([
80-
"src/*.h",
81-
"src/template/*.c",
82-
]),
95+
"include/libxsmm_dispatch.h",
96+
],
8397
copts = [
8498
"-mavx", # JIT does not work without avx anyway, and this silences some CRC32 warnings.
8599
"-Wno-vla", # Libxsmm convolutions heavily use VLA.
@@ -89,12 +103,13 @@ cc_library(
89103
"LIBXSMM_CPUID_X86_NOINLINE",
90104
"__BLAS=0",
91105
],
92-
includes = ["include"],
106+
includes = [
107+
"include",
108+
"src",
109+
"src/template",
110+
],
93111
linkopts = ["-ldl"],
94112
visibility = ["//visibility:public"],
95-
deps = [
96-
":libxsmm_headers",
97-
],
98113
)
99114

100115
py_library(
@@ -114,3 +129,9 @@ py_binary(
114129
srcs = ["scripts/libxsmm_config.py"],
115130
deps = [":libxsmm_scripts"],
116131
)
132+
133+
py_binary(
134+
name = "libxsmm_dispatch",
135+
srcs = ["scripts/libxsmm_dispatch.py"],
136+
deps = [":libxsmm_scripts"],
137+
)

tensorflow/cc/framework/scope.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ std::unordered_set<string> Scope::GetColocationConstraints(
186186
void Scope::UpdateStatus(const Status s) const {
187187
status_->Update(s);
188188
if (exit_on_error_ && !status_->ok()) {
189-
LOG(FATAL) << status_;
189+
LOG(FATAL) << *status_;
190190
}
191191
}
192192

tensorflow/contrib/android/jni/jni_utils.cc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ namespace {
3838
class IfstreamInputStream : public ::google::protobuf::io::CopyingInputStream {
3939
public:
4040
explicit IfstreamInputStream(const std::string& file_name)
41-
: ifs_(file_name.c_str(), std::ios::in | std::ios::binary) {}
41+
: ifs_(file_name.c_str(), std::ios::in | std::ios::binary) {
42+
CHECK(ifs_.good()) << "Failed to open file \"" << file_name
43+
<< "\" or file is 0 length! Use prefix \""
44+
<< ASSET_PREFIX
45+
<< "\" if attempting to load proto from assets.";
46+
}
4247
~IfstreamInputStream() { ifs_.close(); }
4348

4449
int Read(void* buffer, int size) {
@@ -59,6 +64,7 @@ bool PortableReadFileToProto(const std::string& file_name,
5964
::google::protobuf::MessageLite* proto) {
6065
::google::protobuf::io::CopyingInputStreamAdaptor stream(
6166
new IfstreamInputStream(file_name));
67+
6268
stream.SetOwnsCopyingStream(true);
6369
// TODO(jiayq): the following coded stream is for debugging purposes to allow
6470
// one to parse arbitrarily large messages for MessageLite. One most likely
@@ -119,6 +125,13 @@ void ReadFileToProtoOrDie(AAssetManager* const asset_manager,
119125
// it to memory first.
120126
VLOG(0) << "Opening asset " << asset_filename << " from disk with copy.";
121127
const off_t data_size = AAsset_getLength(asset);
128+
129+
// TODO(andrewharp): Add codepath for loading compressed protos as well.
130+
if (data_size > 64 * 1024 * 1024) {
131+
LOG(WARNING) << "Compressed proto is larger than 64mb; if problems occur "
132+
<< " turn off compression for protocol buffer files in APK.";
133+
}
134+
122135
const void* const memory = AAsset_getBuffer(asset);
123136
CHECK(message->ParseFromArray(memory, data_size));
124137
}

tensorflow/contrib/cmake/tf_tests.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ if (tensorflow_BUILD_PYTHON_TESTS)
162162
"${tensorflow_source_dir}/tensorflow/python/training/saver_large_variable_test.py" # Overflow error.
163163
"${tensorflow_source_dir}/tensorflow/python/training/supervisor_test.py" # Flaky I/O error on rename.
164164
"${tensorflow_source_dir}/tensorflow/python/training/sync_replicas_optimizer_test.py" # Needs portpicker.
165+
"${tensorflow_source_dir}/tensorflow/python/kernel_tests/array_ops_test.py" # depends on python/framework/test_ops
165166
)
166167
endif()
167168
list(REMOVE_ITEM tf_test_src_py ${tf_test_src_py_exclude})

0 commit comments

Comments
 (0)