platform/upstream/tensorflow.git
6 years agoUpdate TensorBoard's tutorial on tensorflow.org with information on setting up as...
Chi Zeng [Mon, 5 Mar 2018 23:22:07 +0000 (15:22 -0800)]
Update TensorBoard's tutorial on tensorflow.org with information on setting up as well as how long the tutorial should take.

PiperOrigin-RevId: 187933027

6 years agoAdd objective functions for variational inference with Csiszar f-divergences.
A. Unique TensorFlower [Mon, 5 Mar 2018 23:17:24 +0000 (15:17 -0800)]
Add objective functions for variational inference with Csiszar f-divergences.

PiperOrigin-RevId: 187931921

6 years agoFix bug with multi_gpu_model / model.inputs.
Francois Chollet [Mon, 5 Mar 2018 23:17:06 +0000 (15:17 -0800)]
Fix bug with multi_gpu_model / model.inputs.

PiperOrigin-RevId: 187931852

6 years agoCorrect op::Attr usage in C++ gradient implementations.
A. Unique TensorFlower [Mon, 5 Mar 2018 22:45:28 +0000 (14:45 -0800)]
Correct op::Attr usage in C++ gradient implementations.

Also enabled TF_MUST_USE_RESULT for the generated Attr API, so we
can catch any new errors early.

Fixes #17360

PiperOrigin-RevId: 187925761

6 years agoAdds test_util.IsMklEnabled() that returns true if TensorFlow has been built with...
Tatiana Shpeisman [Mon, 5 Mar 2018 22:40:46 +0000 (14:40 -0800)]
Adds test_util.IsMklEnabled() that returns true if TensorFlow has been built with MKL support. Fixes the failure of tensorflow/python/tools:print_selective_registration_header_test by using 'Mkl' prefix for MatMul op name when MKL is enabled.

PiperOrigin-RevId: 187925038

6 years ago[XLA] Make HloEvaluator use wrap-around semantics for DynamicUpdateSlice.
Michael Kuperstein [Mon, 5 Mar 2018 22:33:22 +0000 (14:33 -0800)]
[XLA] Make HloEvaluator use wrap-around semantics for DynamicUpdateSlice.

PiperOrigin-RevId: 187923671

6 years agoAdd alternative paths for CUDA installation.
A. Unique TensorFlower [Mon, 5 Mar 2018 22:31:59 +0000 (14:31 -0800)]
Add alternative paths for CUDA installation.

This detects negativo17's CUDA packages for Fedora.

PiperOrigin-RevId: 187923472

6 years agoAdd sequence_indicator_column
A. Unique TensorFlower [Mon, 5 Mar 2018 22:14:01 +0000 (14:14 -0800)]
Add sequence_indicator_column

PiperOrigin-RevId: 187920673

6 years agoDisable both "no_mac" and "nomac" tags when building on osx.
Gunhan Gulsoy [Mon, 5 Mar 2018 22:08:37 +0000 (14:08 -0800)]
Disable both "no_mac" and "nomac" tags when building on osx.

PiperOrigin-RevId: 187919812

6 years agoFix the issue where gpu_option is not respected for keras estimator.
Yifei Feng [Mon, 5 Mar 2018 21:47:30 +0000 (13:47 -0800)]
Fix the issue where gpu_option is not respected for keras estimator.
Set keras backend session with the given config before any get_session call creates a new session.
Fix #14776.

PiperOrigin-RevId: 187916300

6 years agoAdd methods for extracting the shapes of the entry computation from an HloProto.
Mark Heffernan [Mon, 5 Mar 2018 21:44:42 +0000 (13:44 -0800)]
Add methods for extracting the shapes of the entry computation from an HloProto.

PiperOrigin-RevId: 187915821

6 years agoBenchmark regression
Alexandre Passos [Mon, 5 Mar 2018 21:36:30 +0000 (13:36 -0800)]
Benchmark regression

PiperOrigin-RevId: 187914657

6 years ago[XLA] Fix BF16 normalizer for CrossReplicaSum.
Yuanzhong Xu [Mon, 5 Mar 2018 20:54:27 +0000 (12:54 -0800)]
[XLA] Fix BF16 normalizer for CrossReplicaSum.

1. It may produce incorrect result when mixed precision is not supported and
BF16 is not support only for a particular operand. Then the pass may introduce
new mixed precision for an all-BF16 CRS. This is unlikely in practical
settings, but removing this constraint can enable auto-generating corner case
tests using this pass.

