platform/upstream/tensorflow.git
6 years agocomment typo (#19381)
Qing ZHao [Sat, 19 May 2018 14:45:29 +0000 (22:45 +0800)]
comment typo (#19381)

6 years agoMerge pull request #19409 from zheng-xq/branch_197218170
Gunhan Gulsoy [Sat, 19 May 2018 03:30:46 +0000 (20:30 -0700)]
Merge pull request #19409 from zheng-xq/branch_197218170

Branch 197218170

6 years agoMerge pull request #19408 from annarev/add_more_missing_deps
annarev [Sat, 19 May 2018 02:10:04 +0000 (19:10 -0700)]
Merge pull request #19408 from annarev/add_more_missing_deps

Add missing dependencies to test_lite_main

6 years agoMerge commit for internal changes
zhengxq [Sat, 19 May 2018 00:05:40 +0000 (17:05 -0700)]
Merge commit for internal changes

6 years agoMerge pull request #19338 from girving/clip
Xiaoqiang Zheng [Fri, 18 May 2018 23:37:27 +0000 (16:37 -0700)]
Merge pull request #19338 from girving/clip

Make tf.clip_by_value not crash on empty tensors

6 years agoAutomated g4 rollback of changelist 197070234
Igor Saprykin [Fri, 18 May 2018 23:33:19 +0000 (16:33 -0700)]
Automated g4 rollback of changelist 197070234

PiperOrigin-RevId: 197218170

6 years agoImprove import error messages.
A. Unique TensorFlower [Fri, 18 May 2018 23:28:59 +0000 (16:28 -0700)]
Improve import error messages.

PiperOrigin-RevId: 197217638

6 years agoAdd missing dependencies to test_lite_main
Anna R [Fri, 18 May 2018 23:11:30 +0000 (16:11 -0700)]
Add missing dependencies to test_lite_main

6 years agoSkip tests that require unavailable hardware when not using DistributionStrategy
Igor Saprykin [Fri, 18 May 2018 22:49:01 +0000 (15:49 -0700)]
Skip tests that require unavailable hardware when not using DistributionStrategy

Right now combinations.py skips tests that do not have the hardware that's
requried by the DistributionStrategy instance that is used in that test.  After
this change, the user can trigger such a behavior even when they are not using
DistributionStrategy.

Two new special arguments are added: "required_tpu" and "required_gpus".

PiperOrigin-RevId: 197212466

6 years agoMerge pull request #19404 from yifeif/distributed
Yifei Feng [Fri, 18 May 2018 22:43:30 +0000 (15:43 -0700)]
Merge pull request #19404 from yifeif/distributed

Make distributed_test use tf-nightly by default.

6 years agoCorrect dtype in resource_strided_slice_assign
Alexandre Passos [Fri, 18 May 2018 22:33:00 +0000 (15:33 -0700)]
Correct dtype in resource_strided_slice_assign

PiperOrigin-RevId: 197210273

6 years agoRemove unused BUILD dependencies
A. Unique TensorFlower [Fri, 18 May 2018 22:15:06 +0000 (15:15 -0700)]
Remove unused BUILD dependencies

PiperOrigin-RevId: 197207799

6 years agoFixed an issue when add context into params.
Jianwei Xie [Fri, 18 May 2018 21:59:01 +0000 (14:59 -0700)]
Fixed an issue when add context into params.

PiperOrigin-RevId: 197205327

6 years agoMake distributed_test use tf-nightly by default.
Yifei Feng [Fri, 18 May 2018 21:25:59 +0000 (14:25 -0700)]
Make distributed_test use tf-nightly by default.

6 years agoAdding back abi and stacktrace dependencies to stacktrace_handler (#19401)
annarev [Fri, 18 May 2018 21:12:26 +0000 (14:12 -0700)]
Adding back abi and stacktrace dependencies to stacktrace_handler (#19401)

6 years agoRevert a change to fix TFLite iOS demo app.
Yu-Cheng Ling [Fri, 18 May 2018 20:12:41 +0000 (13:12 -0700)]
Revert a change to fix TFLite iOS demo app.
It depends on released CocoaPod.

PiperOrigin-RevId: 197189734

6 years agoThe quantizer should match the patterns for partition variables.
Suharsh Sivakumar [Fri, 18 May 2018 20:07:18 +0000 (13:07 -0700)]
The quantizer should match the patterns for partition variables.

PiperOrigin-RevId: 197189118

6 years ago[dataset]: Remove extra `repeat` in the docstring for `shard`.
A. Unique TensorFlower [Fri, 18 May 2018 19:41:20 +0000 (12:41 -0700)]
[dataset]: Remove extra `repeat` in the docstring for `shard`.

PiperOrigin-RevId: 197185877

6 years ago[TF:XLA] Delete the reverseDFS scheduler. With recent improvements to the List schedu...
Dimitris Vardoulakis [Fri, 18 May 2018 19:24:20 +0000 (12:24 -0700)]
[TF:XLA] Delete the reverseDFS scheduler. With recent improvements to the List scheduler, reverseDFS is no longer needed.

PiperOrigin-RevId: 197183727

6 years agoExpose read-only versions of input tensors in tflite.
A. Unique TensorFlower [Fri, 18 May 2018 19:21:44 +0000 (12:21 -0700)]
Expose read-only versions of input tensors in tflite.

PiperOrigin-RevId: 197183345

6 years agoEnable `SeedStream` construction from other `SeedStream` instances.
Joshua V. Dillon [Fri, 18 May 2018 19:17:05 +0000 (12:17 -0700)]
Enable `SeedStream` construction from other `SeedStream` instances.

PiperOrigin-RevId: 197182686

6 years agoAdd eager tests for automatic tensor flattening
Igor Ganichev [Fri, 18 May 2018 19:14:47 +0000 (12:14 -0700)]
Add eager tests for automatic tensor flattening

PiperOrigin-RevId: 197182339

6 years agoAdd an in-memory evaluator for Estimator. It will run evaluation without a checkpoint...
Mustafa Ispir [Fri, 18 May 2018 19:09:55 +0000 (12:09 -0700)]
Add an in-memory evaluator for Estimator. It will run evaluation without a checkpoint. This will let user get evaluation metrics on more steps without saving.

  Example:

  ```python
  def train_input_fn():
    ...
    return train_dataset

  def eval_input_fn():
    ...
    return eval_dataset

  estimator = tf.estimator.DNNClassifier(...)

  evaluator = tf.contrib.estimator.InMemoryEvaluatorHook(
      estimator, eval_input_fn)
  estimator.train(train_input_fn, hooks=[evaluator])
  ```

PiperOrigin-RevId: 197181726

6 years agoWhen converting an unsupported op in TOCO, we can possibly infer the output type...
A. Unique TensorFlower [Fri, 18 May 2018 19:08:32 +0000 (12:08 -0700)]
When converting an unsupported op in TOCO, we can possibly infer the output type from an attribute named Tout (this works, e.g., for RandomUniformInt).

PiperOrigin-RevId: 197181552

6 years ago[TF:XLA] Bump open source llvm revision to r332697
Sanjoy Das [Fri, 18 May 2018 18:56:28 +0000 (11:56 -0700)]
[TF:XLA] Bump open source llvm revision to r332697

PiperOrigin-RevId: 197179581

6 years agoboosted_trees: allow labels to have rank 1 as other estimators.
Younghee Kwon [Fri, 18 May 2018 18:46:54 +0000 (11:46 -0700)]
boosted_trees: allow labels to have rank 1 as other estimators.

PiperOrigin-RevId: 197178169

6 years ago[TF:XLA] Remove underscore prefix from XlaLaunch operator.
Peter Hawkins [Fri, 18 May 2018 18:43:25 +0000 (11:43 -0700)]
[TF:XLA] Remove underscore prefix from XlaLaunch operator.
Minor fixes to comments.

PiperOrigin-RevId: 197177582

6 years agoValidate the file signatures before issusing a content read in GCS. Remove the
Ruoxin Sang [Fri, 18 May 2018 18:28:18 +0000 (11:28 -0700)]
Validate the file signatures before issusing a content read in GCS. Remove the
checkpoint hack. Enable the stat cache by default, as the block cache has
already been enabled by default. Set the default stat cache max_age to 5s,
which is the same in the Cloud TPU server.

PiperOrigin-RevId: 197175258

6 years agoAutomated g4 rollback of changelist 197118212
A. Unique TensorFlower [Fri, 18 May 2018 17:42:50 +0000 (10:42 -0700)]
Automated g4 rollback of changelist 197118212

PiperOrigin-RevId: 197167501

6 years agoOp version: Populate version in Toco TFLite exporter
Yu-Cheng Ling [Fri, 18 May 2018 17:39:45 +0000 (10:39 -0700)]
Op version: Populate version in Toco TFLite exporter

PiperOrigin-RevId: 197166962

6 years ago[TF:XLA] Allow the HloEvaluator to be changed for the HLO interpreter.
Nick Desaulniers [Fri, 18 May 2018 17:23:34 +0000 (10:23 -0700)]
[TF:XLA] Allow the HloEvaluator to be changed for the HLO interpreter.

PiperOrigin-RevId: 197164443

6 years ago[tf.data] Changed internal implementation of `make_csv_dataset`, and removed argument...
Rachel Lim [Fri, 18 May 2018 17:21:59 +0000 (10:21 -0700)]
[tf.data] Changed internal implementation of `make_csv_dataset`, and removed arguments `default_float_type` and `comment` from `make_csv_dataset`

PiperOrigin-RevId: 197164167

6 years agoImprove TFLite generated example test speed.
Yu-Cheng Ling [Fri, 18 May 2018 17:12:37 +0000 (10:12 -0700)]
Improve TFLite generated example test speed.

PiperOrigin-RevId: 197162686

6 years agoUpdate the docstring on function.Defun to reflect current graph/session freezing...
Brian Patton [Fri, 18 May 2018 15:38:40 +0000 (08:38 -0700)]
Update the docstring on function.Defun to reflect current graph/session freezing behavior.

PiperOrigin-RevId: 197150790

6 years agoRestructure BUILD rules to be modularly correct
A. Unique TensorFlower [Fri, 18 May 2018 14:52:32 +0000 (07:52 -0700)]
Restructure BUILD rules to be modularly correct

PiperOrigin-RevId: 197145545

6 years agoMark link-time dependency library as alwayslink=1.
A. Unique TensorFlower [Fri, 18 May 2018 14:49:06 +0000 (07:49 -0700)]
Mark link-time dependency library as alwayslink=1.

PiperOrigin-RevId: 197145205

6 years agoMerge pull request #18240 from Intel-tensorflow/ashraf/direct_session_bugfix
Tatiana Shpeisman [Fri, 18 May 2018 14:50:54 +0000 (07:50 -0700)]
Merge pull request #18240 from Intel-tensorflow/ashraf/direct_session_bugfix

INTEL MKL:  Fixing a unit test failure, for direct session memory allocation

6 years agoModify PadInsertion pass so that it matches other passes.
A. Unique TensorFlower [Fri, 18 May 2018 14:47:41 +0000 (07:47 -0700)]
Modify PadInsertion pass so that it matches other passes.

Currently, PadInsertion only iterates over the instructions in the
entry_computation. Other passes iterate over MakeNonfusionComputations.
When we run on HloSnapshots derived from TPU benchmarks, this makes a
difference, because it seems none of the convolutions are inside the entry
computation.

PiperOrigin-RevId: 197145067

6 years agoDropping support for CUDA < 8.
A. Unique TensorFlower [Fri, 18 May 2018 13:31:20 +0000 (06:31 -0700)]
Dropping support for CUDA < 8.

PiperOrigin-RevId: 197137612

6 years agoExtracts the following optimizations into methods:
A. Unique TensorFlower [Fri, 18 May 2018 13:27:13 +0000 (06:27 -0700)]
Extracts the following optimizations into methods:

SimplifyArithmeticOperations
ReduceDivToReciprocalMul

PiperOrigin-RevId: 197137281

6 years agoUpdate downloadable clang to a new revision
Ilya Biryukov [Fri, 18 May 2018 10:14:27 +0000 (03:14 -0700)]
Update downloadable clang to a new revision

PiperOrigin-RevId: 197121447

6 years agoDropping support for cuDNN < 6.
A. Unique TensorFlower [Fri, 18 May 2018 09:37:52 +0000 (02:37 -0700)]
Dropping support for cuDNN < 6.
Enable CUDNN_FFT_TILING_FORWARD for cuDNN >= 7.

PiperOrigin-RevId: 197118212

6 years agoMove Keras code out of _impl folder and remove API files.
Pavithra Vijay [Fri, 18 May 2018 04:36:39 +0000 (21:36 -0700)]
Move Keras code out of _impl folder and remove API files.

PiperOrigin-RevId: 197097430

6 years ago[XLA] Clamp indices in DynamicSlice and DynamicUpdateSlice instead of wrapping.
Michael Kuperstein [Fri, 18 May 2018 01:09:45 +0000 (18:09 -0700)]
[XLA] Clamp indices in DynamicSlice and DynamicUpdateSlice instead of wrapping.

This implements the following index clamping in all backends (CPU, GPU, Interpreter):

for(int i = 0; i < rank; ++i)
  start_index[i] = clamp(start_index[i], 0, output_dim_size[i] - update_dim_size[i])

Which ensures the slice (or update region) is always inbounds w.r.t the input.

PiperOrigin-RevId: 197082276

6 years agoHandle HloInstruction::ToString() when literal is missing.
A. Unique TensorFlower [Fri, 18 May 2018 00:40:47 +0000 (17:40 -0700)]
Handle HloInstruction::ToString() when literal is missing.

PiperOrigin-RevId: 197079144

6 years agomarkdown fixes
Mark Daoust [Fri, 18 May 2018 00:25:47 +0000 (17:25 -0700)]
markdown fixes

PiperOrigin-RevId: 197077588

6 years agoDo not force default layout when there is no need to.
A. Unique TensorFlower [Fri, 18 May 2018 00:11:47 +0000 (17:11 -0700)]
Do not force default layout when there is no need to.
Allow the inner computations to negotiate a root and parameter layouts different from default.
END_PUBLIC

RELNOTES: n/a

---------------------
BEGIN_PUBLIC
Automated g4 rollback of changelist 194293187

PiperOrigin-RevId: 197076025

6 years agoMerge pull request #19355 from tensorflow/mrry-patch-2
Martin Wicke [Fri, 18 May 2018 00:06:37 +0000 (17:06 -0700)]
Merge pull request #19355 from tensorflow/mrry-patch-2

Include <algorithm> in .pb_text.cc generated files

6 years ago Add NCHW_VECT_W tensor format.
A. Unique TensorFlower [Thu, 17 May 2018 23:59:50 +0000 (16:59 -0700)]
  Add NCHW_VECT_W tensor format.

PiperOrigin-RevId: 197074411

6 years agoEnable optimizations submitted during pre-NIPS freeze:
A. Unique TensorFlower [Thu, 17 May 2018 23:52:31 +0000 (16:52 -0700)]
Enable optimizations submitted during pre-NIPS freeze:
  * Snapshot to Identity promotion.
  * Removal of transposes pairs separated by chain.

PiperOrigin-RevId: 197073602

6 years agoboosted_trees: fixed the crash when eval/prediction is attempted with the initial...
Younghee Kwon [Thu, 17 May 2018 23:52:17 +0000 (16:52 -0700)]
boosted_trees: fixed the crash when eval/prediction is attempted with the initial checkpoints (at step 0) before training.

PiperOrigin-RevId: 197073582

6 years agoMisc changes found when debugging an unrelated problem.
Akshay Modi [Thu, 17 May 2018 23:52:07 +0000 (16:52 -0700)]
Misc changes found when debugging an unrelated problem.

- (pywrap_tfe.i) Improve error message for better debugging TFE_Py_Execute failures.
- (pywrap_tfe_src.cc) Accept _value of None
- (base.i) Remove unnecessary temporary

PiperOrigin-RevId: 197073571

6 years agoMake V1 metrics distributed-aware. Also fix a bug where assertAllClose
A. Unique TensorFlower [Thu, 17 May 2018 23:26:24 +0000 (16:26 -0700)]
Make V1 metrics distributed-aware. Also fix a bug where assertAllClose
was sometimes ignoring its `msg` parameter.

PiperOrigin-RevId: 197070234

6 years ago[XLA] Redesign: delete xla::Computation.
A. Unique TensorFlower [Thu, 17 May 2018 23:23:33 +0000 (16:23 -0700)]
[XLA] Redesign: delete xla::Computation.

PiperOrigin-RevId: 197069851

6 years agoDon't add branch prediction hints when compiling under nvcc.
Craig Citro [Thu, 17 May 2018 23:06:21 +0000 (16:06 -0700)]
Don't add branch prediction hints when compiling under nvcc.

As seen in #19203, the `__builtin_expect` compiler builtin isn't recognized as
a builtin in nvcc8, leading to compilation failures of the form

    ./tensorflow/core/kernels/gather_functor_gpu.cu.h(57): error: calling a __host__ function("__builtin_
expect") from a __global__ function("tensorflow::GatherOpKernel< ::Eigen::half, int, (bool)1> ") is n
ot allowed

when attempting to build TensorFlow.

This change fixes things by adding an additional check for `__NVCC__`, and
avoiding any branch prediction hints in that case.

PiperOrigin-RevId: 197067418

6 years agofixing some incorrect documentation in test cases.
Olivia Nordquist [Thu, 17 May 2018 22:49:12 +0000 (15:49 -0700)]
fixing some incorrect documentation in test cases.

PiperOrigin-RevId: 197064874

6 years agoIntroduce an "indexed array" analysis
Sanjoy Das [Thu, 17 May 2018 22:47:30 +0000 (15:47 -0700)]
Introduce an "indexed array" analysis

Context: we want to optimize computations hanging off of a embedding lookup from
a constant array.  For instance, consider:

  embedding = gather from a constant array using non-constant indices
  embedding_reshaped = reshape embedding
  embedding_reshaped_transposed = transpose embedding_reshaped
  result = dot(embedding_reshaped_transposed, constant)

In the graph above, depending on how the details work out, we may be able to
fold `result` into a gather from a precomputed constant array.  However, it is
inconvenient to get there by incremental rewrites -- it is probably not
profitable to rewrite embedding_reshaped or embedding_reshaped_transposed [0] as
embedding lookups but we get to "see" that the dot can be rewritten only after
rewriting the reshape and the transpose.

This analysis aims to make the optimization above more straightforward by
allowing a transformation pass (that uses this analysis) to query the analysis
to see if if `result` _can_ be represented as an embedding lookup.  If yes it
can then apply some profitability heuristics to decide if it is worth it to
rewrite it as one.  This suggested workflow gives us separation of concerns (the
legality of the rewrite is computed separately from its profitability) and, more
importantly, lets us "look ahead" and analyze the dot without rewriting its
operands.

The implementation is far from complete (most of the interesting bits are TODO)
but I wanted to get an early design review before I spent too much time on this.

[0] Under the assumption that transposing or reshaping are not expensive enough
to pay the price of keeping around a new potentially large constant (in
particular, some of these may have been equivalent to free bitcasts).

PiperOrigin-RevId: 197064648

6 years ago Add more test cases in function_test
Youlong Cheng [Thu, 17 May 2018 22:47:24 +0000 (15:47 -0700)]
  Add more test cases in function_test

PiperOrigin-RevId: 197064629

6 years agoDelete unused proto schema "graph_explorer.proto".
A. Unique TensorFlower [Thu, 17 May 2018 22:34:00 +0000 (15:34 -0700)]
Delete unused proto schema "graph_explorer.proto".

PiperOrigin-RevId: 197062616

6 years agoSupport combinations stored in a global variable in combinations.py-based tests.
Igor Saprykin [Thu, 17 May 2018 22:29:03 +0000 (15:29 -0700)]
Support combinations stored in a global variable in combinations.py-based tests.

The user's input is modified to give the test a better name.  If the user stores combinations in a variable and applies those combinations to more than one test, then the test case name will be a concatenation of of the names of the previous test cases.

PiperOrigin-RevId: 197061902

6 years ago[XLA] Use Expm1 in Elu/Selu
David Majnemer [Thu, 17 May 2018 22:28:33 +0000 (15:28 -0700)]
[XLA] Use Expm1 in Elu/Selu

exp(x) - 1 is best executed using the composed Expm1 operation as it is better
behaved when exp(x) is near 1.

PiperOrigin-RevId: 197061826

6 years agoMove runtime.{h,cc,_test.cc} into core/common_runtime/eager as attr_builder
Akshay Modi [Thu, 17 May 2018 22:28:09 +0000 (15:28 -0700)]
Move runtime.{h,cc,_test.cc} into core/common_runtime/eager as attr_builder

I'm not familiar with how the CMake build is set up but from the description
of the problem the dependency graph is coarser than Bazel's, so I think this
should fix #18925.

PiperOrigin-RevId: 197061764

6 years agoClean up CFG test suite
A. Unique TensorFlower [Thu, 17 May 2018 22:10:25 +0000 (15:10 -0700)]
Clean up CFG test suite

PiperOrigin-RevId: 197059149

6 years agoMerge pull request #19294 from yongtang/03122018-MapAndBatchDataset
Jiri Simsa [Thu, 17 May 2018 22:12:24 +0000 (15:12 -0700)]
Merge pull request #19294 from yongtang/03122018-MapAndBatchDataset

Add shape validation in shape function of MapAndBatchDataset

6 years ago[XLA] Remove eq_shapes from Identical SlowPath since it is already checked in
Blake Hechtman [Thu, 17 May 2018 22:08:33 +0000 (15:08 -0700)]
[XLA] Remove eq_shapes from Identical SlowPath since it is already checked in
Identical.

PiperOrigin-RevId: 197058888

6 years agoSupport Bool in Cast (TFLite)
Yu-Cheng Ling [Thu, 17 May 2018 21:58:04 +0000 (14:58 -0700)]
Support Bool in Cast (TFLite)

PiperOrigin-RevId: 197056978

6 years agoAdded CSV parsing to the tf.data programmers guide
Rachel Lim [Thu, 17 May 2018 21:37:34 +0000 (14:37 -0700)]
Added CSV parsing to the tf.data programmers guide
Relevant to #278.

PiperOrigin-RevId: 197053723

6 years agoBasic usability fixes for RNNCell wrappers
Allen Lavoie [Thu, 17 May 2018 21:32:47 +0000 (14:32 -0700)]
Basic usability fixes for RNNCell wrappers

They weren't calling their parent constructors (for the Keras base Layer), so a bunch of their methods threw odd errors. There may still be issues, but hopefully not so blatent.

Fixes #19208. For real this time.

PiperOrigin-RevId: 197052962

6 years agoFix L2Normalization.
A. Unique TensorFlower [Thu, 17 May 2018 21:31:29 +0000 (14:31 -0700)]
Fix L2Normalization.

PiperOrigin-RevId: 197052728

6 years ago[TF:STREAM_EXECUTOR] move declaration of multi_platform_manager to header
Nick Desaulniers [Thu, 17 May 2018 21:22:49 +0000 (14:22 -0700)]
[TF:STREAM_EXECUTOR] move declaration of multi_platform_manager to header

PiperOrigin-RevId: 197051272

6 years agoAutomated g4 rollback of changelist 197026249
Allen Lavoie [Thu, 17 May 2018 21:11:14 +0000 (14:11 -0700)]
Automated g4 rollback of changelist 197026249

PiperOrigin-RevId: 197049255

6 years ago[TF:XLA] Do not rely on implementation-defined semantics of DynamicSlice.
Michael Kuperstein [Thu, 17 May 2018 20:37:57 +0000 (13:37 -0700)]
[TF:XLA] Do not rely on implementation-defined semantics of DynamicSlice.

ReverseSequence relies on DynamicSlice wrapping around, which is implementation-defined behavior, and is not guaranteed. Pad the input instead.

PiperOrigin-RevId: 197043307

6 years agoAllows users to specify allow_custom_ops when calling tf.contrib.lite.toco_convert().
A. Unique TensorFlower [Thu, 17 May 2018 20:12:51 +0000 (13:12 -0700)]
Allows users to specify allow_custom_ops when calling tf.contrib.lite.toco_convert().

PiperOrigin-RevId: 197039477

6 years agoRemove -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK being added by default to all builds.
Michael Case [Thu, 17 May 2018 20:02:08 +0000 (13:02 -0700)]
Remove -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK being added by default to all builds.

PiperOrigin-RevId: 197037867

6 years agoSupport functools.partial as callable object in tf_inspect.getargspec.
A. Unique TensorFlower [Thu, 17 May 2018 19:55:02 +0000 (12:55 -0700)]
Support functools.partial as callable object in tf_inspect.getargspec.

PiperOrigin-RevId: 197036874

6 years ago[XLA] Redesign: delete Client::LoadSnapeshot(SessionModule). This is a precondition...
A. Unique TensorFlower [Thu, 17 May 2018 19:31:17 +0000 (12:31 -0700)]
[XLA] Redesign: delete Client::LoadSnapeshot(SessionModule). This is a precondition to delete xla::Computation.

PiperOrigin-RevId: 197033641

6 years agoTest some distributions stuff in Eager as well as Graph
Akshay Modi [Thu, 17 May 2018 19:29:54 +0000 (12:29 -0700)]
Test some distributions stuff in Eager as well as Graph

PiperOrigin-RevId: 197033485

6 years agoInternal Change
A. Unique TensorFlower [Thu, 17 May 2018 18:52:49 +0000 (11:52 -0700)]
Internal Change

PiperOrigin-RevId: 197028096

6 years agoSupport 1x1x1xN bias sizes in TFLite's convolution and FC layers.
A. Unique TensorFlower [Thu, 17 May 2018 18:47:16 +0000 (11:47 -0700)]
Support 1x1x1xN bias sizes in TFLite's convolution and FC layers.

PiperOrigin-RevId: 197027135

6 years agoInternal change
A. Unique TensorFlower [Thu, 17 May 2018 18:42:18 +0000 (11:42 -0700)]
Internal change

PiperOrigin-RevId: 197026249

6 years agoRemove C API staging from importer.py.
Skye Wanderman-Milne [Thu, 17 May 2018 18:33:36 +0000 (11:33 -0700)]
Remove C API staging from importer.py.

PiperOrigin-RevId: 197024708

6 years agoFix the fizzbuzz example
Alexandre Passos [Thu, 17 May 2018 18:17:58 +0000 (11:17 -0700)]
Fix the fizzbuzz example

PiperOrigin-RevId: 197021930

6 years agoUse integral power function rather than floating point version. The integral version...
A. Unique TensorFlower [Thu, 17 May 2018 18:13:00 +0000 (11:13 -0700)]
Use integral power function rather than floating point version. The integral version is faster.

PiperOrigin-RevId: 197021020

6 years ago[XLA:GPU] Unroll multi-output loop fusions
Benjamin Kramer [Thu, 17 May 2018 18:06:05 +0000 (11:06 -0700)]
[XLA:GPU] Unroll multi-output loop fusions

This is easier than I thought because we can assume that all tuple members have
the same number of elements. LLVM doesn't do a great job of vectorizing the
resulting stores, but otherwise this is working fine.

PiperOrigin-RevId: 197019718

6 years agoChange loop variable type to be deduced.
A. Unique TensorFlower [Thu, 17 May 2018 17:56:36 +0000 (10:56 -0700)]
Change loop variable type to be deduced.

PiperOrigin-RevId: 197017789

6 years agoMerge pull request #19321 from krantideep95/patch-1
Xiaoqiang Zheng [Thu, 17 May 2018 17:53:40 +0000 (10:53 -0700)]
Merge pull request #19321 from krantideep95/patch-1

core/framework/op_gen_lib.cc: include <algorithm>

6 years agoChange traverse_test.test_module to traverse a constructed dummy module rather than...
A. Unique TensorFlower [Thu, 17 May 2018 17:15:45 +0000 (10:15 -0700)]
Change traverse_test.test_module to traverse a constructed dummy module rather than testcase itself.

PiperOrigin-RevId: 197010681

6 years agoFix alignment crashes in AVX512 builds (#19121)
Mark Ryan [Thu, 17 May 2018 17:17:39 +0000 (18:17 +0100)]
Fix alignment crashes in AVX512 builds (#19121)

* Fix issue #15588 by simplifying the code

The allocator.h code tried to be clever and use 32 byte alignment for SSE/AVX2/etc use,
and 64 byte alignment for AVX512.

Unfortunately, the #ifdef in use (from EIGEN) is not useful; the bazel BUILD files do
not propagate the tf_copts() compiler flags when the allocator.cc/allocator.h files get
compiled, to EIGEN does not see the actual AVX512 using compiler flags...

Rather than changing compiler flag propagation throughout a whole bunch of code,
there's an opportunity to just simplify the code and always use 64 byte alignment.
Yes it wastes a bit of space, but on the other hand now these allocations are
cache line aligned which isn't a bad thing... and an ifdef can be dropped

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
* Set EIGEN_MAX_ALIGN_BYTES=64

This patch sets a 64 byte upper bound on the alignment of memory allocated by
eigen.  This is necessary to prevent crashes during the execution of the unit
tests when they are compiled with AVX512 support.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
* Update the tensorflow/compiler/aot tests for 64 byte alignment

Modifications to the tensorflow/core/framework/allocator.h to always
use 64 byte alignment causes failures in the tensorflow/compiler/aot
unit tests.  This patch updates these tests so that they pass with
64 byte aligned allocated memory.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
* Update Tensor.Slice_Basic for 64 byte alignment

The test case

//tensorflow/core:framework_tensor_test:Tensor.Slice_Basic

fails with EIGEN_MAX_ALIGN_BYTES set to 64.  The reason is that the
slices it takes of the sample tensor are 32 byte and not 64 byte
aligned.  This commit increases one of the dimensions of the original
tensor to ensure that the slices taken by the test cases are indeed 64
byte aligned.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
* Update ScopedAllocatorConcatOpTest.Reshape for 64 byte alignment

The ScopedAllocatorConcatOpTest.Reshape test requires that the elements
of the field_shapes parameter of ExecOp are multiples of
Allocator::kAllocatorAlignment in size.  If they are not, the backing
tensor allocated by PrepOp will have too many elements and reshaping
will fail.  This commit modifies the test case, making the elements
64 bytes in size, the new value for Allocator::kAllocatorAlignment.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
6 years agoAdd tf.print an an alias for tf.Print (#19234)
Geoffrey Irving [Thu, 17 May 2018 17:16:07 +0000 (10:16 -0700)]
Add tf.print an an alias for tf.Print (#19234)

Users with Python 3 or `from __future__ import print_function` can now
use lowercase `tf.print`.  `create_python_api.py` needed some adjustment
to ensure that `print_function` doesn't appear as part of the API.

Fixes #18053.

6 years agoAllows the fizzbuzz example to work when called as fizzbuzz(tf.constant(10)).
Alexandre Passos [Thu, 17 May 2018 17:02:06 +0000 (10:02 -0700)]
Allows the fizzbuzz example to work when called as fizzbuzz(tf.constant(10)).

Fixes #18960

PiperOrigin-RevId: 197008373

6 years agoRename private push/pop API and use from `stop_recording` method.
Tom Hennigan [Thu, 17 May 2018 16:57:16 +0000 (09:57 -0700)]
Rename private push/pop API and use from `stop_recording` method.

PiperOrigin-RevId: 197007561

6 years ago[TF:XLA] remove re-initializations of Literals
Nick Desaulniers [Thu, 17 May 2018 16:54:17 +0000 (09:54 -0700)]
[TF:XLA] remove re-initializations of Literals

It's an antipattern to have:

auto x = Literal::CreateFromShape(my_shape);
x->Populate();

as that results in initialization followed by reinitialization. Can be replaced
with:

auto x = MakeUnique<Literal>(my_shape);
x->Populate();

Suggested-by: Kay Zhu <kayzhu@google.com>
PiperOrigin-RevId: 197007127

6 years agoImprove the error message printed when a WorkerService::GetStatus() call fails on...
Derek Murray [Thu, 17 May 2018 16:32:02 +0000 (09:32 -0700)]
Improve the error message printed when a WorkerService::GetStatus() call fails on session creation.

PiperOrigin-RevId: 197003951

6 years agoImprovements to function._FuncGraph.
Skye Wanderman-Milne [Thu, 17 May 2018 16:28:35 +0000 (09:28 -0700)]
Improvements to function._FuncGraph.

* Adds 'inputs', 'outputs', and 'name' field to _FuncGraph. This
  allows _FuncGraph to encapsulate all the information needed to
  convert it to a FunctionDef.
* Refactor logic for converting a Python callable to a _FuncGraph into
  a new method, func_graph_from_py_func().

These changes are in preparation for converting tf.cond to emit an If
op. By exposing _FuncGraph functionality outside of _DefinedFunction,
_FuncGraphs can be used to represent functions that are manipulated
(e.g. to output intermediate tensors) before being converted to
FunctionDef protos.

PiperOrigin-RevId: 197003496

6 years agoRemove misleading declaration-as-default that results in a deleted constructor, and...
A. Unique TensorFlower [Thu, 17 May 2018 16:26:18 +0000 (09:26 -0700)]
Remove misleading declaration-as-default that results in a deleted constructor, and a misguided comment.

PiperOrigin-RevId: 197003162

6 years ago[XLA] Adds HloLivenessAnalysis and HloModuleDCE.
A. Unique TensorFlower [Thu, 17 May 2018 16:25:14 +0000 (09:25 -0700)]
[XLA] Adds HloLivenessAnalysis and HloModuleDCE.
HloLivenessAnalysis marks all live instruction outputs (i.e. tuple elements) for all instructions in an HloModule, propagating live values across computation boundaries.
HloModuleDCE sweeps through each instructions dead tuple elements, eliminating dead code (currently removes dead tuple elements from while loops, but could be extended to do the same for call instructions).

PiperOrigin-RevId: 197003043

6 years agoUpdate SessionTest.testFeedShapeCompatibility to work with C API enabled.
Skye Wanderman-Milne [Thu, 17 May 2018 16:22:24 +0000 (09:22 -0700)]
Update SessionTest.testFeedShapeCompatibility to work with C API enabled.

This test got lost in the transition. Prior to enabling the C API,
some constant node whose values were used for shape inference would be
marked as unfeedable in tensor_util.constant_value
(https://github.com/tensorflow/tensorflow/blob/r1.8/tensorflow/python/framework/tensor_util.py#L810).

This shape inference path is no longer used with the C API enabled, so
the constant node is successfully fed, triggering a runtime shape error.

This is arguably a regression, but given that the Python code wouldn't
mark all nodes evaluated during shape inference as unfeedable, it
seems ok to relax the check a little more.

PiperOrigin-RevId: 197002741

6 years agoAvoid accessing platform/default directly.
A. Unique TensorFlower [Thu, 17 May 2018 16:11:16 +0000 (09:11 -0700)]
Avoid accessing platform/default directly.

PiperOrigin-RevId: 197001347

6 years agoFixed bug in tf.pad shape logic that made it more restrictive than necessary by inter...
A. Unique TensorFlower [Thu, 17 May 2018 15:52:36 +0000 (08:52 -0700)]
Fixed bug in tf.pad shape logic that made it more restrictive than necessary by interpreting 0 as False.

PiperOrigin-RevId: 196998883

6 years agoMethods to stop and reset tf.GradientTape()
Alexandre Passos [Thu, 17 May 2018 15:23:10 +0000 (08:23 -0700)]
Methods to stop and reset tf.GradientTape()

PiperOrigin-RevId: 196995160