Commit Graph

90124 Commits

Author SHA1 Message Date
Tomer Kaftan
4d97a127c6 Fix the exporting of tf.io.decode_proto and tf.io.encode_proto so that they correctly trigger dispatching. Note: Although this changes the api_def pbtxt files to change how exporting happens, the actual exported apis should not changed.
PiperOrigin-RevId: 320641446
Change-Id: I70760649794f08fffb629e25244802f73cf8b256
2020-07-10 11:43:54 -07:00
TensorFlower Gardener
c14d4f0e21 Merge pull request #40921 from rahul-kamat:generic-tensor
PiperOrigin-RevId: 320640683
Change-Id: Iaf606eb19770c2495cd7da4196566f986d584b67
2020-07-10 11:38:17 -07:00
TensorFlower Gardener
8334ef903a Merge pull request #41217 from ROCmSoftwarePlatform:google_upstream_rocm_platform_misc_200708
PiperOrigin-RevId: 320639190
Change-Id: Icbeca0caa8f7601eaf6ae07385f9d07bd597d72d
2020-07-10 11:34:53 -07:00
Gunhan Gulsoy
c7874e1f1e Internal refactoring of BUILD files.
PiperOrigin-RevId: 320635155
Change-Id: I0c254059f2e04c69774680c4fc28bb690bf7d0f9
2020-07-10 11:31:19 -07:00
TensorFlower Gardener
25153af91d Merge pull request #41235 from vnvo2409:gcs-ram-test
PiperOrigin-RevId: 320634923
Change-Id: I3991f0a8567006f9312049c805537258bdb8b478
2020-07-10 11:27:14 -07:00
Nick Kreeger
805a0c6b86 Introduce TFLiteEvalTensor and introduce TFLM-only tensor getters to TfLiteContext.
TFLM wants to reduce RAM usage for model allocation. This is the first phase to reduce this overhead. Instead of directly allocating TfLiteTensor items onto TfLiteContext, TF Micro will return instances through function pointers on TfLiteContext. The new TfLiteEvalTensor will be used in TFLM kernel implementations to reduce the memory overhead during TfLiteRegistration::Eval() calls.

NOTE: TfLiteEvalTensor can be moved into TFLM-only build rules when internal builds use TF_LITE_STATIC_MEMORY by default (b/160955687). Additionally, TfLiteContext contains many fields not used by TFLM and should be forked to reduce memory overhead as well.
PiperOrigin-RevId: 320634141
Change-Id: I26d49dfd5fa8f96bea8e098202d191d7ae6f1957
2020-07-10 11:21:55 -07:00
Gabriel Rasskin
623430da2d
Change BUILD order 2020-07-10 11:20:03 -07:00
Eugene Kuznetsov
05d855a50c PR #39429: [ROCm] Fixing and enabling TopK
Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/39429

This PR fixes and enables the TopK op and its tests for ROCm.
Copybara import of the project:

--
7ef56e66a29608b16d3b5cbd7cfad114ede3b3c1 by Eugene Kuznetsov <eugene.kuznetsov@amd.com>:

Fixing and enabling TopK on ROCm

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tensorflow/pull/39429 from ekuznetsov139:google-upstream-topk 7ef56e66a29608b16d3b5cbd7cfad114ede3b3c1
PiperOrigin-RevId: 320631998
Change-Id: If5291d7ff5ff0e98f953645e0adf085bf891cee8
2020-07-10 11:15:34 -07:00
Scott Zhu
c77d7647f0 Fix the test order dependency issue for gradient_checkpointing.
The root cause is probably related to keras global graph and some potential memory leak. Adding a teardown method to force clean any keras model created in the test, with a force GC.

Also cleanup some assertion methods which make the test code more readable.