2. A cycle can be introduced in the tuple-shaped output output. This wasn't
caught by the test because the DFS happened to succeed. Now add verifier
explicitly.

PiperOrigin-RevId: 187908099

6 years agoSimplify softmax_centered implementation.
A. Unique TensorFlower [Mon, 5 Mar 2018 20:46:30 +0000 (12:46 -0800)]
Simplify softmax_centered implementation.

This also resolves a bug with softmax_centered.inverse not working on inputs with
partially known.

PiperOrigin-RevId: 187907026

6 years agoMake variable creator scope thread local (always).
Priya Gupta [Mon, 5 Mar 2018 20:28:07 +0000 (12:28 -0800)]
Make variable creator scope thread local (always).

PiperOrigin-RevId: 187904394

6 years ago[XLA] Mark xla_internal_test_main as alwayslink.
Justin Lebar [Mon, 5 Mar 2018 20:22:35 +0000 (12:22 -0800)]
[XLA] Mark xla_internal_test_main as alwayslink.

PiperOrigin-RevId: 187903623

6 years agoReturn ComputationLayout as a reference from the HLO module.
Mark Heffernan [Mon, 5 Mar 2018 20:01:37 +0000 (12:01 -0800)]
Return ComputationLayout as a reference from the HLO module.

PiperOrigin-RevId: 187900559

6 years ago[XLA] Whitelist send/recv in BF16 passes.
Yuanzhong Xu [Mon, 5 Mar 2018 19:57:04 +0000 (11:57 -0800)]
[XLA] Whitelist send/recv in BF16 passes.

PiperOrigin-RevId: 187899955

6 years agoShape function bug in tensor_list_stack
Alexandre Passos [Mon, 5 Mar 2018 19:33:20 +0000 (11:33 -0800)]
Shape function bug in tensor_list_stack

PiperOrigin-RevId: 187896505

6 years agoDon't log an error if we can't set HTTP/2.
Jonathan Hseu [Mon, 5 Mar 2018 19:28:17 +0000 (11:28 -0800)]
Don't log an error if we can't set HTTP/2.

PiperOrigin-RevId: 187895652

6 years agoExtract the EvaluateConstantTensorForEdge method from ShapeRefiner.
Skye Wanderman-Milne [Mon, 5 Mar 2018 19:23:29 +0000 (11:23 -0800)]
Extract the EvaluateConstantTensorForEdge method from ShapeRefiner.

This change introduces a new stand-alone function, EvaluateConstantTensor,
pulled from ShapeRefiner. ShapeRefiner now calls this new function and the
old functions are removed.

I'm still depending on shape_refiner_test.cc for test coverage.

This is the first step towards making smart_cond better able to evaluate
constant tensors.

PiperOrigin-RevId: 187894976

6 years ago[XLA] Allocate and track memory in replicas separately.
A. Unique TensorFlower [Mon, 5 Mar 2018 19:20:28 +0000 (11:20 -0800)]
[XLA] Allocate and track memory in replicas separately.

PiperOrigin-RevId: 187894473

6 years ago[XLA:GPU] Allow merging into input fusion nodes in FusionMerger.
Justin Lebar [Mon, 5 Mar 2018 19:10:42 +0000 (11:10 -0800)]
[XLA:GPU] Allow merging into input fusion nodes in FusionMerger.

Seems to have been an oversight.  "Input fusion" means that the *output*
of the fusion node is the "real hero".  The inputs aren't special; we
can fuse more stuff in.

PiperOrigin-RevId: 187892975

6 years agoFix documentation of image size for inception-v3 (299 * 299)
A. Unique TensorFlower [Mon, 5 Mar 2018 18:47:24 +0000 (10:47 -0800)]
Fix documentation of image size for inception-v3 (299 * 299)

PiperOrigin-RevId: 187889122

6 years agoMake SavedModel builder validation accept signatures involving sparse tensors.
David Soergel [Mon, 5 Mar 2018 18:11:20 +0000 (10:11 -0800)]
Make SavedModel builder validation accept signatures involving sparse tensors.

PiperOrigin-RevId: 187883080

6 years agoExposes poisson_regression_head in tf.contrib.estimator.
A. Unique TensorFlower [Mon, 5 Mar 2018 18:07:27 +0000 (10:07 -0800)]
Exposes poisson_regression_head in tf.contrib.estimator.

PiperOrigin-RevId: 187882494

6 years ago[XLA:GPU] Add some VLOGs to FusionMerger.
Justin Lebar [Mon, 5 Mar 2018 17:51:38 +0000 (09:51 -0800)]
[XLA:GPU] Add some VLOGs to FusionMerger.

