platform/upstream/tensorflow.git
6 years agoOptimizations to DepthwiseConv
A. Unique TensorFlower [Thu, 10 May 2018 20:53:29 +0000 (13:53 -0700)]
Optimizations to DepthwiseConv

PiperOrigin-RevId: 196166118

6 years agoAdd missing FlatSet::insert(Key&&) overload.
Justin Lebar [Thu, 10 May 2018 20:28:33 +0000 (13:28 -0700)]
Add missing FlatSet::insert(Key&&) overload.

PiperOrigin-RevId: 196162544

6 years agoFix a bug about getting arguments of partial functions.
A. Unique TensorFlower [Thu, 10 May 2018 19:46:29 +0000 (12:46 -0700)]
Fix a bug about getting arguments of partial functions.

PiperOrigin-RevId: 196157095

6 years agoMake FlatSet and FlatMap movable.
Justin Lebar [Thu, 10 May 2018 19:38:27 +0000 (12:38 -0700)]
Make FlatSet and FlatMap movable.

PiperOrigin-RevId: 196156010

6 years agoBUGFIX: correctly propagate dtype in distributions.special_math.
Joshua V. Dillon [Thu, 10 May 2018 19:38:21 +0000 (12:38 -0700)]
BUGFIX: correctly propagate dtype in distributions.special_math.

PiperOrigin-RevId: 196155994

6 years agoDT_TEXTREL set by -Wl,-z,notext is incompatible with indirect functions (IFUNC).
A. Unique TensorFlower [Thu, 10 May 2018 19:37:29 +0000 (12:37 -0700)]
DT_TEXTREL set by -Wl,-z,notext is incompatible with indirect functions (IFUNC).
NVFlex.o in cuda_9_0/lib64/libculibos.a has buggy .eh_frame, which overlaps with .rela.rodata R_X86_64_PC32 relocations and makes it not able to be linked with LLD.

PiperOrigin-RevId: 196155873

6 years agoBreak out node loop from ConstantFolding::SimplifyGraph.
Rob Sloan [Thu, 10 May 2018 19:28:29 +0000 (12:28 -0700)]
Break out node loop from ConstantFolding::SimplifyGraph.

PiperOrigin-RevId: 196154571

6 years agoMake sure default GPU context is used within CollectiveRemoteAccessLocal::MemCpyAsync
A. Unique TensorFlower [Thu, 10 May 2018 19:16:29 +0000 (12:16 -0700)]
Make sure default GPU context is used within CollectiveRemoteAccessLocal::MemCpyAsync
when not explicitly set.

PiperOrigin-RevId: 196152927

6 years agoImplementation of the unidirectional_sequence_rnn TFLite Op using the symmetric quant...
A. Unique TensorFlower [Thu, 10 May 2018 19:14:52 +0000 (12:14 -0700)]
Implementation of the unidirectional_sequence_rnn TFLite Op using the symmetric quantization.

PiperOrigin-RevId: 196152754

6 years agoUse distribution_util.arguments instead of locals. This fixes a bug in newer python...
A. Unique TensorFlower [Thu, 10 May 2018 18:57:20 +0000 (11:57 -0700)]
Use distribution_util.arguments instead of locals. This fixes a bug in newer python version
where locals is a dynamic list.

PiperOrigin-RevId: 196150149

6 years agoAdds BaseLineEstimator, which accepts a user-specified head.
A. Unique TensorFlower [Thu, 10 May 2018 18:54:00 +0000 (11:54 -0700)]
Adds BaseLineEstimator, which accepts a user-specified head.

PiperOrigin-RevId: 196149694

6 years agoAdds metric_class_ids argument in multi_label_head.
A. Unique TensorFlower [Thu, 10 May 2018 18:49:31 +0000 (11:49 -0700)]
Adds metric_class_ids argument in multi_label_head.

PiperOrigin-RevId: 196149006

6 years agoExtracts PartialAssocOpConstFolding into a method.
A. Unique TensorFlower [Thu, 10 May 2018 18:35:22 +0000 (11:35 -0700)]
Extracts PartialAssocOpConstFolding into a method.

PiperOrigin-RevId: 196146716

6 years agoOptimizations for broadcast add operator.
A. Unique TensorFlower [Thu, 10 May 2018 18:30:50 +0000 (11:30 -0700)]
Optimizations for broadcast add operator.

PiperOrigin-RevId: 196145896

6 years agoImplementation of the basic_rnn TFLite Op using the symmetric quantization.
A. Unique TensorFlower [Thu, 10 May 2018 18:22:20 +0000 (11:22 -0700)]
Implementation of the basic_rnn TFLite Op using the symmetric quantization.