PiperOrigin-RevId: 320630906
Change-Id: Ib72a39c184613e431d6eab03b18f3b217cb8e506
2020-07-10 11:09:10 -07:00
Gaurav Jain
796f522c80 Rollback: Ignore other graph inputs in custom gradient
PiperOrigin-RevId: 320628759
Change-Id: Ib044d97411888643937ab620d95b0a0592fad633
2020-07-10 11:04:10 -07:00
Russell Power
497aa18f8d Fix data race during platform registration.
PiperOrigin-RevId: 320628150
Change-Id: Icac487dccda340787531b0f741f49564f8819c8c
2020-07-10 10:58:13 -07:00
Feng Liu
ed0faac790 Expose mlir verify method in the mlir python binding
PiperOrigin-RevId: 320627284
Change-Id: Ifb2a01aafe59b9645ef9f69df3d6199019479f9e
2020-07-10 10:50:34 -07:00
TensorFlower Gardener
a45b6fb49a Merge pull request #40966 from fsx950223:losses
PiperOrigin-RevId: 320626960
Change-Id: I44bbaa281b251cded6b34df287316c48238cede0
2020-07-10 10:43:46 -07:00
Henry Tan
9443a1bb5e Reorganize tpu_compile_c_api into tpu_util_c_api.
PiperOrigin-RevId: 320626315
Change-Id: I4c0ba46d0ecbf9dee684fb5232e1457f5b82cfa1
2020-07-10 10:38:15 -07:00
TensorFlower Gardener
7e279d6b0f Merge pull request #40619 from jpodivin:docfix37293
PiperOrigin-RevId: 320625911
Change-Id: I02ad15e3b1c1ac97918db4b059939f8cc416da00
2020-07-10 10:29:48 -07:00
TensorFlower Gardener
b5a50ac950 Merge pull request #41273 from lgeiger:fix-python35-test
PiperOrigin-RevId: 320624065
Change-Id: I4a95af39549380a4c7ff6cb861a197f44c9e34a5
2020-07-10 10:16:03 -07:00
TensorFlower Gardener
0e8ef971e4 Merge pull request #40925 from polymage-labs:lhlo_to_linalg_affine_store
PiperOrigin-RevId: 320623152
Change-Id: I953dbee8ef91c717260557eac04f65bc528e4214
2020-07-10 10:12:40 -07:00
Edward Loper
3a3ad1881a Update RaggedTensor.__eq__ and RaggedTensor.__ne__ to compare by value (with broadcasting), rather than by identity. (This matches a change that was made for tf.Tensor going from TF1 to TF2, where Tensor.__eq__ compares by value rather than identity.
PiperOrigin-RevId: 320623026
Change-Id: I752d4d5f53d152862454184c3f2ff9fba69767e7
2020-07-10 10:08:11 -07:00
A. Unique TensorFlower
0603381431 Avoid linear search in HloComputation::IsMarkedAsDead.
PiperOrigin-RevId: 320620890
Change-Id: I762bd45ba4eb7df7177353bdb5963fd933745f04
2020-07-10 09:58:38 -07:00
Cesar Crusius
aad8c6685f New experimental saved model flags.
PiperOrigin-RevId: 320617512
Change-Id: I11e6628e7d1355e932ed8db0e35334e3d2d76605
2020-07-10 09:35:39 -07:00
A. Unique TensorFlower
af8a7e59f4 Add __getstate__ and __setstate__ to name_scope_v2 s.t. it can be pickled now that it has __slots__.
PiperOrigin-RevId: 320611586
Change-Id: I690b96b08dd08f85011623a4ca649b56dfec411f
2020-07-10 09:06:33 -07:00
A. Unique TensorFlower
585d841061 Fix missing backtick in tf.where documentation.
PiperOrigin-RevId: 320608336
Change-Id: I2881641c28e853bc77a1f6b72649a527afb002bd
2020-07-10 08:38:57 -07:00
Andy Ly
65d5194d72 Rollback #41144 as #40554 was rolled back only, resulting in keras_cpu_benchmark_test test failing due to a missing dependency.
PiperOrigin-RevId: 320602051
Change-Id: Idd7b0e15e2c22c6f7f3013e74c96aae4a31bb4e3
2020-07-10 07:56:34 -07:00
Andy Ly
60fb9ca5ed Fix ResourceOpLiftingPass to handle call ops that return tf.ReadVariableOp results.
It is possible for a tf.StatefulPartitionedCall to return the result of a tf.ReadVariableOp (with some potential forwarding through ops like tf.Identity). As return op operands are captured prior to replacing tf.ReadVariableOp results with function args, the new function return operands may not be correct. Instead, when replacing tf.ReadVariableOp results with function args, the operands of the new return are updated.

PiperOrigin-RevId: 320597502
Change-Id: I81f614e0b89670c978da376d5810ff82502f601f
2020-07-10 07:15:22 -07:00
A. Unique TensorFlower
9065899e92 LocalResponseNormalization: We're spending about half of the time in this function converting to and from double. Do the computation in the float domain, I don't think there is any risk of numerical instability here.
PiperOrigin-RevId: 320588654
Change-Id: Ia641f6359b5966aa669de037d355292a25c08bed
2020-07-10 05:53:07 -07:00
jpodivin
e820edf7ae TF2.x API Docs module.py example fix.
Doctest for module.py implemented. Also fixed doctest for Dense class in the same file.

Doctest for Dense class in the same file now runs properly and names of vars are consistent.

Doctest should work now, but I did have some trouble testing it, although I do have reqs installed.
2020-07-10 14:24:57 +02:00
Chao Mei
633c41f3ea Fix the output bug that the specified value by --num_images isn't honored. The bug is that the annotated images could only be a subset of the overall images, and we miss to delete those no-annotated images when iterating over the annotated images.
PiperOrigin-RevId: 320579234
Change-Id: I69a0f4f1d33c38245c6db88e02fac6d6836209f8
2020-07-10 04:12:51 -07:00
Stephan Herhut
c12d8cddf1 Integrate LLVM at https://github.com/llvm/llvm-project/commit/c2a61ef38850
PiperOrigin-RevId: 320576081
Change-Id: I1e84671df57c968db738cea59052f833f288a8aa
2020-07-10 03:36:00 -07:00
Chao Mei
9ccaf9b39a Support more delegate options in kernel tests by utilizing TFLite tooling's delegate registrar.
PiperOrigin-RevId: 320574793
Change-Id: If2168d94cd4a9bf17d3245b80dd4db319f62aa61
2020-07-10 03:21:15 -07:00
Lukas Geiger
c36bc9b072 Fix FileIO test for Python < 3.6 2020-07-10 12:08:34 +02:00
Alexander Belyaev
60b972f627 [MLIR][LHLO] Lower ReshapeMemRefCastOp to LLVM.
PiperOrigin-RevId: 320572751
Change-Id: I98a2905f69c5203364c2c0208d19876bab7e152e
2020-07-10 02:58:45 -07:00
A. Unique TensorFlower
0f5c86fce7 compat: Update forward compatibility horizon to 2020-07-10
PiperOrigin-RevId: 320567273
Change-Id: I79731c756146613522d1987c9e28f937a70e1b4f
2020-07-10 02:11:18 -07:00
A. Unique TensorFlower
d1b956abf2 Update GraphDef version to 458.
PiperOrigin-RevId: 320567268
Change-Id: I7c908167cb02c922bfb670160da2af0f4039c2aa
2020-07-10 02:06:28 -07:00
Wenhao Jia
992b6e2990 Add C API for TPU execution.
PiperOrigin-RevId: 320552409
Change-Id: I5479a07a5ee4b29f57aae71e960264f9ac19980f
2020-07-09 23:28:15 -07:00
Mihai Maruseac
b867dec4e1 Support more delegate options in kernel tests by utilizing TFLite tooling's delegate registrar.
PiperOrigin-RevId: 320548671
Change-Id: I459f4992fa30bd9ab05736553b23ca6f4c35f847
2020-07-09 22:48:39 -07:00
Chao Mei
f1c2b67ff7 To avoid confusion, remove lite/tools/accuracy as it's been replaced by lite/tools/evaluation/tasks/imagenet_image_classification.
PiperOrigin-RevId: 320541992
Change-Id: I8cf76f0151dde569852ded1389c3e98ed394e74f
2020-07-09 21:54:57 -07:00
Haoyu Zhang
62f54dd240 Skip graph optimization passes for component functions.
Before this change, the registered graph optimization passes are executed on both the main function side and the component function side when running distributed functions. This is not efficient, and can cause graph compilation problems. This change annotate component functions execution so that the graph passes will be skipped when instantiating them, avoiding the repeated graph passes that are already executed on the main function side.

PiperOrigin-RevId: 320540983
Change-Id: I4816240bcd5b54c738114c36f17ecc1b0b6c920d
2020-07-09 21:41:11 -07:00
RJ Skerry-Ryan
9e54b4b299 Remove the usage of TF private API ops.convert_n_to_tensor from Keras
PiperOrigin-RevId: 320539772
Change-Id: I99b903ee44e8b11d52c83dc44290a48bbe2df6d2
2020-07-09 21:28:10 -07:00
David Majnemer
766a356f27 [tf2xla] Align sign with TensorFlow
tf.sign(NaN) should be NaN via XLA to match TensorFlow's normal behavior.

PiperOrigin-RevId: 320539210
Change-Id: I1cfa4175f88cb1083b2a20222785a372801dacc8
2020-07-09 21:22:00 -07:00
Mehdi Amini
8614ed54cd Use relative path for TableGen include with MLIR HLO
Fix TensorFlow build when used as an external project.

PiperOrigin-RevId: 320533756
Change-Id: I647cf538221ebd2d1ed6239786f92cf301d40b43
2020-07-09 20:26:11 -07:00
Mihai Maruseac
3bc2b31a2d Rollback of PRs #40554 and #41144 as they break nightly builds
PiperOrigin-RevId: 320531817
Change-Id: I2ba58825a8ae56905d4a5339289cbafd4a33d72a
2020-07-09 20:07:12 -07:00
Chao Mei
eddb295677 Support more delegate options in kernel tests by utilizing TFLite tooling's delegate registrar.
PiperOrigin-RevId: 320527595
Change-Id: I9caa7b4cf0a961c4aef90fd73840069b8ed1a32e
2020-07-09 19:24:17 -07:00
Mihai Maruseac
6c292dc103 Disable test that fails due to gRPC port collisions.
PiperOrigin-RevId: 320527546
Change-Id: I0eb53ed0a42685c299e319fe0bf04821eeb6417f
2020-07-09 19:20:36 -07:00
Yanhui Liang
deb994ea78 Make layer overhead benchmarks as parameterized benchmark tests.
PiperOrigin-RevId: 320524303
Change-Id: I50b620c34b627704b80cf92c7f823e582c0944ae
2020-07-09 18:57:09 -07:00
Pavithra Vijay
d13f4ec326 Remove run_v1_only annotation from proximal_adagrad_test, saved_model_experimental_test, legacy base layer test
PiperOrigin-RevId: 320522977
Change-Id: I671006714ffb961be0ddbd33fe8f58f28571cfb0
2020-07-09 18:46:33 -07:00
Mihai Maruseac
2015320832 Disable 2 grappler tests under MSAN
PiperOrigin-RevId: 320515609
Change-Id: I44e755fb41edfb4fd3acfa01909ef7254c4b80ca
2020-07-09 18:27:56 -07:00
Peng Wang
d0c63bb151 [TF-numpy] Adds a switch to control whether to inline the original numpy docstrings or to just add links.
PiperOrigin-RevId: 320514706
Change-Id: Ibc12d6b4fb84fbfcd27076de244363b63d3f86c1
2020-07-09 18:20:50 -07:00
Frank Chen
902443f6bb Introduce tpu_node_device to represent the individual TPU cores
PiperOrigin-RevId: 320514215
Change-Id: Ie479c73a5dccac02a773d33a277b6f927462207f
2020-07-09 18:15:58 -07:00
Saurabh Saxena
fdce31d861 Move ImmediateExecutionTensorHandle::DataType() to AbstractTensorHandle.
Minor signature change of AddInputList.
Implement AddInputList for GraphContext. This is needed for downstream
implementation of gradients.

PiperOrigin-RevId: 320513498
Change-Id: I16ee672c6d6f1f9b260b319c954158694c82a1db
2020-07-09 18:10:55 -07:00
Michael Gester
78199b484c Add checks for equal operand and result (element) types for TF dialect ops
Many TF ops require that all operands and results have the same (element) type
but previously this was often not checked, leading to failures later in the flow
that are harder to debug. This change adds several such checks.

PiperOrigin-RevId: 320511211
Change-Id: Iaba7d7449085d4fc7a3e3c18b0dd26c185b7282c
2020-07-09 17:54:29 -07:00