Also use c_any_of and friends instead of std::any_of &c, and make some
minor whitespace fixes in comments.

No functional change.

PiperOrigin-RevId: 187880113

6 years agoChange the default ps_ops to STANDARD_PS_OPS
Jianwei Xie [Mon, 5 Mar 2018 17:18:24 +0000 (09:18 -0800)]
Change the default ps_ops to STANDARD_PS_OPS

PiperOrigin-RevId: 187875797

6 years agoFix a case in SparseSegmentReduction ops with missing segment IDs, where all segment...
A. Unique TensorFlower [Mon, 5 Mar 2018 17:01:22 +0000 (09:01 -0800)]
Fix a case in SparseSegmentReduction ops with missing segment IDs, where all segment IDs are empty. Added a test for this case.

PiperOrigin-RevId: 187873356

6 years agoInternal change.
A. Unique TensorFlower [Mon, 5 Mar 2018 15:43:58 +0000 (07:43 -0800)]
Internal change.

PiperOrigin-RevId: 187865303

6 years agoImprove LinearValidOnShape.
A. Unique TensorFlower [Mon, 5 Mar 2018 14:51:33 +0000 (06:51 -0800)]
Improve LinearValidOnShape.

It actually only needs to check that the operation is a bitcast (ignoring
element_type). So far, the check was more restrictive, which made this function
always return false for a non-trivial reshape operation.
However we still fail to make use of this less strict checking, because for
reshapes inside a fusion node, we don't have a layout and can therefore not
check if it is a bitcast or not.
Also add a disabled test that will be enabled once the layout issue is fixed.

PiperOrigin-RevId: 187860440

6 years agoAutomated g4 rollback of changelist 185073515
A. Unique TensorFlower [Mon, 5 Mar 2018 13:18:24 +0000 (05:18 -0800)]
Automated g4 rollback of changelist 185073515

PiperOrigin-RevId: 187852929

6 years ago[XLA] Minor comment fixes in instruction_fusion.cc.
Justin Lebar [Mon, 5 Mar 2018 13:10:40 +0000 (05:10 -0800)]
[XLA] Minor comment fixes in instruction_fusion.cc.

No functional change.

PiperOrigin-RevId: 187852483

6 years agoAdds checks to tf.nn.sparse_softmax_cross_entropy_with_logits to make sure that shape...
A. Unique TensorFlower [Mon, 5 Mar 2018 10:45:58 +0000 (02:45 -0800)]
Adds checks to tf.nn.sparse_softmax_cross_entropy_with_logits to make sure that shapes for labels and logits (except last dimension) match. First, the static dimensions are checked, and only if the result is inconclusive a dynamic check is added.

In sparse_softmax_cross_entropy_with_logits the input dimensions are flattened, which can lead to unexpected bugs if the order of dimensions does not match (e.g. if one is time-major and the other is batch-major). This prevents such mistakes.

PiperOrigin-RevId: 187841750

6 years agoPrevent accidental re-use of removed field.
Patrick Nguyen [Sun, 4 Mar 2018 21:47:57 +0000 (13:47 -0800)]
Prevent accidental re-use of removed field.

PiperOrigin-RevId: 187798953

6 years agoFix nested bullets in docs. (Need 4 spaces indent)
Priya Gupta [Sun, 4 Mar 2018 06:12:24 +0000 (22:12 -0800)]
Fix nested bullets in docs. (Need 4 spaces indent)

PiperOrigin-RevId: 187763978

6 years agoFix broken links in docs.
Priya Gupta [Sun, 4 Mar 2018 02:31:07 +0000 (18:31 -0800)]
Fix broken links in docs.

PiperOrigin-RevId: 187755567

6 years agoInternal change.
A. Unique TensorFlower [Sat, 3 Mar 2018 23:49:05 +0000 (15:49 -0800)]
Internal change.

PiperOrigin-RevId: 187749767

6 years agoWill open source this part of code.
A. Unique TensorFlower [Sat, 3 Mar 2018 22:26:21 +0000 (14:26 -0800)]
Will open source this part of code.

PiperOrigin-RevId: 187747019

6 years agoInternal Change.
Michael Case [Sat, 3 Mar 2018 18:04:35 +0000 (10:04 -0800)]
Internal Change.

PiperOrigin-RevId: 187738384

6 years agotfdbg: Add link to TensorBoard Debugger Plugin
Shanqing Cai [Sat, 3 Mar 2018 03:18:49 +0000 (19:18 -0800)]
tfdbg: Add link to TensorBoard Debugger Plugin