PiperOrigin-RevId: 196144379

6 years agoTraverse through control dependencies.
Suharsh Sivakumar [Thu, 10 May 2018 17:58:11 +0000 (10:58 -0700)]
Traverse through control dependencies.

PiperOrigin-RevId: 196139886

6 years agoFix inaccurate docstring of Orthogonal initializer.
Francois Chollet [Thu, 10 May 2018 17:51:23 +0000 (10:51 -0700)]
Fix inaccurate docstring of Orthogonal initializer.

PiperOrigin-RevId: 196138675

6 years agoUpdate documentation of ServingInputReceiver when a non-dict is passed as argument.
A. Unique TensorFlower [Thu, 10 May 2018 17:49:20 +0000 (10:49 -0700)]
Update documentation of ServingInputReceiver when a non-dict is passed as argument.

PiperOrigin-RevId: 196138375

6 years agoRemoving expected softmax test failure and improving logging.
A. Unique TensorFlower [Thu, 10 May 2018 17:26:06 +0000 (10:26 -0700)]
Removing expected softmax test failure and improving logging.

PiperOrigin-RevId: 196134704

6 years agoRegister XLA device kernel for IdentityN op.
A. Unique TensorFlower [Thu, 10 May 2018 17:21:02 +0000 (10:21 -0700)]
Register XLA device kernel for IdentityN op.

PiperOrigin-RevId: 196133882

6 years agoIncrease shard count yet more for tensorflow/contrib/metrics:metric_ops_test to avoid...
A. Unique TensorFlower [Thu, 10 May 2018 16:50:54 +0000 (09:50 -0700)]
Increase shard count yet more for tensorflow/contrib/metrics:metric_ops_test to avoid flaky timeouts

PiperOrigin-RevId: 196129385

6 years agoAdd citation for TF-Slim.
Sergio Guadarrama [Thu, 10 May 2018 16:49:50 +0000 (09:49 -0700)]
Add citation for TF-Slim.

PiperOrigin-RevId: 196129248

6 years agoFor Estimators, SavedModels for multiple modes should be exported into the same
Karmel Allison [Thu, 10 May 2018 16:47:37 +0000 (09:47 -0700)]
For Estimators, SavedModels for multiple modes should be exported into the same
file.

PiperOrigin-RevId: 196128943

6 years agoAutomated g4 rollback of changelist 195878952
Asim Shankar [Thu, 10 May 2018 16:38:11 +0000 (09:38 -0700)]
Automated g4 rollback of changelist 195878952

PiperOrigin-RevId: 196127751

6 years agoAdd EvaluateNodes to tests: AddOpsRewrite_AddOpsOfIdenticalShape, AddOpsRewrite_Multi...
A. Unique TensorFlower [Thu, 10 May 2018 16:20:55 +0000 (09:20 -0700)]
Add EvaluateNodes to tests: AddOpsRewrite_AddOpsOfIdenticalShape, AddOpsRewrite_MultiplePasses, AddOpsRewrite_AddInputMultipleTimes, AddOpsRewrite_AddOpsOfSymbolicallyEqualShape, AddOpsRewrite_MinimizeBCast, AddOpsRewrite_MinimizeBCastWithSymbolicShapes, RemoveNegation, MinimizeBroadcasts_SimpleSwap, MinimizeBroadcasts_FlattenTallGraph, MinimizeBroadcasts_BuildTreeUp

PiperOrigin-RevId: 196125583

6 years agoSupport differing dimensions for strided_slice
Zhixian Yan [Thu, 10 May 2018 11:38:15 +0000 (04:38 -0700)]
Support differing dimensions for strided_slice

PiperOrigin-RevId: 196101232

6 years ago[XLA] Add log1p/expm1
David Majnemer [Thu, 10 May 2018 06:21:19 +0000 (23:21 -0700)]
[XLA] Add log1p/expm1

A new HLO seems prudent as it allows implementations to use fancy techniques to
compute accurate results for small inputs.

PiperOrigin-RevId: 196078115

6 years agoIncrease size of test tensorflow/contrib/learn:graph_io_test to medium to avoid flaky...
A. Unique TensorFlower [Thu, 10 May 2018 03:32:13 +0000 (20:32 -0700)]
Increase size of test tensorflow/contrib/learn:graph_io_test to medium to avoid flaky timeouts

PiperOrigin-RevId: 196068593

6 years agoDon't call into Eigen unless the input and output tensors are aligned
Sanjoy Das [Thu, 10 May 2018 02:39:58 +0000 (19:39 -0700)]
Don't call into Eigen unless the input and output tensors are aligned

