platform/upstream/tensorflow.git
7 years agoSupport reduction along axis NHW, HW, and C. One use case of "along NHW" is (unfused...
Yao Zhang [Sat, 6 Jan 2018 00:35:41 +0000 (16:35 -0800)]
Support reduction along axis NHW, HW, and C. One use case of "along NHW" is (unfused) batch norm. Minor code simplification for squeeze, as added transpose node has shape info now.

PiperOrigin-RevId: 180991050

7 years agoImproved the shape inference for TensorArrayGradV3
Benoit Steiner [Sat, 6 Jan 2018 00:20:20 +0000 (16:20 -0800)]
Improved the shape inference for TensorArrayGradV3

PiperOrigin-RevId: 180989529

7 years agoMake compute_output_shape public in masked core layers
A. Unique TensorFlower [Sat, 6 Jan 2018 00:09:47 +0000 (16:09 -0800)]
Make compute_output_shape public in masked core layers

PiperOrigin-RevId: 180988293

7 years agoProperly set the type of the swap nodes.
Benoit Steiner [Fri, 5 Jan 2018 23:49:41 +0000 (15:49 -0800)]
Properly set the type of the swap nodes.

PiperOrigin-RevId: 180985878

7 years agoDoes not use constants for zeros/ones.
Alexandre Passos [Fri, 5 Jan 2018 23:12:01 +0000 (15:12 -0800)]
Does not use constants for zeros/ones.

PiperOrigin-RevId: 180981378

7 years agoFixed fused batch norm performance regression.
Reed Wanderman-Milne [Fri, 5 Jan 2018 23:07:51 +0000 (15:07 -0800)]
Fixed fused batch norm performance regression.

The regression was caused by 12a4c9b8628b23cc2bf4c89c83c32760aded6124. I suspect the regression was caused by calling cudaMemset without setting the CUDA stream. Using the SetZeroFunctor (or using Eigen) handles this type of initialization for us.

Benchmarks on tf_cnn_benchmarks, on a Volta DGX1, average of 3 iterations taken, with arguments: --optimizer=sgd --staged_vars=False --num_gpus=$GPU --variable_update=$VAR_UPDATE --use_fp16=True --batch_size=128 --model=$MODEL

model       gpu  var_update        im/sec after  im/sec before  percent diff
resnet50    1    replicated        680.37333     640.10333      6.29117%
resnet50    8    parameter_server  4046.04000    1282.28667     215.53319%
resnet50    8    replicated        4157.30667    1634.22667     154.38984%
inception3  1    replicated        463.88667     440.94333      5.20324%
inception3  8    parameter_server  2655.55000    902.22333      194.33400%
inception3  8    replicated        3034.81000    1033.43667     193.66192%

PiperOrigin-RevId: 180980799

7 years agoMinor bug fix in PrefetchDataset state saving/restoring.
Saurabh Saxena [Fri, 5 Jan 2018 23:04:53 +0000 (15:04 -0800)]
Minor bug fix in PrefetchDataset state saving/restoring.

PiperOrigin-RevId: 180980476

7 years agoAutomated g4 rollback of changelist 180848930
James Qin [Fri, 5 Jan 2018 22:55:24 +0000 (14:55 -0800)]
Automated g4 rollback of changelist 180848930

PiperOrigin-RevId: 180979141

7 years agoFix typo in the docstring of `make_template`.
Akshay Agrawal [Fri, 5 Jan 2018 22:51:31 +0000 (14:51 -0800)]
Fix typo in the docstring of `make_template`.

PiperOrigin-RevId: 180978665

7 years agoFixed bad logging in iOS app tflite_simple_example.
A. Unique TensorFlower [Fri, 5 Jan 2018 22:47:01 +0000 (14:47 -0800)]
Fixed bad logging in iOS app tflite_simple_example.

PiperOrigin-RevId: 180978115

7 years agoAdd a mutex around the tfe context kernel_cache.
Alexandre Passos [Fri, 5 Jan 2018 22:40:18 +0000 (14:40 -0800)]
Add a mutex around the tfe context kernel_cache.

PiperOrigin-RevId: 180977309

7 years agoOutput variance over tree predictions for classifications.
A. Unique TensorFlower [Fri, 5 Jan 2018 22:32:31 +0000 (14:32 -0800)]
Output variance over tree predictions for classifications.

PiperOrigin-RevId: 180976319

7 years agoAdd a FlushFileSystemCaches method to Env, for flushing caches of all registered...
A. Unique TensorFlower [Fri, 5 Jan 2018 22:26:11 +0000 (14:26 -0800)]
Add a FlushFileSystemCaches method to Env, for flushing caches of all registered filesystems.

PiperOrigin-RevId: 180975443

7 years agoDon't swap out inputs that expect a reference.
Benoit Steiner [Fri, 5 Jan 2018 22:23:59 +0000 (14:23 -0800)]
Don't swap out inputs that expect a reference.

PiperOrigin-RevId: 180975132

7 years agoMove some build configs to tools/bazel.rc from configure.py
Michael Case [Fri, 5 Jan 2018 22:09:41 +0000 (14:09 -0800)]
Move some build configs to tools/bazel.rc from configure.py

Moving --config=android_arm --config=mkl and --config=monolithic
build configs into tools/bazel.rc. These options are just always
written the same way to .bazelrc when configure.py is run. This
should trim down the scope of configure.py and make it easier to
build TF without running configure.py prior.

PiperOrigin-RevId: 180973131

7 years agoImplemented memory swapping heuristics for GPU
Benoit Steiner [Fri, 5 Jan 2018 21:35:03 +0000 (13:35 -0800)]
Implemented memory swapping heuristics for GPU

PiperOrigin-RevId: 180968225

7 years agoBasic templating code.
A. Unique TensorFlower [Fri, 5 Jan 2018 20:58:00 +0000 (12:58 -0800)]
Basic templating code.

PiperOrigin-RevId: 180964100

7 years agoChange placeholder exception to log instead of throwing an exception.
Russell Power [Fri, 5 Jan 2018 20:51:39 +0000 (12:51 -0800)]
Change placeholder exception to log instead of throwing an exception.

It is difficult to remove placeholders from existing meta-graphs without breaking other structures.  As long as the placeholders do not contribute towards the loss/evaluation function they are harmless.

PiperOrigin-RevId: 180963420

7 years agoClear eager kernel cache when resetting random seed.
Alexandre Passos [Fri, 5 Jan 2018 20:38:20 +0000 (12:38 -0800)]
Clear eager kernel cache when resetting random seed.

"big hammer" required for reproducibility.

PiperOrigin-RevId: 180961787

7 years agoChange int64 to int64_t to support 64-bit compilation
Austin Anderson [Fri, 5 Jan 2018 20:02:27 +0000 (12:02 -0800)]
Change int64 to int64_t to support 64-bit compilation

PiperOrigin-RevId: 180957437

7 years agoEdit the macros to avoid trying to output stacktraces on mobile platforms.
Gunhan Gulsoy [Fri, 5 Jan 2018 19:54:42 +0000 (11:54 -0800)]
Edit the macros to avoid trying to output stacktraces on mobile platforms.

PiperOrigin-RevId: 180956594

7 years agoTemporarily disable tests until we can run them in opensource build.
A. Unique TensorFlower [Fri, 5 Jan 2018 19:45:30 +0000 (11:45 -0800)]
Temporarily disable tests until we can run them in opensource build.

PiperOrigin-RevId: 180955394

7 years agoMake it possible to wrap Layer's `call` method in `tfe.defun`.
Akshay Agrawal [Fri, 5 Jan 2018 19:41:07 +0000 (11:41 -0800)]
Make it possible to wrap Layer's `call` method in `tfe.defun`.

This change:
  (1) wraps Layer's `build` method in an `init_scope`, which in turn makes it
      possible to compile the `call` method into a graph function by wrapping
      it in `tfe.defun` because the `init_scope` lifts all ops created in
      `build` out of function-building graphs;

  (2) defers the creation of regularizers, constructing them after `build`
      exits and thereby ensuring that they are not created inside an
      `init_scope`.

PiperOrigin-RevId: 180954866

7 years agoIntroduces back a faster specialization of the unique op for cases where uniqueness...
A. Unique TensorFlower [Fri, 5 Jan 2018 19:13:07 +0000 (11:13 -0800)]
Introduces back a faster specialization of the unique op for cases where uniqueness is applied on single elements. This produces up to 3x performance improvements in the microbenchmark, which was lost when support was added for UniqueV2.

PiperOrigin-RevId: 180951153

7 years agoInternal changes to stacktrace handling.
Yusef Shafi [Fri, 5 Jan 2018 18:59:00 +0000 (10:59 -0800)]
Internal changes to stacktrace handling.

PiperOrigin-RevId: 180949246

7 years ago[TF:XLA] Correctly simplify while loops with a non-tuple root body
Sanjoy Das [Fri, 5 Jan 2018 18:55:27 +0000 (10:55 -0800)]
[TF:XLA] Correctly simplify while loops with a non-tuple root body

Explicitly bail out if the root instruction of a loop body isn't a tuple()
instruction.

PiperOrigin-RevId: 180948724

7 years agoAdded a couple of trivial tests
Benoit Steiner [Fri, 5 Jan 2018 17:58:08 +0000 (09:58 -0800)]
Added a couple of trivial tests

PiperOrigin-RevId: 180940645

7 years agoSupport reduction in NWC dimension. One use case of this is layer
Yao Zhang [Fri, 5 Jan 2018 17:39:45 +0000 (09:39 -0800)]
Support reduction in NWC dimension. One use case of this is layer
normalization.

PiperOrigin-RevId: 180938381

7 years agoFix typo in dataset performance guide
Brennan Saeta [Fri, 5 Jan 2018 17:31:50 +0000 (09:31 -0800)]
Fix typo in dataset performance guide

PiperOrigin-RevId: 180937467

7 years agoTests contrib.signal.stft with XLA compilation.
Brian Patton [Fri, 5 Jan 2018 16:59:26 +0000 (08:59 -0800)]
Tests contrib.signal.stft with XLA compilation.

PiperOrigin-RevId: 180933803

7 years agoMake SQLite veneer better
Justine Tunney [Fri, 5 Jan 2018 08:46:32 +0000 (00:46 -0800)]
Make SQLite veneer better

This iteration does a very good job following the contracts of the
actual API. Smart pointers ensure objects are destroyed in the correct
order. RAII locking and transactions are now possible, with Clang
thread safety analysis. Tuning is now done with environment variables.

PiperOrigin-RevId: 180897579

7 years agoAdd ability to dump stacktraces, and enable auto stacktrace generation to cpp
Gunhan Gulsoy [Fri, 5 Jan 2018 06:13:05 +0000 (22:13 -0800)]
Add ability to dump stacktraces, and enable auto stacktrace generation to cpp
tests.

PiperOrigin-RevId: 180889511

7 years agoAdd MNIST GAN example and benchmarks
Igor Ganichev [Fri, 5 Jan 2018 05:00:08 +0000 (21:00 -0800)]
Add MNIST GAN example and benchmarks

Training benchmark results on GPU:
batch_size                           64   128    256
training eager rate                2640  5330   7269
training graph rate                5340  7080   8380
traning eager/graph                 0.5  0.75   0.86
generating eager rate             45872 86192 142009
generating graph rate             63558 85610 104939
generating eager/graph             0.72   1.0   1.35

rate is processed/generated mnist images per second.

Eager is faster when generating because we don't need to copy "feeds"
from CPU to GPU memory.

PiperOrigin-RevId: 180885299

7 years agoRefactoring and bug-fixes for _build_initializer_expr.
A. Unique TensorFlower [Fri, 5 Jan 2018 02:53:50 +0000 (18:53 -0800)]
Refactoring and bug-fixes for _build_initializer_expr.

- Rename _build_initializer_expr to _try_guard_against_uninitialized_dependencies so as to clarify what it does.

- Avoid invoking the logic in _try_guard_against_uninitialized_dependencies for cyclic graphs. This currently results in infinite recursion which blows the stack.

- Use memoization to reduce the number of redundant operations created by _try_guard_against_uninitialized_dependencies when it encounters initial values with diamond-shaped dependencies.

- Refactoring: Remove unnecessary logic in _try_guard_against_uninitialized_dependencies for dealing with types other than Tensor or Operation. The dependency graph of a Variable's _initial_value should only ever comprise these two types.

- Refactoring: Added some filtering logic to _try_guard_against_uninitialized_dependencies to avoid initial_values with cyclic dependencies

- Refactoring: Moved the recursive traversal of initial_value`s dependencies into _safe_initial_value_from_tensor and _safe_initial_value_from_op.

- Refactoring: Made it so _find_initialized_value_for_variable will return None when it can't find the initialized_value. Currently it returns a Tensor when it finds the initialized_value and an Operation when it can't. This makes the logic in the caller a bit more consistent and explicit.

Future changes will address more of the shortcomings of _build_initializer_expr.

PiperOrigin-RevId: 180876754

7 years ago[XLA] Doc change: the invariant that GetBufferAlias is always non-empty no longer...
A. Unique TensorFlower [Fri, 5 Jan 2018 02:39:51 +0000 (18:39 -0800)]
[XLA] Doc change: the invariant that GetBufferAlias is always non-empty no longer holds.

With in-place slices, we can have:
X = slice(Y)
Where the buffer for Y has aliases {X, Y}, and the buffer for X has no aliases.
PiperOrigin-RevId: 180875794

7 years agoAdd a FlushCaches() method to the FileSystem interface, and provide an implementation...
A. Unique TensorFlower [Fri, 5 Jan 2018 02:17:49 +0000 (18:17 -0800)]
Add a FlushCaches() method to the FileSystem interface, and provide an implementation for GcsFileSystem.

PiperOrigin-RevId: 180873963

7 years agoMake HLO device placer more stable as far as created partitions goes.
A. Unique TensorFlower [Fri, 5 Jan 2018 01:57:23 +0000 (17:57 -0800)]
Make HLO device placer more stable as far as created partitions goes.
Also remove the multi-module input capability for the device placer.

PiperOrigin-RevId: 180871703

7 years ago[XLA] Expose replicas via local client API.
Chris Leary [Fri, 5 Jan 2018 01:20:45 +0000 (17:20 -0800)]
[XLA] Expose replicas via local client API.

PiperOrigin-RevId: 180868190

7 years agoAdd user friendly debugging message to TOCO.
A. Unique TensorFlower [Fri, 5 Jan 2018 00:35:44 +0000 (16:35 -0800)]
Add user friendly debugging message to TOCO.

PiperOrigin-RevId: 180863083

7 years ago[TFXLA] Handle control edges to cond not dominated.
Jacques Pienaar [Fri, 5 Jan 2018 00:32:00 +0000 (16:32 -0800)]
[TFXLA] Handle control edges to cond not dominated.

Graphs may have control dependency from outside the cond construct that
do not enter via a switch. If there is a control edge from outside then change
the edge to be a control edge onto the inserted XlaIf op instead and remove the
original control edge.

PiperOrigin-RevId: 180862658

7 years agoAdds a test exercising Atan2 via XLA client.
Brian Patton [Fri, 5 Jan 2018 00:27:23 +0000 (16:27 -0800)]
Adds a test exercising Atan2 via XLA client.

PiperOrigin-RevId: 180862094

7 years agoInclude the main TensorFlow eager header file in the binary distribution.
A. Unique TensorFlower [Fri, 5 Jan 2018 00:14:33 +0000 (16:14 -0800)]
Include the main TensorFlow eager header file in the binary distribution.

PiperOrigin-RevId: 180860461

7 years agoJava: Instructions for using GPUs via Maven.
Asim Shankar [Fri, 5 Jan 2018 00:07:05 +0000 (16:07 -0800)]
Java: Instructions for using GPUs via Maven.

GPU support in Maven is being packaged with 1.5.0-rc0 onwards
(for Linux)

Fixes #12909

PiperOrigin-RevId: 180859336

7 years agoBump the size of interleave_dataset_op_test to avoid flaky timeouts.
Gunhan Gulsoy [Thu, 4 Jan 2018 23:50:24 +0000 (15:50 -0800)]
Bump the size of interleave_dataset_op_test to avoid flaky timeouts.

PiperOrigin-RevId: 180856860

7 years agoAddresses the bug that when a grpc session is created and immediately closed, an...
Olivia Nordquist [Thu, 4 Jan 2018 23:48:10 +0000 (15:48 -0800)]
Addresses the bug that when a grpc session is created and immediately closed, an error was returned because the handle_ was still empty.  Now, it just returns Status::OK()

PiperOrigin-RevId: 180856560

7 years ago[XLA] Slightly improve a CHECK-fail message.
A. Unique TensorFlower [Thu, 4 Jan 2018 23:39:50 +0000 (15:39 -0800)]
[XLA] Slightly improve a CHECK-fail message.

PiperOrigin-RevId: 180855522

7 years agoMinimal static analysis. Resolves variable visibility and type information.
A. Unique TensorFlower [Thu, 4 Jan 2018 23:32:36 +0000 (15:32 -0800)]
Minimal static analysis. Resolves variable visibility and type information.

PiperOrigin-RevId: 180854642

7 years agoMake layer method `compute_output_shape` public.
Francois Chollet [Thu, 4 Jan 2018 23:28:49 +0000 (15:28 -0800)]
Make layer method `compute_output_shape` public.

Motivations:
- Useful for computing the shape of a layer's output without calling the layer.
- It is public in standalone keras (hence API discrepancy, which is something to be avoided).
- With eager mode and deferred mode for Network building, it is going to be increasingly necessary for users to implement this method or call it.
- Lots of internal users are apparently already relying on it, which highlights the importance of making this feature publicly available.
PiperOrigin-RevId: 180854139

7 years ago[tf.data] Add benchmarks for variants of slice/batch/repeat pipelines.
Derek Murray [Thu, 4 Jan 2018 23:26:58 +0000 (15:26 -0800)]
[tf.data] Add benchmarks for variants of slice/batch/repeat pipelines.

These pipelines are typically very simple, and magnify the effect of
TensorFlow and `tf.data` overheads. Tracking them continuously will
help to evaluate performance improvements, with a view to addressing
issue #15694.

Representative measurements from my workstation:

tensorflow/python/data/kernel_tests/dataset_constructor_op_test.py:

* Dataset.from_tensor_slices().repeat().batch() with Session.run(): 155 ms/element
* Dataset.from_tensor_slices().repeat().batch() with Session.make_callable(): 91 ms/element
* Dataset.from_tensor_slices(numpy.reshape(.)).repeat() with Session.make_callable(): 44 ms/element
* Dataset.from_tensor_slices().batch().cache().repeat() with Session.make_callable(): 43 ms/element

tensorflow/contrib/eager/python/datasets_test.py:

* Dataset.from_tensor_slices().repeat().batch() with tfe.Iterator(): 102 ms/element
* Dataset.from_tensor_slices().batch().cache().repeat() with tfe.Iterator(): 53 ms/element

PiperOrigin-RevId: 180853890

7 years agoMake 403 errors due to GCS more verbose.
A. Unique TensorFlower [Thu, 4 Jan 2018 23:23:23 +0000 (15:23 -0800)]
Make 403 errors due to GCS more verbose.

The current GCS client code neglects to print the nature of a 403 error. For
example, a 403 error can occur because of permissions or rate limiting. The
nature of a 403 error is communicated through the HTTP response. Thus, this
patch extends the 403 error message with the HTTP response returned by curl.

As an example, a 403 error looked like this before this patch:
PermissionDeniedError: Error executing an HTTP request (HTTP response code 403, error code 0, error message '')

With this patch, it might look like:
PermissionDeniedError: Error executing an HTTP request (HTTP response code 403, error code 0, error message ''), response {
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "userRateLimitExceeded",
    "message": "User Rate Limit Exceeded"
   }
  ],
  "code": 403,
  "message": "User Rate Limit Exceeded"
 }
}
PiperOrigin-RevId: 180853399

7 years ago[TF:XLA] Bump open source llvm revision to r321819
Sanjoy Das [Thu, 4 Jan 2018 23:21:42 +0000 (15:21 -0800)]
[TF:XLA] Bump open source llvm revision to r321819

PiperOrigin-RevId: 180853184

7 years agoAdd `FunctionLibraryRuntime::InstantiateOptions` struct.
Derek Murray [Thu, 4 Jan 2018 22:48:09 +0000 (14:48 -0800)]
Add `FunctionLibraryRuntime::InstantiateOptions` struct.

This new struct allows optional arguments to be passed to the
`FunctionLibraryRuntime::Instantiate()` API. The new struct is now
used to configure the target device for a function instantiation
(instead of an attr).

PiperOrigin-RevId: 180848930

7 years agoFix bug causing OOM failure. An output parameter was not assigned in the failure...
A. Unique TensorFlower [Thu, 4 Jan 2018 22:38:55 +0000 (14:38 -0800)]
Fix bug causing OOM failure. An output parameter was not assigned in the failure path of GcsFileSystem::LoadBufferFromGCS(). The fix always zeroes the output parameter, and it also changes the consumer of this API so that the output value is only used when the return Status == OK.

PiperOrigin-RevId: 180847708

7 years agoAutomated g4 rollback of changelist 180821956
Derek Murray [Thu, 4 Jan 2018 22:13:22 +0000 (14:13 -0800)]
Automated g4 rollback of changelist 180821956

PiperOrigin-RevId: 180844126

7 years agoNo public change
A. Unique TensorFlower [Thu, 4 Jan 2018 22:02:57 +0000 (14:02 -0800)]
No public change

PiperOrigin-RevId: 180842567

7 years agoFixed the implementation of DataTypeString to avoid a stack overflow when
Benoit Steiner [Thu, 4 Jan 2018 21:42:13 +0000 (13:42 -0800)]
Fixed the implementation of DataTypeString to avoid a stack overflow when
processing invalid types

PiperOrigin-RevId: 180839917

7 years agoChange topk error message to say how many columns existed and how many were requested.
A. Unique TensorFlower [Thu, 4 Jan 2018 20:49:11 +0000 (12:49 -0800)]
Change topk error message to say how many columns existed and how many were requested.

PiperOrigin-RevId: 180833442

7 years agoExpand all saveable operations to generate a single C++ restore call.
Russell Power [Thu, 4 Jan 2018 20:02:14 +0000 (12:02 -0800)]
Expand all saveable operations to generate a single C++ restore call.

This allows us to avoid repeated index lookups and perform a sequential scan of the index in the common case where we are doing a full restore, or a restore from a sub-model.  It also dramatically reduces excessive restore parallelism.

Testing with a checkpoint with 1000 100x100 tensors, restoring from CNS drops from ~1m to ~5 seconds.

PiperOrigin-RevId: 180827583

7 years agoAutomated g4 rollback of changelist 179552496
HyoukJoong Lee [Thu, 4 Jan 2018 19:45:18 +0000 (11:45 -0800)]
Automated g4 rollback of changelist 179552496

PiperOrigin-RevId: 180825516

7 years agoadding tests to make sure that the public methods that could either call C-API or...
Olivia Nordquist [Thu, 4 Jan 2018 19:17:19 +0000 (11:17 -0800)]
adding tests to make sure that the public methods that could either call C-API or python API are returning the same types--mostly the string and unicode types.

PiperOrigin-RevId: 180821956

7 years agoClarify confusing documentation regarding FinalBeamSearchDecoderOutput.
Adam Roberts [Thu, 4 Jan 2018 19:04:10 +0000 (11:04 -0800)]
Clarify confusing documentation regarding FinalBeamSearchDecoderOutput.

PiperOrigin-RevId: 180820115

7 years agoCorrect mention of channel ordering (we support NHWC only)
Andrew Selle [Thu, 4 Jan 2018 18:54:44 +0000 (10:54 -0800)]
Correct mention of channel ordering (we support NHWC only)

PiperOrigin-RevId: 180818654

7 years agoJava: Package GPU native libraries in Maven.
Asim Shankar [Thu, 4 Jan 2018 18:40:00 +0000 (10:40 -0800)]
Java: Package GPU native libraries in Maven.

And update version to 1.5.0-rc0.
Starting with 1.5.0-rc0, it will be possible to use GPUs from TensorFlow Java
programs by adding the following to the application's pom.xml:

<dependency>
  <groupId>org.tensorflow</groupId>
  <artifactId>libtensorflow</artifactId>
  <version>1.5.0-rc0</version>
</dependency>
<dependency>
  <groupId>org.tensorflow</groupId>
  <artifactId>libtensorflow_jni_gpu</artifactId>
  <version>1.5.0-rc0</version>
</dependency>

Updates #12909

PiperOrigin-RevId: 180816468

7 years agoExpand error-message when a valid export is not found at the specified export locatio...
Sukriti Ramesh [Thu, 4 Jan 2018 18:24:33 +0000 (10:24 -0800)]
Expand error-message when a valid export is not found at the specified export location in bundle-shim.

PiperOrigin-RevId: 180814251

7 years agoAdds the lookup_config property to the _WeightedSparseColumn class.
A. Unique TensorFlower [Thu, 4 Jan 2018 18:03:50 +0000 (10:03 -0800)]
Adds the lookup_config property to the _WeightedSparseColumn class.

PiperOrigin-RevId: 180811282

7 years agoEnsure decode_raw on an empty string returns an empty tensor.
A. Unique TensorFlower [Thu, 4 Jan 2018 17:51:00 +0000 (09:51 -0800)]
Ensure decode_raw on an empty string returns an empty tensor.

PiperOrigin-RevId: 180809736

7 years agoSupport scalar and vector condition for select.
Yao Zhang [Thu, 4 Jan 2018 17:45:53 +0000 (09:45 -0800)]
Support scalar and vector condition for select.

PiperOrigin-RevId: 180809175

7 years agoAllowing override of common_env.sh python directory.
Amit Patankar [Thu, 4 Jan 2018 17:19:05 +0000 (09:19 -0800)]
Allowing override of common_env.sh python directory.

PiperOrigin-RevId: 180806246

7 years agoCurrently LayoutAssignment only deals with a module at a time and
A. Unique TensorFlower [Thu, 4 Jan 2018 09:47:01 +0000 (01:47 -0800)]
Currently LayoutAssignment only deals with a module at a time and
knows nothing about other modules. Therefore, sends and recvs are
given a default layout to ensure that the layout is the same across
all communicating modules.

This CL adds a ChannelLayoutConstraints object which can be passed
into LayoutAssignment. When a send or recv is layed out, its chosen
layout is saved into the ChannelLayoutConstraints. When, later,
another instruction is seen in a different module that uses the same
communicating channel ID, the layout is constrained to be the same as
in the previous module.

PiperOrigin-RevId: 180771799

7 years agoInternal change
A. Unique TensorFlower [Thu, 4 Jan 2018 07:59:58 +0000 (23:59 -0800)]
Internal change

PiperOrigin-RevId: 180762948

7 years agoSupport reduction and histogram summary ops.
Yao Zhang [Thu, 4 Jan 2018 05:43:21 +0000 (21:43 -0800)]
Support reduction and histogram summary ops.

PiperOrigin-RevId: 180755908

7 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Thu, 4 Jan 2018 05:16:47 +0000 (21:16 -0800)]
Go: Update generated wrapper functions for TensorFlow ops.

PiperOrigin-RevId: 180754374

7 years ago[XLA:CPU] Count cycles in non-entry computations
Sanjoy Das [Thu, 4 Jan 2018 04:13:15 +0000 (20:13 -0800)]
[XLA:CPU] Count cycles in non-entry computations

This change teaches XLA to maintain cycle counters specifically for non-entry
computations, like computations representing the body of a While.  Without this
change, instructions in such non-entry computations are noted as taking 0.00% of
their execution time which isn't ideal.

Implementation-wise, this just falls out of uniformly using a
std::unordered_map<T, int64> for both the HloInstruction->ProfileIndex and the
HloComputation->ProfileIndex mappings.
PiperOrigin-RevId: 180750463

7 years agoMade the shape of the elements stored in a TensorArrayV3 available to shape inference.
Benoit Steiner [Thu, 4 Jan 2018 04:09:22 +0000 (20:09 -0800)]
Made the shape of the elements stored in a TensorArrayV3 available to shape inference.

PiperOrigin-RevId: 180750305

7 years ago[XLA:python] Plumb Python exceptions through API instead of OrDie'ing.
Chris Leary [Thu, 4 Jan 2018 04:00:42 +0000 (20:00 -0800)]
[XLA:python] Plumb Python exceptions through API instead of OrDie'ing.

PiperOrigin-RevId: 180749642

7 years agotfdbg: add option to disable sending of traceback and source code
Shanqing Cai [Thu, 4 Jan 2018 03:46:48 +0000 (19:46 -0800)]
tfdbg: add option to disable sending of traceback and source code

from TF runtime to debug server, using
TensorBoardDebugWrapperSession and TensorBoardDebugHook.

PiperOrigin-RevId: 180748754

7 years agoAutomated g4 rollback of changelist 180738639
Eugene Brevdo [Thu, 4 Jan 2018 03:30:45 +0000 (19:30 -0800)]
Automated g4 rollback of changelist 180738639

PiperOrigin-RevId: 180747698

7 years ago[XLA] Fix xla_data.proto for protoc
David Majnemer [Thu, 4 Jan 2018 03:27:19 +0000 (19:27 -0800)]
[XLA] Fix xla_data.proto for protoc

The "reserved" keyword doesn't work in enumerations, replace it with a comment.

PiperOrigin-RevId: 180747499

7 years agoMerge changes from github.
Raghuraman Krishnamoorthi [Thu, 4 Jan 2018 03:06:54 +0000 (19:06 -0800)]
Merge changes from github.

PiperOrigin-RevId: 180746153

7 years agoSupport begin and end mask for strided slice.
Yao Zhang [Thu, 4 Jan 2018 02:38:12 +0000 (18:38 -0800)]
Support begin and end mask for strided slice.

PiperOrigin-RevId: 180744498

7 years ago[XLA:CPU] Cleanups to VectorSupportLibrary, TargetMachineFeatures and DotOpEmitter
Sanjoy Das [Thu, 4 Jan 2018 01:48:27 +0000 (17:48 -0800)]
[XLA:CPU] Cleanups to VectorSupportLibrary, TargetMachineFeatures and DotOpEmitter

 - Move VectorSupportLibrary to under service/cpu since it is specific to the
   CPU backend.
 - Use TargetMachineFeatures to infer the vector width in DotOpEmitter
 - Move the kAvxVectorSize magic constant into TargetMachineFeatures

PiperOrigin-RevId: 180740693

7 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Thu, 4 Jan 2018 01:31:11 +0000 (17:31 -0800)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 180739249

7 years agoAutomated g4 rollback of changelist 180733901
A. Unique TensorFlower [Thu, 4 Jan 2018 01:23:54 +0000 (17:23 -0800)]
Automated g4 rollback of changelist 180733901

PiperOrigin-RevId: 180738639

7 years agoAdd critical section resource and op that allows execution within the critical
Eugene Brevdo [Thu, 4 Jan 2018 00:36:42 +0000 (16:36 -0800)]
Add critical section resource and op that allows execution within the critical
section.

This op (not in the public API yet) allows exclusive access to certain resources
by bottlenecking subgraph access to run within a serialized critical section.

PiperOrigin-RevId: 180733901

7 years agoMake init_scope install a new graph when graph stack is empty in graph mode.
Akshay Agrawal [Thu, 4 Jan 2018 00:10:36 +0000 (16:10 -0800)]
Make init_scope install a new graph when graph stack is empty in graph mode.

Prior to this change, entering an init_scope while in graph mode with an empty
graph stack would enable eager execution, if eager execution had previously
been enabled; this wasn't the desired behavior.

PiperOrigin-RevId: 180730994

7 years agoFix bug with imported while loops with C API enabled.
Skye Wanderman-Milne [Thu, 4 Jan 2018 00:08:49 +0000 (16:08 -0800)]
Fix bug with imported while loops with C API enabled.

Specifically, make control_flow_util.GetOutputContext robust to
imported exit nodes (which don't have control flow contexts). This was
a bug prior to the C API being enabled in that imported exit nodes
would not have contexts, but it happened to not be exposed. Note that
importing a metagraph will add the contexts back after doing the
initial import, but there's still a window where no contexts are
assigned.

PiperOrigin-RevId: 180730785

7 years agoUpdate RNN/LSTM performance docs
A. Unique TensorFlower [Thu, 4 Jan 2018 00:06:24 +0000 (16:06 -0800)]
Update RNN/LSTM performance docs

PiperOrigin-RevId: 180730491

7 years agoRun C++ control flow validation on FunctionDefs before running.
Skye Wanderman-Milne [Wed, 3 Jan 2018 23:40:03 +0000 (15:40 -0800)]
Run C++ control flow validation on FunctionDefs before running.

Clients should ideally prevent such functions from being created in
the first place, but we still want the runtime to be robust to
malformed functions. Trying to run functions with invalid control flow
constructs can result in crashes or hangs, so we want to catch it
before running.

PiperOrigin-RevId: 180727589

7 years ago[XLA] Remove RNG_BERNOULLI
David Majnemer [Wed, 3 Jan 2018 23:34:01 +0000 (15:34 -0800)]
[XLA] Remove RNG_BERNOULLI

RNG_BERNOULLI is easy to compose out of other operations and appears to provide
no real benefit. Let's remove it.

PiperOrigin-RevId: 180726889

7 years agoFix tf.nn.fractional_max_pool output have same batch size when feed with different...
A. Unique TensorFlower [Wed, 3 Jan 2018 23:10:58 +0000 (15:10 -0800)]
Fix tf.nn.fractional_max_pool output have same batch size when feed with different input batch size. Fixes #14985.

PiperOrigin-RevId: 180724096

7 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Wed, 3 Jan 2018 22:49:36 +0000 (14:49 -0800)]
Go: Update generated wrapper functions for TensorFlow ops.

PiperOrigin-RevId: 180721390

7 years ago[XLA] Remove a false invariant used in generating test inputs.
Nick Desaulniers [Wed, 3 Jan 2018 22:19:25 +0000 (14:19 -0800)]
[XLA] Remove a false invariant used in generating test inputs.

This invariant is incorrect; the parameter will never be the shape of the use's
first operand; in fact the param should match operand(1)'s shape for
DynamicSlice and operand(2)'s shape for DynamicUpdateSlice (since start_indices is the argument that we are trying to constrain the bounds for).  This is checked
for in CreateLiteralForConstrainedUses().

PiperOrigin-RevId: 180717508

7 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Wed, 3 Jan 2018 20:42:19 +0000 (12:42 -0800)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 180705266

7 years agoBoilerplate: port a subset of the anno and quoting packages from Tangent. Also includ...
A. Unique TensorFlower [Wed, 3 Jan 2018 19:47:12 +0000 (11:47 -0800)]
Boilerplate: port a subset of the anno and quoting packages from Tangent. Also includes a pretty printer API.

PiperOrigin-RevId: 180698491

7 years agoAutomated g4 rollback of changelist 180670333
Anna R [Wed, 3 Jan 2018 19:00:21 +0000 (11:00 -0800)]
Automated g4 rollback of changelist 180670333

PiperOrigin-RevId: 180691955

7 years agoSet application_id and user_version on TensorBoard DB
Justine Tunney [Wed, 3 Jan 2018 18:34:01 +0000 (10:34 -0800)]
Set application_id and user_version on TensorBoard DB

Formatting was also cleaned up, without making any schema or
documentation changes.

PiperOrigin-RevId: 180688094

7 years agoGo: Update generated wrapper functions for TensorFlow ops.
A. Unique TensorFlower [Wed, 3 Jan 2018 17:29:24 +0000 (09:29 -0800)]
Go: Update generated wrapper functions for TensorFlow ops.

PiperOrigin-RevId: 180679688

7 years agoUpdate ops-related pbtxt files.
A. Unique TensorFlower [Wed, 3 Jan 2018 17:08:02 +0000 (09:08 -0800)]
Update ops-related pbtxt files.

PiperOrigin-RevId: 180677538

7 years agoAdd Snappy support to SQLite
Justine Tunney [Wed, 3 Jan 2018 16:22:37 +0000 (08:22 -0800)]
Add Snappy support to SQLite

This change also puts the necessary build infrastructure in place so we can
continue to build many proper lightweight SQLite extensions in the future that
are easy for users to copy over into their own environments, so they can
readily access their data.

PiperOrigin-RevId: 180673039

7 years agoK-FAC: Add "OnehotCategoricalLogitsNegativeLogProbLoss" to kfac.loss_functions_lib...
A. Unique TensorFlower [Wed, 3 Jan 2018 16:18:13 +0000 (08:18 -0800)]
K-FAC: Add "OnehotCategoricalLogitsNegativeLogProbLoss" to kfac.loss_functions_lib._allowed_symbols.

PiperOrigin-RevId: 180672608