from the CLI documentation

RELNOTES: tfdbg: TensorFlow Debugger's graphical user interface (GUI),
the [TensorBoard Debugger Plugin](https://github.com/tensorflow/tensorboard/blob/master/tensorboard/plugins/debugger/README.md), is now in alpha.
PiperOrigin-RevId: 187700265

6 years agoMerged commit includes the following changes:
A. Unique TensorFlower [Sat, 3 Mar 2018 02:33:21 +0000 (18:33 -0800)]
Merged commit includes the following changes:
187697531  by andrewharp:

    Tweak whitespace for fft2d dep.

--
187696129  by A. Unique TensorFlower:

    Generalize support for logical expressions, comparison operators and multiple comparisons.

--
187692494  by vinuraja:

    * Adds a boolean attribute to ConfigureDistributedTPUOp for internal use.

    * Adds GraphRunner ctor which takes in the device to run the graph on.

--
187692129  by andrewharp:

    Audio utility classes for supporting MFCC and AudioSpectrogram operators

--

PiperOrigin-RevId: 187697531

6 years agoProperly handle the case of functions with no inputs
Benoit Steiner [Sat, 3 Mar 2018 01:18:00 +0000 (17:18 -0800)]
Properly handle the case of functions with no inputs

PiperOrigin-RevId: 187691555

6 years agoDon't throw errors if non-Checkpointable objects are passed to MultiRNNCell
Allen Lavoie [Sat, 3 Mar 2018 00:58:11 +0000 (16:58 -0800)]
Don't throw errors if non-Checkpointable objects are passed to MultiRNNCell

PiperOrigin-RevId: 187689371

6 years agoLoop optimizer: Convert StackPush nodes to Identity instead of eliminating them compl...
A. Unique TensorFlower [Sat, 3 Mar 2018 00:25:21 +0000 (16:25 -0800)]
Loop optimizer: Convert StackPush nodes to Identity instead of eliminating them completely.
Move loop optimizer to run before dependency optimizer so identity nodes will be pruned.

PiperOrigin-RevId: 187685669

6 years agoCheckpointable: Fix CPU/GPU device placement issues
Allen Lavoie [Sat, 3 Mar 2018 00:06:24 +0000 (16:06 -0800)]
Checkpointable: Fix CPU/GPU device placement issues

Restore ops go on the CPU, then the value gets copied to whichever device it needs to be on. This I need to do manually for restores passed as initial_values; for regular save/restore it's done by the SaveableObjects for variables.

Also explicitly places some counters on the CPU.

Adds a GPU-using test for Checkpointable usage.

PiperOrigin-RevId: 187683050

6 years agoeager/examples: Use tf.keras.Model in RNN examples.
Asim Shankar [Sat, 3 Mar 2018 00:05:05 +0000 (16:05 -0800)]
eager/examples: Use tf.keras.Model in RNN examples.

Some notable differences between tf.keras.Model and tfe.Network:

- tf.keras.Model doesn't have a track_layer() method. It tracks Layer and Checkpointable valued attributes automatically. For list and other complex structures, __setattr__ performs the role of tfe.Network.track_layer()

- tf.keras.Model accepts a single positional argument. Thus either all arguments must be packaged into a single list/tuple (as in rnn_ptb.py) or be provided as keyword arguments (as in rnn_colorbot.py).

PiperOrigin-RevId: 187682716

6 years agoExit with failure if a free gpu is not found by parallel_gpu_execute.
Michael Case [Fri, 2 Mar 2018 23:52:32 +0000 (15:52 -0800)]
Exit with failure if a free gpu is not found by parallel_gpu_execute.

If TF_GPU_COUNT was a value greater than the actual number of GPUs, it was
possible for tests to just pass without running when running under
parallel_gpu_execute.sh.

PiperOrigin-RevId: 187681032

6 years agoFix some compiler warnings in MKL build.
A. Unique TensorFlower [Fri, 2 Mar 2018 23:25:41 +0000 (15:25 -0800)]
Fix some compiler warnings in MKL build.

PiperOrigin-RevId: 187677893

6 years agoAdds setUseNNAPI to Interpreter.java, to enable develoeprs turn on & off NNAPI.
A. Unique TensorFlower [Fri, 2 Mar 2018 23:24:33 +0000 (15:24 -0800)]
Adds setUseNNAPI to Interpreter.java, to enable develoeprs turn on & off NNAPI.

PiperOrigin-RevId: 187677765

6 years agoReadVariableOp in C for eager (only for the fastpath)
Akshay Modi [Fri, 2 Mar 2018 23:11:13 +0000 (15:11 -0800)]
ReadVariableOp in C for eager (only for the fastpath)

PiperOrigin-RevId: 187676012

6 years agoBegin a library for statistical testing of samplers.
A. Unique TensorFlower [Fri, 2 Mar 2018 23:06:13 +0000 (15:06 -0800)]
Begin a library for statistical testing of samplers.

So far, it consists of one-sample and two-sample equality-of-means
assertions, and power analysis and experimental design for those,
because that's what was needed for testing the LKJ distribution.
If this API shape proves viable, more to come.

PiperOrigin-RevId: 187675337

6 years agoAdd a small helper which is useful for quicker debugging.
A. Unique TensorFlower [Fri, 2 Mar 2018 22:55:26 +0000 (14:55 -0800)]
Add a small helper which is useful for quicker debugging.

PiperOrigin-RevId: 187673654

6 years agoCheckpointable: Have MultiRNNCell add its dependent cells as dependencies
Allen Lavoie [Fri, 2 Mar 2018 22:33:39 +0000 (14:33 -0800)]
Checkpointable: Have MultiRNNCell add its dependent cells as dependencies

PiperOrigin-RevId: 187670464

6 years ago[TF:XLA] Bump open source llvm revision to r326571
Sanjoy Das [Fri, 2 Mar 2018 22:00:07 +0000 (14:00 -0800)]
[TF:XLA] Bump open source llvm revision to r326571

PiperOrigin-RevId: 187665541

6 years agoMake shape inference error messages more consistent.
Eli Bendersky [Fri, 2 Mar 2018 21:37:41 +0000 (13:37 -0800)]
Make shape inference error messages more consistent.

PiperOrigin-RevId: 187662562

6 years agoAdd /learning/tfx/ to the visibility group of tensorflow/compiler/jit.
A. Unique TensorFlower [Fri, 2 Mar 2018 21:32:35 +0000 (13:32 -0800)]
Add /learning/tfx/ to the visibility group of tensorflow/compiler/jit.

PiperOrigin-RevId: 187661883

6 years agoMake tfe.Metrics Checkpointable
Allen Lavoie [Fri, 2 Mar 2018 21:03:42 +0000 (13:03 -0800)]
Make tfe.Metrics Checkpointable

Same principle as Layers: use add_variable to add a dependency on any variables
created. I've ignored the global/local distinction, since it makes more sense
for users to control saving by either adding a dependency on the Metric or not.

PiperOrigin-RevId: 187658433

6 years agoAutomated g4 rollback of changelist 187582263
A. Unique TensorFlower [Fri, 2 Mar 2018 20:58:08 +0000 (12:58 -0800)]
Automated g4 rollback of changelist 187582263

PiperOrigin-RevId: 187657654

6 years agoTFTS: Switch more variables to ResourceVariables to avoid race conditions
Allen Lavoie [Fri, 2 Mar 2018 20:43:22 +0000 (12:43 -0800)]
TFTS: Switch more variables to ResourceVariables to avoid race conditions

The LSTM example test was a bit flaky.

PiperOrigin-RevId: 187655714

6 years agoExclude flaky tests for cuda_on_cpu.
Guangda Lai [Fri, 2 Mar 2018 20:33:40 +0000 (12:33 -0800)]
Exclude flaky tests for cuda_on_cpu.

PiperOrigin-RevId: 187654568

6 years agoFreezeSavedModel support for ResourceVariables.
Suharsh Sivakumar [Fri, 2 Mar 2018 20:25:13 +0000 (12:25 -0800)]
FreezeSavedModel support for ResourceVariables.

PiperOrigin-RevId: 187653676

6 years agoGCS: Extract block cache interface from implementation.
Brennan Saeta [Fri, 2 Mar 2018 20:19:23 +0000 (12:19 -0800)]
GCS: Extract block cache interface from implementation.

PiperOrigin-RevId: 187652953

6 years agoMove the PS_OPS from Estimator to device_setter to benefit more users.
Jianwei Xie [Fri, 2 Mar 2018 19:59:02 +0000 (11:59 -0800)]
Move the PS_OPS from Estimator to device_setter to benefit more users.

PiperOrigin-RevId: 187650283

6 years agoGCS: Update throttle state even if disabled.
Brennan Saeta [Fri, 2 Mar 2018 19:35:53 +0000 (11:35 -0800)]
GCS: Update throttle state even if disabled.

PiperOrigin-RevId: 187647263

6 years agoAdd a configurable preference for scheduling fuller batches sooner to the adaptive...
A. Unique TensorFlower [Fri, 2 Mar 2018 19:18:41 +0000 (11:18 -0800)]
Add a configurable preference for scheduling fuller batches sooner to the adaptive shared batcher.  A full batch will now be scheduled before an older, nearly empty batch as long as the age gap is less than full_batch_scheduling_boost_micros.

This parameter improves latency under heavy load, but too large a value will harm tail latency.

PiperOrigin-RevId: 187644796

6 years ago[XLA] Support while loops and constant in HLO BF16 propagation.
Yuanzhong Xu [Fri, 2 Mar 2018 19:15:14 +0000 (11:15 -0800)]
[XLA] Support while loops and constant in HLO BF16 propagation.

PiperOrigin-RevId: 187644155

6 years agoUpdating toolchain configs for GPU builds
A. Unique TensorFlower [Fri, 2 Mar 2018 19:11:15 +0000 (11:11 -0800)]
Updating toolchain configs for GPU builds

PiperOrigin-RevId: 187643585

6 years agotf.keras: Remove unnecessary "with self.test_sesion()" statements in tests.
Asim Shankar [Fri, 2 Mar 2018 18:30:01 +0000 (10:30 -0800)]
tf.keras: Remove unnecessary "with self.test_sesion()" statements in tests.

The test decorator that runs the test twice (once with eager execution enabled,
once without) doesn't require the block, and this makes the code appear more
eager-friendly (as there is no concept of a session when eager execution is
enabled).

PiperOrigin-RevId: 187637008

6 years agoAdd bfloat16 support for CPU ops.
A. Unique TensorFlower [Fri, 2 Mar 2018 18:05:14 +0000 (10:05 -0800)]
Add bfloat16 support for CPU ops.

PiperOrigin-RevId: 187633511

6 years agoNo need to override _handle_device for variables anymore
Alexandre Passos [Fri, 2 Mar 2018 17:53:54 +0000 (09:53 -0800)]
No need to override _handle_device for variables anymore

PiperOrigin-RevId: 187631915

6 years agoOnly use softfp for android builds to make odroid builds work.
Andrew Selle [Fri, 2 Mar 2018 17:32:36 +0000 (09:32 -0800)]
Only use softfp for android builds to make odroid builds work.

PiperOrigin-RevId: 187629282

6 years agoTake into account the return value mapping of functions
Benoit Steiner [Fri, 2 Mar 2018 17:24:26 +0000 (09:24 -0800)]
Take into account the return value mapping of functions

PiperOrigin-RevId: 187628382

6 years agoAdd a testing utility that can be called from compiled code, and which can mock a...
A. Unique TensorFlower [Fri, 2 Mar 2018 16:45:01 +0000 (08:45 -0800)]
Add a testing utility that can be called from compiled code, and which can mock a TF module for internal tests. Use it in api_test.py

PiperOrigin-RevId: 187624343

6 years agoInternal-only change.
Brennan Saeta [Fri, 2 Mar 2018 16:31:21 +0000 (08:31 -0800)]
Internal-only change.

PiperOrigin-RevId: 187623121

6 years agoEliminate the creation of unnecessary read ops when working with ResourceVariables.
A. Unique TensorFlower [Fri, 2 Mar 2018 16:20:27 +0000 (08:20 -0800)]
Eliminate the creation of unnecessary read ops when working with ResourceVariables.

In particular:
1. Don't create additional read ops when creating a ResourceVariable from a VariableDef proto.
2. Expose the ability to assign a ResourceVariable without reading & returning the new value.
3. Colocating with a ResourceVariable's ".op" property eliminates the creation of additional read ops.
4. Savers can read a variable's value using the _graph_element property, since these reads don't need control dependencies.

This makes the visualization of graphs on TensorBoard much nicer.

PiperOrigin-RevId: 187622122

6 years agoAdd support to convert ResourceVariables of graphs into constants.
A. Unique TensorFlower [Fri, 2 Mar 2018 13:50:55 +0000 (05:50 -0800)]
Add support to convert ResourceVariables of graphs into constants.

This involves a change to the implementation of convert_variables_to_constants.

PiperOrigin-RevId: 187610062

6 years agoJava: Update to 1.6.0
Asim Shankar [Fri, 2 Mar 2018 09:48:59 +0000 (01:48 -0800)]
Java: Update to 1.6.0

PiperOrigin-RevId: 187595636

6 years ago[XLA:GPU] Extract multiplication of complex numbers into a helper function.
A. Unique TensorFlower [Fri, 2 Mar 2018 09:17:19 +0000 (01:17 -0800)]
[XLA:GPU] Extract multiplication of complex numbers into a helper function.

Also add helper functions for getting the real and the imaginary part of a
complex number.

PiperOrigin-RevId: 187593341

6 years agoAutomated g4 rollback of changelist 187563544
Gunhan Gulsoy [Fri, 2 Mar 2018 06:25:41 +0000 (22:25 -0800)]
Automated g4 rollback of changelist 187563544

PiperOrigin-RevId: 187582263

6 years ago[XLA] For graphviz graph dumps that are colored by sharding, choose the fill color...
Peter Hawkins [Fri, 2 Mar 2018 02:49:05 +0000 (18:49 -0800)]
[XLA] For graphviz graph dumps that are colored by sharding, choose the fill color for fusion nodes according to the sharding color rather than always choosing grey.

PiperOrigin-RevId: 187567679

6 years agoGrappler: Change memory optimizer recomputation name prefix into a regexp. This allows
A. Unique TensorFlower [Fri, 2 Mar 2018 02:03:19 +0000 (18:03 -0800)]
Grappler: Change memory optimizer recomputation name prefix into a regexp. This allows
us to match any node names, especially those under different scopes. This still performs
a prefix regexp match, so it is basically backwards compatible.

PiperOrigin-RevId: 187563544

6 years agoAllow replacing attributes in templates.
A. Unique TensorFlower [Fri, 2 Mar 2018 01:58:07 +0000 (17:58 -0800)]
Allow replacing attributes in templates.

PiperOrigin-RevId: 187562864

6 years agoImprove CURL error reporting and handling in the GCS filesystem.
Jonathan Hseu [Fri, 2 Mar 2018 01:53:49 +0000 (17:53 -0800)]
Improve CURL error reporting and handling in the GCS filesystem.

- The main semantics change is that we return immediately if curl_easy_perform doesn't return CURLE_OK. The CURL documentation indicates that it's not ok to fetch info if the curl call failed:
https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html
- LOG errors where we can't return a status. Otherwise return with a status immediately.

PiperOrigin-RevId: 187562481

6 years agoAdd util which creates Python callable with tf.Variables explicitly as
Joshua V. Dillon [Fri, 2 Mar 2018 01:41:41 +0000 (17:41 -0800)]
Add util which creates Python callable with tf.Variables explicitly as
arguments.

PiperOrigin-RevId: 187561302

6 years agoCheckpointable: Make Templates Checkpointable
Allen Lavoie [Fri, 2 Mar 2018 01:37:49 +0000 (17:37 -0800)]
Checkpointable: Make Templates Checkpointable

Uses a variable_creator_scope to hook all variable creation within the
Template. For variables without a more deeply nested Template parent, it adds a
dependency directly. For variables with a Template parent, it adds a dependency
on the sub-Template instead.

The variable scope prefix for the Template itself is stripped. However, any
variable_scopes inside the Template (such as those for Layers) will be included
in the dependency names. So within Templates we essentially have name-based
saving (with the exception of dependencies between Templates themselves, which
use the object-based dependency mechanism). This isn't ideal, but will hopefully
allow migration toward object oriented dependencies more smoothly.

Throws an error on object-based save() if the dependencies don't match
between Checkpointable and .variables.

Includes a semi-related usability fix for the Checkpoint utility; mostly in
unit tests, restore() is not called before save(), which when graph building
was leading to the save counter not being initialized. Fixes that.

PiperOrigin-RevId: 187560911

6 years agoImplement partial constant propagation through IdentityN.
A. Unique TensorFlower [Fri, 2 Mar 2018 01:28:48 +0000 (17:28 -0800)]
Implement partial constant propagation through IdentityN.

PiperOrigin-RevId: 187560028

6 years agoImprove the error message when failing to write events.
Jonathan Hseu [Fri, 2 Mar 2018 01:07:20 +0000 (17:07 -0800)]
Improve the error message when failing to write events.

The current error message looks like:
"Failed to sync 10 to <path>"

PiperOrigin-RevId: 187557623

6 years agoInclude the response upon any error.
Jonathan Hseu [Fri, 2 Mar 2018 01:00:46 +0000 (17:00 -0800)]
Include the response upon any error.

PiperOrigin-RevId: 187556563

6 years agoExpose Checkpointable symbols in tf.contrib.eager/tfe
Allen Lavoie [Fri, 2 Mar 2018 00:52:07 +0000 (16:52 -0800)]
Expose Checkpointable symbols in tf.contrib.eager/tfe

- tfe.Checkpoint
    Utility for grouping Checkpointable objects into training checkpoints, has
    save/restore methods which call CheckpointableSaver.
- tfe.Checkpointable
    For user-defined Checkpointable objects.
- tfe.CheckpointableSaver
    More control over saving/restoring than tfe.Checkpoint.

Only tfe.Checkpoint is required to switch examples over, so I can leave the
others out if there are objections.

PiperOrigin-RevId: 187555472

6 years agoAdds a TensorServingInputReceiver that allows export_savedmodel to pass raw
Karmel Allison [Fri, 2 Mar 2018 00:33:26 +0000 (16:33 -0800)]
Adds a TensorServingInputReceiver that allows export_savedmodel to pass raw
tensors to model functions. Addresses #11674.

PiperOrigin-RevId: 187552824

6 years agoDo not crash if we failed to get the field name.
A. Unique TensorFlower [Fri, 2 Mar 2018 00:06:22 +0000 (16:06 -0800)]
Do not crash if we failed to get the field name.

PiperOrigin-RevId: 187549153

6 years ago[ClusterFLR] Prolong the lifetime of the RunGraphRequest until the call has completed.
Derek Murray [Fri, 2 Mar 2018 00:00:17 +0000 (16:00 -0800)]
[ClusterFLR] Prolong the lifetime of the RunGraphRequest until the call has completed.

Some WorkerService implementations rely on the request object remaining live until the callback is called.

PiperOrigin-RevId: 187548140

6 years agoFix batch_norm_benchmark.
Anna R [Thu, 1 Mar 2018 23:47:28 +0000 (15:47 -0800)]
Fix batch_norm_benchmark.

PiperOrigin-RevId: 187546384

6 years agoA fp16 implemention for ReluGrad.
Xiaoqiang Zheng [Thu, 1 Mar 2018 23:41:11 +0000 (15:41 -0800)]
A fp16 implemention for ReluGrad.
On V100 with Cuda 9, it reduces the average ReluGrad kernel time in Resnet50 from 249.44 us to
175.60 us, a 42% speedup.
On Titan-X Pascal with Cuda 9, it reduces the average ReluGrad kernel time in
Resnet50 from 747.98 us to 509.37 us, a 46.8% improvement.

PiperOrigin-RevId: 187545504

6 years agoCheckpointable: Make Model Checkpointable-compatible
Allen Lavoie [Thu, 1 Mar 2018 23:36:19 +0000 (15:36 -0800)]
Checkpointable: Make Model Checkpointable-compatible

Has Models track Checkpointable dependencies with __setattr__.

Switches subclassed Models to creating ResourceVariables by default, which
removes one source of eager/graph differences. tfe.Network was doing this by
default.

This is necessary for eager/graph agnostic code since tapes currently only work
with ResourceVariables. It's not quite trivial to fix that, and
ResourceVariables by default in more places is a Good Thing anyway. (Not that we
shouldn't also fix the tape code.)

PiperOrigin-RevId: 187544850

6 years agoAdded support for optimization of functions with fixed input/output types
Benoit Steiner [Thu, 1 Mar 2018 23:09:23 +0000 (15:09 -0800)]
Added support for optimization of functions with fixed input/output types

PiperOrigin-RevId: 187540982

6 years agoEagerTensor.device reflects the op's device and not the tensor's memory space.
Alexandre Passos [Thu, 1 Mar 2018 22:49:49 +0000 (14:49 -0800)]
EagerTensor.device reflects the op's device and not the tensor's memory space.

This matches graph mode's behavior.

PiperOrigin-RevId: 187537818

6 years agoExpose native inference latency via TFlite interpreter.
A. Unique TensorFlower [Thu, 1 Mar 2018 22:35:44 +0000 (14:35 -0800)]
Expose native inference latency via TFlite interpreter.

PiperOrigin-RevId: 187535695

6 years agoSet more generated ops to 'hidden'. These ops have not been hidden before but
Anna R [Thu, 1 Mar 2018 22:26:07 +0000 (14:26 -0800)]
Set more generated ops to 'hidden'. These ops have not been hidden before but
instead have corresponding definitions in Python files. We don't want tf_export
decorators for the generated ops since corresponding Python ops have tf_export
decorators instead.

PiperOrigin-RevId: 187534113