We teach TargetMachineFeatures about the alignment required for Eigen GEMM and
Conv and then pipe TargetMachineFeatures through the places that need to decide
whether a dot or a conv needs to be lowered to a call to Eigen.

I also had to fix a minor bug in our LLVM IR implementation for convolution.

PiperOrigin-RevId: 196065557

6 years agoPartial update of tf.keras to the Keras 2.1.6 API.
Pavithra Vijay [Thu, 10 May 2018 01:51:06 +0000 (18:51 -0700)]
Partial update of tf.keras to the Keras 2.1.6 API.

Changes included are:
- Update docs on preprocessing image and text.
- Allow shift_range to be 1-D array-like or int in ImageDataGenerator.
- Add a test for image preprocessing function for flow_from_directory.
- Fix for off by one error in TimeSeriesGenerator.
- Correct tokenization with multi-character `split` in text_to_word_sequence.

PiperOrigin-RevId: 196062625

6 years agoImplement sin operator
A. Unique TensorFlower [Thu, 10 May 2018 01:45:13 +0000 (18:45 -0700)]
Implement sin operator

PiperOrigin-RevId: 196062186

6 years agoIncrease shard count for //third_party/tensorflow/contrib/learn:kmeans_test to avoid...
A. Unique TensorFlower [Thu, 10 May 2018 01:35:50 +0000 (18:35 -0700)]
Increase shard count for //third_party/tensorflow/contrib/learn:kmeans_test to avoid flaky timeouts

PiperOrigin-RevId: 196061508

6 years agoIncrease size of test tensorflow/contrib/distributions:mvn_tril_test to medium to...
A. Unique TensorFlower [Thu, 10 May 2018 01:14:41 +0000 (18:14 -0700)]
Increase size of test tensorflow/contrib/distributions:mvn_tril_test to medium to avoid flaky timeouts

PiperOrigin-RevId: 196059863

6 years ago[TF:XLA] Speed up HLO CSE.
A. Unique TensorFlower [Thu, 10 May 2018 00:41:58 +0000 (17:41 -0700)]
[TF:XLA] Speed up HLO CSE.

Use a hash set to find equivalent instructions. This avoids worst-case n^2
instruction comparisons. Instead of checking all users of operand(0) for equivalent instructions, do a lookup in a hash set.

PiperOrigin-RevId: 196056689

6 years agoClarify error message.
Adam Roberts [Thu, 10 May 2018 00:38:41 +0000 (17:38 -0700)]
Clarify error message.

PiperOrigin-RevId: 196056372

6 years agoFix FreezeSavedModel to handle traversal of operations with multiple outputs.
Suharsh Sivakumar [Thu, 10 May 2018 00:30:30 +0000 (17:30 -0700)]
Fix FreezeSavedModel to handle traversal of operations with multiple outputs.

PiperOrigin-RevId: 196055377

6 years agoImprove error status message in scoped_allocator_ops.cc.
A. Unique TensorFlower [Wed, 9 May 2018 23:58:54 +0000 (16:58 -0700)]
Improve error status message in scoped_allocator_ops.cc.

PiperOrigin-RevId: 196051520

6 years ago[XLA] Make hlo deserialization stable for HloModule by sorting by ids when creating...
A. Unique TensorFlower [Wed, 9 May 2018 23:40:03 +0000 (16:40 -0700)]
[XLA] Make hlo deserialization stable for HloModule by sorting by ids when creating from proto.

Also, delete the HloModule parameter HloInstruction::CreateFromProto, it's not used anywhere.

Also, in ToProto, set sharding to proto if there is sharding.

PiperOrigin-RevId: 196049173

6 years agoIncrease shard count for tensorflow/contrib/distributions:vector_diffeomixture_test...
A. Unique TensorFlower [Wed, 9 May 2018 23:18:45 +0000 (16:18 -0700)]
Increase shard count for tensorflow/contrib/distributions:vector_diffeomixture_test to avoid flaky timeouts

PiperOrigin-RevId: 196046333

6 years agoAdd missing update of node map in the Mul(x,x) => Square(x) rewrite. This is what...
A. Unique TensorFlower [Wed, 9 May 2018 22:58:28 +0000 (15:58 -0700)]
Add missing update of node map in the Mul(x,x) => Square(x) rewrite. This is what caused a failure in //photos/vision/object_detection/ranking:brain_embedder_test when the concat/split hoisting was enabled.

PiperOrigin-RevId: 196043455

6 years agoSupport saving Python state with object-based checkpoints
Allen Lavoie [Wed, 9 May 2018 22:56:43 +0000 (15:56 -0700)]
Support saving Python state with object-based checkpoints

Allows SaveableObjects to specify feed dict addition callbacks for object-based saving.

For now just saves get_config() with Layers. Doesn't do any loading, and there isn't quite enough information to reconstruct a Model yet (needs topology).

My plan is to get Models to the point where they can be reconstructed from object-based checkpoints (probably one more change), add in SavedModel export (assuming no dynamic control flow for now), then add this "SavedModel+Python" format to Model.save / load_model.

PiperOrigin-RevId: 196043183

6 years agoAllowing trivial passthrough ops to be turned into reshapes when they otherwise canno...
A. Unique TensorFlower [Wed, 9 May 2018 22:44:13 +0000 (15:44 -0700)]
Allowing trivial passthrough ops to be turned into reshapes when they otherwise cannot be removed.

PiperOrigin-RevId: 196041444

6 years agoFix bug in which the ConvLSTM2D layer could not be cloned.
Francois Chollet [Wed, 9 May 2018 22:36:34 +0000 (15:36 -0700)]
Fix bug in which the ConvLSTM2D layer could not be cloned.

PiperOrigin-RevId: 196040413

6 years agoAdd option to set more generic module name filter for API generation.
Michael Case [Wed, 9 May 2018 22:07:40 +0000 (15:07 -0700)]
Add option to set more generic module name filter for API generation.

PiperOrigin-RevId: 196036164

6 years agoRun tensorflow/python/kernel_tests:conv2d_backprop_filter_grad_test only when omptimz...
A. Unique TensorFlower [Wed, 9 May 2018 21:41:23 +0000 (14:41 -0700)]
Run tensorflow/python/kernel_tests:conv2d_backprop_filter_grad_test only when omptimzing to avoid flaky timeouts

PiperOrigin-RevId: 196031762

6 years ago[XLA] Allow HloInstructionMap and HloInstructionSet to contain null keys.
A. Unique TensorFlower [Wed, 9 May 2018 21:20:39 +0000 (14:20 -0700)]
[XLA] Allow HloInstructionMap and HloInstructionSet to contain null keys.

Null HloInstruction* keys may be useful for representing sentinel values.

PiperOrigin-RevId: 196028425

6 years agoUse easy_install for pip installation for RBE images.
A. Unique TensorFlower [Wed, 9 May 2018 21:14:48 +0000 (14:14 -0700)]
Use easy_install for pip installation for RBE images.

We will remove python-pip deb packages from rbe-{debian8, ubuntu16_04}:
  https://github.com/bazelbuild/bazel-toolchains/pull/46
So that we don't we have pip install by deb packages and Python's own package system (and they conflict with each other)

We only install pip by easy_install.

PiperOrigin-RevId: 196027421

6 years agoFix default direction to left when almost no sparsity for a sparse inequality split.
A. Unique TensorFlower [Wed, 9 May 2018 21:07:17 +0000 (14:07 -0700)]
Fix default direction to left when almost no sparsity for a sparse inequality split.

PiperOrigin-RevId: 196026149

6 years agoInternal change.
Anna R [Wed, 9 May 2018 20:55:47 +0000 (13:55 -0700)]
Internal change.

PiperOrigin-RevId: 196024130

6 years agoWhen using static_state_saving_rnn(..) in the following manner
A. Unique TensorFlower [Wed, 9 May 2018 20:55:20 +0000 (13:55 -0700)]
When using static_state_saving_rnn(..) in the following manner

    _, state = tf.nn.static_state_saving_rnn(..)

the runtime will be blocked after some time, because the save_state method of the state_saver object won't be executed as a part of the graph (that part depends only on output node in the current implementation).
Now it should depend on state as well, so the above implementation won't be blocked.

PiperOrigin-RevId: 196024050

6 years agoAdding constant slice op support.
A. Unique TensorFlower [Wed, 9 May 2018 20:43:14 +0000 (13:43 -0700)]
Adding constant slice op support.

PiperOrigin-RevId: 196021899

6 years agoInternal change.
Yifei Feng [Wed, 9 May 2018 20:31:31 +0000 (13:31 -0700)]
Internal change.

PiperOrigin-RevId: 196020032

6 years agoUpdate tf.nn.[max,avg]_pool to specify that it accepts list/tuple stride and kernel...
A. Unique TensorFlower [Wed, 9 May 2018 20:28:00 +0000 (13:28 -0700)]
Update tf.nn.[max,avg]_pool to specify that it accepts list/tuple stride and kernel arguments, not tensor arguments.

If you actually specify a tensor argument here, you get the error:
TypeError: Expected list for 'ksize' argument to 'avg_pool' Op, not <tf.Tensor 'Const_1:0' shape=(4,) dtype=int32>.
PiperOrigin-RevId: 196019507

6 years ago[XLA] First step in adding Literal slice classes, to improve interface safety
Kay Zhu [Wed, 9 May 2018 20:07:35 +0000 (13:07 -0700)]
[XLA] First step in adding Literal slice classes, to improve interface safety
and prepare for enabling more efficient interfacing from Tensor to Literal to
reduce host to device latency.

More specically:
* Introducing a new LiteralBase abstract base class that contains all immutable
methods of from the old Literal class.

* Introducing a subclass LiteralSlice to replace original LiteralView class.
LiteralSlice class is read-only and does not own Shape nor any buffer through
the Pieces. Change a number of callers to use LiteralSlice directly.

* Change Literal class to explicitly own the underlying Shape as well as owning
the underlying buffer via Piece.

* Conversion from Literal to LiteralSlice is now done via an implicit
conversion constructor instead of inheritance.

* Decouple ShapeTree from Literal classes.

* Use copy-and-swap for assignment constructors.

* Other minor cleanups.

PiperOrigin-RevId: 196016576

6 years agoIncrease size of test tensorflow/python:basic_session_run_hooks_test to avoid flaky...
A. Unique TensorFlower [Wed, 9 May 2018 20:06:50 +0000 (13:06 -0700)]
Increase size of test tensorflow/python:basic_session_run_hooks_test to avoid flaky timeouts

PiperOrigin-RevId: 196016436

6 years agoAdd IsCondSwitch.
Jacques Pienaar [Wed, 9 May 2018 20:03:45 +0000 (13:03 -0700)]
Add IsCondSwitch.

* Switch nodes are not part of the cond contexts of the tf.cond that they are the switches for, so check the contexts of the outputs of the switch to determine if a cond switch.
* Include the pivot of a cond in its cond context (there is one pivot per CondContext)
* If a cond is nested in a while loop, then the switch nodes of the cond is in the control flow context of the while loop, so only return that it is a loop switch if it isn't a cond switch.

PiperOrigin-RevId: 196015879

6 years agoCollective Ops Part 6
A. Unique TensorFlower [Wed, 9 May 2018 19:26:06 +0000 (12:26 -0700)]
Collective Ops Part 6

Distributed-mode implementations of CollectiveRemoteAccess.
Extend Worker interface with corresponding new methods.

This change is part of a series of changes introducing infrastructure
for collective ops and initial implementations of reduction and broadcast.

PiperOrigin-RevId: 196010718

6 years ago[TF:XLA] Bump open source llvm revision to r331867
Sanjoy Das [Wed, 9 May 2018 19:15:17 +0000 (12:15 -0700)]
[TF:XLA] Bump open source llvm revision to r331867

PiperOrigin-RevId: 196009199

6 years ago[tf.data] Saveable iterator for SqlDataset.
Shivani Agrawal [Wed, 9 May 2018 19:15:11 +0000 (12:15 -0700)]
[tf.data] Saveable iterator for SqlDataset.

PiperOrigin-RevId: 196009176

6 years agoUse parenthesis based construction instead of brace initialization
Smit Hinsu [Wed, 9 May 2018 19:07:05 +0000 (12:07 -0700)]
Use parenthesis based construction instead of brace initialization

Updates all the construction calls for Status, ScopedActivateContext and
mutexes withing stream_executor to follow the recommendation in
https://abseil.io/tips/88

PiperOrigin-RevId: 196007931

6 years agoInternal Change.
Michael Case [Wed, 9 May 2018 19:05:18 +0000 (12:05 -0700)]
Internal Change.

PiperOrigin-RevId: 196007623

6 years agoIncrease size of tensorflow/contrib/sparsemax:sparsemax_test to medium to avoid flaky...
A. Unique TensorFlower [Wed, 9 May 2018 18:45:52 +0000 (11:45 -0700)]
Increase size of tensorflow/contrib/sparsemax:sparsemax_test to medium to avoid flaky timeouts

PiperOrigin-RevId: 196004443

6 years agoTFTS: Make estimators_test non-flaky
Allen Lavoie [Wed, 9 May 2018 18:28:30 +0000 (11:28 -0700)]
TFTS: Make estimators_test non-flaky

Replaces a "loss decreased" check with basic shape checking (it should have been seeded already, so there's likely some race condition which I should track down...).

PiperOrigin-RevId: 196001526

6 years ago[XLA] Make XLA's memory allocator return an owning smart pointer.
Justin Lebar [Wed, 9 May 2018 18:22:31 +0000 (11:22 -0700)]
[XLA] Make XLA's memory allocator return an owning smart pointer.

Previously, xla::DeviceMemoryAllocator::Allocate returned a
stream_executor::DeviceMemoryBase.  This is morally equivalent to a raw
pointer: It's on you the user to call Deallocate().

Unfortunately we ~never got this right.  Essentially all users of
Allocate() call it in a loop, and TF_RETURN_IF_ERROR within the loop.
If any of these allocations fails (mostly commonly, due to OOM), we leak
everything we've allocated up until then.

This patch changes our API so that it returns an owning pointer.  Now
things mostly Just Work.

Also worth calling out: The lambda in CpuExecutable::ExecuteOnStream
passed to ExecuteComputeFunction almost certainly had multithreaded
use-after-free bugs.  This patch fixes them.

PiperOrigin-RevId: 196000535

6 years agoBenchmark for tf.scan in graph and eager modes. As of this writing, a simple tf.scan...
A. Unique TensorFlower [Wed, 9 May 2018 18:22:24 +0000 (11:22 -0700)]
Benchmark for tf.scan in graph and eager modes. As of this writing, a simple tf.scan sum is ~80x faster in graph mode (including graph building time) for 32,000 nodes. Additionally, tf.scan exhibits quadratic scaling in eager mode but linear in graph.

PiperOrigin-RevId: 196000512

6 years agoIncrease the shard count of tensorflow/python/keras:wrappers_test to avoid flaky...
A. Unique TensorFlower [Wed, 9 May 2018 18:11:32 +0000 (11:11 -0700)]
Increase the shard count of tensorflow/python/keras:wrappers_test to avoid flaky timeouts

PiperOrigin-RevId: 195998578

6 years agoAvoid rebuilding the graph for every run.
Jacques Pienaar [Wed, 9 May 2018 18:06:45 +0000 (11:06 -0700)]
Avoid rebuilding the graph for every run.

* Use placeholder to avoid building the graph for every run in testIf.
* Update file comment.

PiperOrigin-RevId: 195997713

6 years agoTest tensorflow/contrib/timeseries/python/timeseries:estimators_test only in opt...
A. Unique TensorFlower [Wed, 9 May 2018 17:47:06 +0000 (10:47 -0700)]
Test tensorflow/contrib/timeseries/python/timeseries:estimators_test only in opt mode to avoid flaky timeouts

PiperOrigin-RevId: 195993828

6 years agoFix a bug of literal prints in hlo_graph_dumper
A. Unique TensorFlower [Wed, 9 May 2018 17:38:18 +0000 (10:38 -0700)]
Fix a bug of literal prints in hlo_graph_dumper
Sigterm was raised when no literal info is associated with constant instructions in HloProto.

PiperOrigin-RevId: 195992305

6 years agoFix bug in handling of SAVERS collection for shutdown hook.
Russell Power [Wed, 9 May 2018 17:23:15 +0000 (10:23 -0700)]
Fix bug in handling of SAVERS collection for shutdown hook.

PiperOrigin-RevId: 195989954

6 years ago[Functions] Fix unbounded memory growth in FunctionLibraryRuntime.
Derek Murray [Wed, 9 May 2018 16:42:18 +0000 (09:42 -0700)]
[Functions] Fix unbounded memory growth in FunctionLibraryRuntime.

A recent change modified the behavior of `FunctionLibraryRuntimeImpl::ReleaseHandle()`
so that it no longer freed the memory associated with an instantiated function. Since
we rely on instantiating and releasing a potentially large number of instances of the
same function in tf.data to isolate the (e.g. random number generator) state in each
instance, this change meant that the memory consumption could grow without bound in
a simple program like:

```python

  ds = tf.data.Dataset.from_tensors(0).repeat(None)

  # The function `lambda y: y + 1` would be instantiated for each element in the input.
  ds = ds.flat_map(lambda x: tf.data.Dataset.from_tensors(x).map(
    lambda y: y + tf.random_uniform([], minval=0, maxval=10, dtype=tf.int32)))

  iterator = ds.make_one_shot_iterator()
  next_elem = iterator.get_next()

  with tf.Session() as sess:
    while True:
      sess.run(next_elem)
```

PiperOrigin-RevId: 195983977

6 years agoAdds _DefinedFunction.stateful_ops.
A. Unique TensorFlower [Wed, 9 May 2018 16:05:59 +0000 (09:05 -0700)]
Adds _DefinedFunction.stateful_ops.

PiperOrigin-RevId: 195979035

6 years agoAdd a few CHECKs here and there.
A. Unique TensorFlower [Wed, 9 May 2018 15:33:33 +0000 (08:33 -0700)]
Add a few CHECKs here and there.

PiperOrigin-RevId: 195974944

6 years agoAutomated g4 rollback of changelist 195120627
Peter Hawkins [Wed, 9 May 2018 14:27:30 +0000 (07:27 -0700)]
Automated g4 rollback of changelist 195120627

PiperOrigin-RevId: 195966744

6 years agoRun test tensorflow/python/kernel_tests:array_ops_test only when optimizing to avoid...
A. Unique TensorFlower [Wed, 9 May 2018 12:22:36 +0000 (05:22 -0700)]
Run test tensorflow/python/kernel_tests:array_ops_test only when optimizing to avoid flaky timeouts

PiperOrigin-RevId: 195955576

6 years agoUnifying argument documentation style in CudnnSupport.
A. Unique TensorFlower [Wed, 9 May 2018 05:57:35 +0000 (22:57 -0700)]
Unifying argument documentation style in CudnnSupport.

PiperOrigin-RevId: 195926489

6 years agoImplementation of Slice.
A. Unique TensorFlower [Wed, 9 May 2018 05:49:20 +0000 (22:49 -0700)]
Implementation of Slice.

PiperOrigin-RevId: 195926057

6 years agoDelete old op gen code and replace with eager op gen.
Akshay Modi [Wed, 9 May 2018 01:36:32 +0000 (18:36 -0700)]
Delete old op gen code and replace with eager op gen.

PiperOrigin-RevId: 195909821

6 years ago[XLA] Make XlaAllocator obey retry_on_failure arg.
Justin Lebar [Wed, 9 May 2018 01:16:47 +0000 (18:16 -0700)]
[XLA] Make XlaAllocator obey retry_on_failure arg.

Previously we ignored it.

PiperOrigin-RevId: 195908178

6 years ago[XLA:GPU] Disable multi-streaming by default.
Justin Lebar [Wed, 9 May 2018 00:29:01 +0000 (17:29 -0700)]
[XLA:GPU] Disable multi-streaming by default.

Run all GPU work on one stream by default.  We've found experimentally
that multi-streaming creates significant additional memory pressure on
some models, and we don't have any good benchmarks where multi-streaming
helps on which to tune the stream-assignment heuristics.  So just
disable it for now.

PiperOrigin-RevId: 195903229

6 years agoInclude tensorflow::DataType header file
Akshay Modi [Wed, 9 May 2018 00:27:33 +0000 (17:27 -0700)]
Include tensorflow::DataType header file

PiperOrigin-RevId: 195903041

6 years agoAdd two helper methods to the graphcycle class.
Tony Wang [Wed, 9 May 2018 00:24:02 +0000 (17:24 -0700)]
Add two helper methods to the graphcycle class.

PiperOrigin-RevId: 195902659

6 years agoFix a dropped line in the DepthwiseConv2dNative model
A. Unique TensorFlower [Wed, 9 May 2018 00:04:00 +0000 (17:04 -0700)]
Fix a dropped line in the DepthwiseConv2dNative model

PiperOrigin-RevId: 195900021

6 years agoSkip convert_to_tensor in r_binary_op_wrapper in eager mode.
Akshay Modi [Wed, 9 May 2018 00:03:10 +0000 (17:03 -0700)]
Skip convert_to_tensor in r_binary_op_wrapper in eager mode.

Should fallback from C if its not convertible.

PiperOrigin-RevId: 195899829

6 years agoMake eager functions runable on TPU
Igor Ganichev [Tue, 8 May 2018 23:43:54 +0000 (16:43 -0700)]
Make eager functions runable on TPU

PiperOrigin-RevId: 195897321

6 years agoSet size of tensorflow/python/keras:normalization_test to medium to avoid flaky timeouts
A. Unique TensorFlower [Tue, 8 May 2018 23:23:27 +0000 (16:23 -0700)]
Set size of tensorflow/python/keras:normalization_test to medium to avoid flaky timeouts

PiperOrigin-RevId: 195894737

6 years agoOnly use integer values for event_ndims.
A. Unique TensorFlower [Tue, 8 May 2018 23:20:02 +0000 (16:20 -0700)]
Only use integer values for event_ndims.

event_ndims have the semantics of being an integer. However, other code paths (such as const_value)
can return back numpy wrapped arrays, which can mess with how values are cached. Instead extract
everything as an integer.

PiperOrigin-RevId: 195894216

6 years agoadd test for pruning useless function lib in graph.
A. Unique TensorFlower [Tue, 8 May 2018 23:16:57 +0000 (16:16 -0700)]
add test for pruning useless function lib in graph.

PiperOrigin-RevId: 195893756

6 years agoAdd test to test suite.
A. Unique TensorFlower [Tue, 8 May 2018 22:43:34 +0000 (15:43 -0700)]
Add test to test suite.

PiperOrigin-RevId: 195888932

6 years agoIncrease shard count of tensorflow/contrib/learn:state_saving_rnn_estimator_test...
A. Unique TensorFlower [Tue, 8 May 2018 22:34:40 +0000 (15:34 -0700)]
Increase shard count of tensorflow/contrib/learn:state_saving_rnn_estimator_test to avoid flaky timeouts

PiperOrigin-RevId: 195887546

6 years agoIncrease size of tensorflow/contrib/distributions:batch_reshape_test to medium to...
A. Unique TensorFlower [Tue, 8 May 2018 22:33:37 +0000 (15:33 -0700)]
Increase size of tensorflow/contrib/distributions:batch_reshape_test to medium to avoid flaky timeouts

PiperOrigin-RevId: 195887374

6 years agoIncrease shard count of tensorflow/python/keras:lstm_test to avoid flaky timeouts
A. Unique TensorFlower [Tue, 8 May 2018 22:26:44 +0000 (15:26 -0700)]
Increase shard count of tensorflow/python/keras:lstm_test to avoid flaky timeouts

PiperOrigin-RevId: 195886372

6 years agoAdd missing ":haswell" match to list of platform selectors.
A. Unique TensorFlower [Tue, 8 May 2018 21:50:24 +0000 (14:50 -0700)]
Add missing ":haswell" match to list of platform selectors.

PiperOrigin-RevId: 195880275

6 years agoIncrease shard_count of tensorflow/python/estimator:estimator_test to avoid flaky...
A. Unique TensorFlower [Tue, 8 May 2018 21:45:01 +0000 (14:45 -0700)]
Increase shard_count of tensorflow/python/estimator:estimator_test to avoid flaky asan timeouts

PiperOrigin-RevId: 195879364

6 years agoDo not differentiage integers in the eager API.
Alexandre Passos [Tue, 8 May 2018 21:42:35 +0000 (14:42 -0700)]
Do not differentiage integers in the eager API.

This is similar to the change made in:
https://github.com/tensorflow/tensorflow/commit/f63750645826df65b05cad505546a86f0e347674
for backpropagation during graph construction via tf.gradients()

PiperOrigin-RevId: 195878952

6 years agoIncrease shard count of tensorflow/contrib/distributions:mixture_test to avoid flaky...
A. Unique TensorFlower [Tue, 8 May 2018 21:41:48 +0000 (14:41 -0700)]
Increase shard count of tensorflow/contrib/distributions:mixture_test to avoid flaky timeouts in asan mode

PiperOrigin-RevId: 195878809

6 years agoIncrease size of test tensorflow/contrib/layers:rev_block_lib_test to medium
A. Unique TensorFlower [Tue, 8 May 2018 21:00:48 +0000 (14:00 -0700)]
Increase size of test tensorflow/contrib/layers:rev_block_lib_test to medium
to avoid flaky timeouts.

PiperOrigin-RevId: 195871947

6 years agoAvoid string formatting in assert_same_float_dtype unless there's an error
Allen Lavoie [Tue, 8 May 2018 21:00:30 +0000 (14:00 -0700)]
Avoid string formatting in assert_same_float_dtype unless there's an error

Especially helpful when executing eagerly

PiperOrigin-RevId: 195871887

6 years agoBetter wrapping of stream executor's cuDNN API calls. Replacing mutex locking and...
A. Unique TensorFlower [Tue, 8 May 2018 19:10:36 +0000 (12:10 -0700)]
Better wrapping of stream executor's cuDNN API calls. Replacing mutex locking and setting the cuDNN stream followed by calling wrap::cudnn... with an RAII CudnnHandle object that handles the former two operations.

Distinguish three different API types:

A) APIs that don't take a cudnnHandle_t: These are thread-safe APIs that don't enqueue any CUDA work on a stream. They can be called directly without any extra precautions.

B) APIs that take a cudnnHandle_t and perform CUDA work. The CUDA context needs to be acquired and the stream needs to be set beforehand, calls need to be serialized. A CudnnHandle instance guarantees that this work has been performed before calling cuDNN.

C) APIs that do take a cudnnHandle_t, but (presumably, the API makes no guarantees) still don't perform any CUDA work. This is limited to the API to setup RNN descriptors. Calls need to be serialized, but most likely we wouldn't need to acquire the CUDA context or set the stream. We still do though using the legacy default stream, because there are no guarantees.

PiperOrigin-RevId: 195856300

6 years agoRemove outdated CUDA SDK string (the text is now consistent with other version choice...
A. Unique TensorFlower [Tue, 8 May 2018 19:04:38 +0000 (12:04 -0700)]
Remove outdated CUDA SDK string (the text is now consistent with other version choices, and the '9.0' format is already present in the default).

PiperOrigin-RevId: 195855416