platform/upstream/tensorflow.git
6 years agoAdd shape validation for symbolic tensors passed to fit (only graph mode).
Francois Chollet [Thu, 24 May 2018 18:11:42 +0000 (11:11 -0700)]
Add shape validation for symbolic tensors passed to fit (only graph mode).

PiperOrigin-RevId: 197921675

6 years agoFix convert_to_tensor logic in GradientDescentOptimizer's _prepare method
Akshay Agrawal [Thu, 24 May 2018 17:58:47 +0000 (10:58 -0700)]
Fix convert_to_tensor logic in GradientDescentOptimizer's _prepare method

Previously, eagerly executing an optimizer that had been used in a `defun`
led to a cryptic error because the learning rate tensor supplied to the update
op was in fact a vestigial graph Tensor.

PiperOrigin-RevId: 197919104

6 years agoImprove TOCO Python API.
Nupur Garg [Thu, 24 May 2018 17:53:28 +0000 (10:53 -0700)]
Improve TOCO Python API.

PiperOrigin-RevId: 197918102

6 years agoFix build failure introduced by cl/197457316
A. Unique TensorFlower [Thu, 24 May 2018 17:52:18 +0000 (10:52 -0700)]
Fix build failure introduced by cl/197457316

PiperOrigin-RevId: 197917867

6 years agoWarn about tf.Variable semantics
Alexandre Passos [Thu, 24 May 2018 17:38:48 +0000 (10:38 -0700)]
Warn about tf.Variable semantics

PiperOrigin-RevId: 197915380

6 years agoAdd a checkpointable map data structure
Allen Lavoie [Thu, 24 May 2018 17:30:41 +0000 (10:30 -0700)]
Add a checkpointable map data structure

PiperOrigin-RevId: 197913890

6 years ago[XLA] Speed up slice_test again.
Justin Lebar [Thu, 24 May 2018 17:05:10 +0000 (10:05 -0700)]
[XLA] Speed up slice_test again.

Previous patch missed one instance of creating a constant inside of
slice_test.

PiperOrigin-RevId: 197909685

6 years ago[XLA] Devectorize constant-sized arrays
Benjamin Kramer [Thu, 24 May 2018 16:50:19 +0000 (09:50 -0700)]
[XLA] Devectorize constant-sized arrays

A sufficiently smart compiler could promote these from heap to stack, in
practice no compiler does that. Remove the superfluous heap allocations
manually.

PiperOrigin-RevId: 197907388

6 years agoFix a bug in BestExporter - estimator.model_dir should be property instead of a function.
A. Unique TensorFlower [Thu, 24 May 2018 16:28:43 +0000 (09:28 -0700)]
Fix a bug in BestExporter - estimator.model_dir should be property instead of a function.

PiperOrigin-RevId: 197904351

6 years agoInternal change.
A. Unique TensorFlower [Thu, 24 May 2018 16:15:17 +0000 (09:15 -0700)]
Internal change.

PiperOrigin-RevId: 197902509

6 years agoExtracts the 'switch with same input' optimization into its own method.
A. Unique TensorFlower [Thu, 24 May 2018 16:05:41 +0000 (09:05 -0700)]
Extracts the 'switch with same input' optimization into its own method.

PiperOrigin-RevId: 197900929

6 years agoWhen using fake infeed data, fill the infeed when it is empty.
A. Unique TensorFlower [Thu, 24 May 2018 14:00:24 +0000 (07:00 -0700)]
When using fake infeed data, fill the infeed when it is empty.

This makes sure we avoid OOM when there is too much infeed data to send it at
once, and we also don't need the magic "num_infeeds" parameter anymore.

PiperOrigin-RevId: 197886121

6 years agoStyle guide edits: refer to the broader Google style guide, which is what was actuall...
Dan Moldovan [Thu, 24 May 2018 13:20:04 +0000 (06:20 -0700)]
Style guide edits: refer to the broader Google style guide, which is what was actually used in the code, to replace some of the rules that were spelled out explicitly.
Use AutoGraph, rather than TensorFlow AutoGraph for name.

PiperOrigin-RevId: 197881802

6 years agoAutomated g4 rollback of changelist 197477959
A. Unique TensorFlower [Thu, 24 May 2018 10:48:24 +0000 (03:48 -0700)]
Automated g4 rollback of changelist 197477959

PiperOrigin-RevId: 197868028

6 years agoAllow to generate fake infeed buffers with shapes derived from the computation.
A. Unique TensorFlower [Thu, 24 May 2018 09:54:37 +0000 (02:54 -0700)]
Allow to generate fake infeed buffers with shapes derived from the computation.

When replaying a computation from a HloSnapshot, we want to be able to provide fake
infeed data. This was already possible when the infeed shape is known by providing
it with the --fake_infeed_shape flag. With this CL, we add the option to derive it
from the provided HloSnapshot. Also, we transfer the infeed shape a fixed number of
times instead of infinitely many times (configurable with a flag).
Otherwise we will definitely run out of memory at some point.

PiperOrigin-RevId: 197863412

6 years ago[XLA:GPU] Basic multi-output fusion for GPU.
A. Unique TensorFlower [Thu, 24 May 2018 08:03:36 +0000 (01:03 -0700)]
[XLA:GPU] Basic multi-output fusion for GPU.

Take a conservative approach and attempt multi-output fusion in cases where "regular" fusion is not an option.

PiperOrigin-RevId: 197852598

6 years agoImplement support for reshape in IndexedArrayAnalysis
Sanjoy Das [Thu, 24 May 2018 05:59:22 +0000 (22:59 -0700)]
Implement support for reshape in IndexedArrayAnalysis

PiperOrigin-RevId: 197843589

6 years agoAdd unit tests to tflite kernels
A. Unique TensorFlower [Thu, 24 May 2018 05:33:53 +0000 (22:33 -0700)]
Add unit tests to tflite kernels

PiperOrigin-RevId: 197842122

6 years agoResolve name collisions with assets in SavedModels by deduplicating names that
Karmel Allison [Thu, 24 May 2018 03:53:15 +0000 (20:53 -0700)]
Resolve name collisions with assets in SavedModels by deduplicating names that
point to distinct files.

PiperOrigin-RevId: 197835288

6 years agoAdd support for is_recompute optional kwarg to functions decorated with recompute_grad
A. Unique TensorFlower [Thu, 24 May 2018 03:39:31 +0000 (20:39 -0700)]
Add support for is_recompute optional kwarg to functions decorated with recompute_grad

PiperOrigin-RevId: 197834316

6 years agoSet the correct shape in transformed distribution.
A. Unique TensorFlower [Thu, 24 May 2018 03:03:20 +0000 (20:03 -0700)]
Set the correct shape in transformed distribution.

Also add distribution_util.maybe_get_static_event_ndims to be reused in bijector and transformed distribution classes.

PiperOrigin-RevId: 197831651

6 years agoMoves estimator getting started docs into programmer's guide.
Billy Lamberta [Thu, 24 May 2018 01:46:20 +0000 (18:46 -0700)]
Moves estimator getting started docs into programmer's guide.
Update path references and magic links.
Remove getting started with estimators doc.
Add redirects.

PiperOrigin-RevId: 197826223

6 years agoAdd back some public interface methods.
Shashi Shekhar [Thu, 24 May 2018 01:45:30 +0000 (18:45 -0700)]
Add back some public interface methods.

PiperOrigin-RevId: 197826136

6 years agoHloSharding parsing from string, used by new Sharding HloMatcher for ease of use.
A. Unique TensorFlower [Thu, 24 May 2018 01:38:34 +0000 (18:38 -0700)]
HloSharding parsing from string, used by new Sharding HloMatcher for ease of use.

PiperOrigin-RevId: 197825588

6 years agoExtracts the SimplifyReduction optimization into its own method.
A. Unique TensorFlower [Thu, 24 May 2018 01:13:23 +0000 (18:13 -0700)]
Extracts the SimplifyReduction optimization into its own method.

PiperOrigin-RevId: 197823183

6 years agoAggregating IndexedSlices: Do not require first element to be IndexedSlices.
Priya Gupta [Thu, 24 May 2018 00:58:42 +0000 (17:58 -0700)]
Aggregating IndexedSlices: Do not require first element to be IndexedSlices.

PiperOrigin-RevId: 197821479

6 years ago[XLA] Speed up SliceTest.
Justin Lebar [Thu, 24 May 2018 00:52:29 +0000 (17:52 -0700)]
[XLA] Speed up SliceTest.

- Use parameters rather than constants, because LLVM and ptxas are slow
  with large constants.

- Use iota rather than filling with random values, because the latter is
  slow.

PiperOrigin-RevId: 197820897

6 years agoCache generated LLVM IR for GEBP
Sanjoy Das [Thu, 24 May 2018 00:49:42 +0000 (17:49 -0700)]
Cache generated LLVM IR for GEBP

After this change all generated GEBPs with the same shape will share a single
llvm::Function.

This is NFC for any actual workloads because the GEBP emitter isn't exercised by
normal code-paths yet.

PiperOrigin-RevId: 197820606

6 years agoAdd import.
Nupur Garg [Thu, 24 May 2018 00:44:32 +0000 (17:44 -0700)]
Add import.

PiperOrigin-RevId: 197820050

6 years ago[tf.data] Split out the `tf.contrib.data.sample_from_datasets()` tests.
Derek Murray [Thu, 24 May 2018 00:32:54 +0000 (17:32 -0700)]
[tf.data] Split out the `tf.contrib.data.sample_from_datasets()` tests.

These were previously broken and disabled in CI builds; this change also fixes
them up.

PiperOrigin-RevId: 197818554

6 years agoInternal cleanup to remove a difference from the code on github.
A. Unique TensorFlower [Thu, 24 May 2018 00:26:04 +0000 (17:26 -0700)]
Internal cleanup to remove a difference from the code on github.

PiperOrigin-RevId: 197817738

6 years agoInternal change.
Anna R [Thu, 24 May 2018 00:15:54 +0000 (17:15 -0700)]
Internal change.

PiperOrigin-RevId: 197816560

6 years agoRefactor StatSummarizer extract common functionality without proto dependencies.
Shashi Shekhar [Thu, 24 May 2018 00:14:39 +0000 (17:14 -0700)]
Refactor StatSummarizer extract common functionality without proto dependencies.

PiperOrigin-RevId: 197816405

6 years agoSimplify the remapper code and added support for non scalar mean, variance, scale...
Benoit Steiner [Wed, 23 May 2018 23:45:26 +0000 (16:45 -0700)]
Simplify the remapper code and added support for non scalar mean, variance, scale and offset.

PiperOrigin-RevId: 197812268

6 years agoOpen source rewrite_for_inference().
A. Unique TensorFlower [Wed, 23 May 2018 23:34:00 +0000 (16:34 -0700)]
Open source rewrite_for_inference().

PiperOrigin-RevId: 197810460

6 years agoMake depthwiseconv handler handle filter ranges beyond 255
A. Unique TensorFlower [Wed, 23 May 2018 23:33:27 +0000 (16:33 -0700)]
Make depthwiseconv handler handle filter ranges beyond 255

PiperOrigin-RevId: 197810361

6 years agoAdd support for IndexedSlices in Distribution Strategy all reduce. Issue reported...
Priya Gupta [Wed, 23 May 2018 23:10:30 +0000 (16:10 -0700)]
Add support for IndexedSlices in Distribution Strategy all reduce. Issue reported in #19069

PiperOrigin-RevId: 197806955

6 years agoRun only small and medium tests in CI builds.
Justin Lebar [Wed, 23 May 2018 23:06:03 +0000 (16:06 -0700)]
Run only small and medium tests in CI builds.

PiperOrigin-RevId: 197806292

6 years agoadded support for calling fit on Dataset objects
A. Unique TensorFlower [Wed, 23 May 2018 23:02:19 +0000 (16:02 -0700)]
added support for calling fit on Dataset objects

PiperOrigin-RevId: 197805615

6 years agoFix CurlHttpRequest handling unexpectedly large responses
Nick Felt [Wed, 23 May 2018 22:58:28 +0000 (15:58 -0700)]
Fix CurlHttpRequest handling unexpectedly large responses

This fixes a few issues with CurlHttpRequest (and correspondingly GcsFileSystem):

- Return status FAILED_PRECONDITION (i.e. "your buffer was too small") when CurlHttpRequest has a direct response buffer and the response is too large for the buffer, instead of UNAVAILABLE, since if the server resource is actually a fixed size, retrying automatically won't help at all.  Also, include the message about the too-small buffer size in the returned Status as opposed to logging it, making it more obvious that it's treated as a message about a hard failure versus just a warning.

- If the response was actually a 416 Range Not Satisfied response, fully pretend that the response had no body even if we got one (I'm looking at you GCS... it returns a 177-byte error message).  This means:
  - Ignore a "buffer too small" error produced by the logic described above
  - Don't report the length of that body in GetResultBufferDirectBytesTransferred(), which looks to the client like data corruption, just report 0 (this fix makes it match the behavior of the non-direct-buffer response handling)

I also tweaked the error messages, e.g. the message that includes an HTTP response code shouldn't report the CURLcode since it will always be CURLE_OK at that point.

PiperOrigin-RevId: 197805003

6 years agoAdd support for partitioned variables to SDCA.
A. Unique TensorFlower [Wed, 23 May 2018 22:46:03 +0000 (15:46 -0700)]
Add support for partitioned variables to SDCA.

PiperOrigin-RevId: 197803127

6 years agoAdding scatter_nd* ops to Andrtoid build.
A. Unique TensorFlower [Wed, 23 May 2018 22:24:47 +0000 (15:24 -0700)]
Adding scatter_nd* ops to Andrtoid build.

PiperOrigin-RevId: 197799974

6 years ago[TF:XLA] Add tests to show that the List scheduler handles tuples correctly (in and...
Dimitris Vardoulakis [Wed, 23 May 2018 22:17:03 +0000 (15:17 -0700)]
[TF:XLA] Add tests to show that the List scheduler handles tuples correctly (in and out of fusions).

PiperOrigin-RevId: 197798787

6 years ago[XLA] Fix exhaustive_f32_elementwise_test's size marker.
Justin Lebar [Wed, 23 May 2018 21:58:08 +0000 (14:58 -0700)]
[XLA] Fix exhaustive_f32_elementwise_test's size marker.

"enormous" is a size, not a tag.

PiperOrigin-RevId: 197795125

6 years agoAllow vars_to_warm_start to be a list of strings or Variables, which allows for non...
A. Unique TensorFlower [Wed, 23 May 2018 21:57:23 +0000 (14:57 -0700)]
Allow vars_to_warm_start to be a list of strings or Variables, which allows for non-TRAINABLE_VARIABLES to be warm-started.

PiperOrigin-RevId: 197794989

6 years ago[XLA] Draw hollow arrowheads for small arrays in dumped HLO graphs.
Justin Lebar [Wed, 23 May 2018 21:56:55 +0000 (14:56 -0700)]
[XLA] Draw hollow arrowheads for small arrays in dumped HLO graphs.

The intent is to make it easier to tell what's "big" and what's "small".

PiperOrigin-RevId: 197794902

6 years agoModify model output names to not be unique when in distribution context.
Anjali Sridhar [Wed, 23 May 2018 21:36:23 +0000 (14:36 -0700)]
Modify model output names to not be unique when in distribution context.

PiperOrigin-RevId: 197791115

6 years agoAdd NNAPI delegation for EMBEDING_LOOKUP, RNN, SVDF
A. Unique TensorFlower [Wed, 23 May 2018 21:33:59 +0000 (14:33 -0700)]
Add NNAPI delegation for EMBEDING_LOOKUP, RNN, SVDF

PiperOrigin-RevId: 197790679

6 years agoNew quantized log(x) for x > 1. Used for LogSoftmax.
A. Unique TensorFlower [Wed, 23 May 2018 21:12:40 +0000 (14:12 -0700)]
New quantized log(x) for x > 1.  Used for LogSoftmax.

PiperOrigin-RevId: 197786738

6 years agoClear docstrings for auto-generated module files, and detach github links from genera...
Mark Daoust [Wed, 23 May 2018 20:55:32 +0000 (13:55 -0700)]
Clear docstrings for auto-generated module files, and detach github links from generated files.

PiperOrigin-RevId: 197783520

6 years agoAdd a test to reproduce copy-on-read bug for variables
Igor Ganichev [Wed, 23 May 2018 20:45:14 +0000 (13:45 -0700)]
Add a test to reproduce copy-on-read bug for variables

PiperOrigin-RevId: 197781741

6 years agoInternal Change
A. Unique TensorFlower [Wed, 23 May 2018 20:22:27 +0000 (13:22 -0700)]
Internal Change

PiperOrigin-RevId: 197778159

6 years agoAdding utility class for manipulating a GraphDef.
Jiri Simsa [Wed, 23 May 2018 20:17:39 +0000 (13:17 -0700)]
Adding utility class for manipulating a GraphDef.

PiperOrigin-RevId: 197777416

6 years agoExtracts the SimplifyReshape optimization into its own method.
A. Unique TensorFlower [Wed, 23 May 2018 19:35:05 +0000 (12:35 -0700)]
Extracts the SimplifyReshape optimization into its own method.

PiperOrigin-RevId: 197770994

6 years agoAutomated g4 rollback of changelist 197741984
Anna R [Wed, 23 May 2018 19:26:50 +0000 (12:26 -0700)]
Automated g4 rollback of changelist 197741984

PiperOrigin-RevId: 197769770

6 years agoIntroduce Encoder and Decoder classes so that platform/*coding* doesn't have to
A. Unique TensorFlower [Wed, 23 May 2018 19:18:23 +0000 (12:18 -0700)]
Introduce Encoder and Decoder classes so that platform/*coding* doesn't have to
depend on framework/resource_handler and framework/variant.

PiperOrigin-RevId: 197768387

6 years ago[TF:XLA] Register a real implementation of ControlTrigger on XLA devices.
Peter Hawkins [Wed, 23 May 2018 18:31:36 +0000 (11:31 -0700)]
[TF:XLA] Register a real implementation of ControlTrigger on XLA devices.

PiperOrigin-RevId: 197759239

6 years agoAdd a checkpointable list data structure
Allen Lavoie [Wed, 23 May 2018 17:43:28 +0000 (10:43 -0700)]
Add a checkpointable list data structure

Allows tracking of Layers and other checkpointable objects by number.

Fixes #19250.

PiperOrigin-RevId: 197749961

6 years agoUpdate build visibility of //third_party/tensorflow/contrib/signal
Peter Hawkins [Wed, 23 May 2018 17:29:58 +0000 (10:29 -0700)]
Update build visibility of //third_party/tensorflow/contrib/signal

PiperOrigin-RevId: 197747430

6 years ago Combine op-profiles collected from individual TPUs.
A. Unique TensorFlower [Wed, 23 May 2018 17:05:58 +0000 (10:05 -0700)]
  Combine op-profiles collected from individual TPUs.

PiperOrigin-RevId: 197743291

6 years agoKeep column order in make_csv_dataset.
Mark Daoust [Wed, 23 May 2018 17:01:15 +0000 (10:01 -0700)]
Keep column order in make_csv_dataset.

PiperOrigin-RevId: 197742412

6 years agoAdd a "--no_search_hints" flag to the api-docs generator.
Mark Daoust [Wed, 23 May 2018 16:59:25 +0000 (09:59 -0700)]
Add a "--no_search_hints" flag to the api-docs generator.

PiperOrigin-RevId: 197742114

6 years agoPiperOrigin-RevId: 197741984
A. Unique TensorFlower [Wed, 23 May 2018 16:58:30 +0000 (09:58 -0700)]
PiperOrigin-RevId: 197741984

6 years agoFix typo in error message.
Patrick Nguyen [Wed, 23 May 2018 16:54:06 +0000 (09:54 -0700)]
Fix typo in error message.

PiperOrigin-RevId: 197741341

6 years agoQuick fix for Kokoro breakage.
Bjarke Hammersholt Roune [Wed, 23 May 2018 16:44:39 +0000 (09:44 -0700)]
Quick fix for Kokoro breakage.

PiperOrigin-RevId: 197739982

6 years agoAdd 'platform_' libraries in core/BUILD.
A. Unique TensorFlower [Wed, 23 May 2018 16:20:12 +0000 (09:20 -0700)]
Add 'platform_' libraries in core/BUILD.

PiperOrigin-RevId: 197736600

6 years agoSupport batch size > 1 in L2Normalization 8 bit quantized implementations.
A. Unique TensorFlower [Wed, 23 May 2018 16:16:52 +0000 (09:16 -0700)]
Support batch size > 1 in L2Normalization 8 bit quantized implementations.

PiperOrigin-RevId: 197736184

6 years agoAdd a method XlaTensor:ReleaseShapedBuffer() to relinquish the shaped buffer owned...
Peter Hawkins [Wed, 23 May 2018 13:45:12 +0000 (06:45 -0700)]
Add a method XlaTensor:ReleaseShapedBuffer() to relinquish the shaped buffer owned by an XlaTensor.
Add an equality operator for xla::ShapeIndexView.

PiperOrigin-RevId: 197716313

6 years ago[TF:XLA:GPU] Relax test tolerance due to flakiness.
Peter Hawkins [Wed, 23 May 2018 12:19:00 +0000 (05:19 -0700)]
[TF:XLA:GPU] Relax test tolerance due to flakiness.

PiperOrigin-RevId: 197708758

6 years agoUse the right attributes when creating placeholder nodes.
Benoit Steiner [Wed, 23 May 2018 04:57:14 +0000 (21:57 -0700)]
Use the right attributes when creating placeholder nodes.

PiperOrigin-RevId: 197673355

6 years agoInternal Change
A. Unique TensorFlower [Wed, 23 May 2018 02:07:13 +0000 (19:07 -0700)]
Internal Change

PiperOrigin-RevId: 197661636

6 years agoAdd interfaces to Compiler that are sufficient to implement a backend-independent...
Bjarke Hammersholt Roune [Wed, 23 May 2018 01:22:37 +0000 (18:22 -0700)]
Add interfaces to Compiler that are sufficient to implement a backend-independent offline auto-tuner for backend configurations of ops as well as automatic testing across candidate configurations.

Also add a simple Scanner class that is handy for parsing things.

PiperOrigin-RevId: 197657512

6 years agoFix an issue when mixing sparse and dense features in the same model.
A. Unique TensorFlower [Wed, 23 May 2018 00:17:17 +0000 (17:17 -0700)]
Fix an issue when mixing sparse and dense features in the same model.

PiperOrigin-RevId: 197650140

6 years agoAdd convolution with NHWC layout to stream executor.
A. Unique TensorFlower [Wed, 23 May 2018 00:16:44 +0000 (17:16 -0700)]
Add convolution with NHWC layout to stream executor.

PiperOrigin-RevId: 197650067

6 years ago[TF:XLA] Bump open source llvm revision to r333002
Sanjoy Das [Tue, 22 May 2018 23:36:22 +0000 (16:36 -0700)]
[TF:XLA] Bump open source llvm revision to r333002

PiperOrigin-RevId: 197644290

6 years agoFix the LSTM test in TFLite.
Yu-Cheng Ling [Tue, 22 May 2018 23:31:32 +0000 (16:31 -0700)]
Fix the LSTM test in TFLite.

PiperOrigin-RevId: 197643581

6 years agoExpose the new collective reduce and broacast ops as non-public
A. Unique TensorFlower [Tue, 22 May 2018 23:03:16 +0000 (16:03 -0700)]
Expose the new collective reduce and broacast ops as non-public
python interface functions.  Note that they are not yet fully
implemented; this change is to facilitate further development.

PiperOrigin-RevId: 197639372

6 years agoAlways append the trailing slash when look up or insert a directory path in the stat...
Ruoxin Sang [Tue, 22 May 2018 22:51:17 +0000 (15:51 -0700)]
Always append the trailing slash when look up or insert a directory path in the stat cache.

PiperOrigin-RevId: 197637482

6 years agoRemove reservoir sampling from SummaryDbWriter
Justine Tunney [Tue, 22 May 2018 22:30:02 +0000 (15:30 -0700)]
Remove reservoir sampling from SummaryDbWriter

PiperOrigin-RevId: 197634162

6 years agoAdds a kernel that checks whether vector is zero or not.
A. Unique TensorFlower [Tue, 22 May 2018 22:24:01 +0000 (15:24 -0700)]
Adds a kernel that checks whether vector is zero or not.

PiperOrigin-RevId: 197633182

6 years ago[TF:XLA] Add clarification to the DFS scheduler.
Dimitris Vardoulakis [Tue, 22 May 2018 22:01:15 +0000 (15:01 -0700)]
[TF:XLA] Add clarification to the DFS scheduler.

PiperOrigin-RevId: 197629355

6 years agoExtract out common code and make things safer; NFC
Sanjoy Das [Tue, 22 May 2018 21:55:12 +0000 (14:55 -0700)]
Extract out common code and make things safer; NFC

RowMajorMatrixVectorProductEmitter and ColumnMajorMatrixVectorProductEmitter
both cache* the generated LLVM IR by keying off the dimensions of the operation,
the primitive type etc.  Before this CL the code computing the cache key lived
separately from the GEMV emitters.  This pattern introduces a risk that the GEMV
emitters will end up with some state not modeled in the cache key, resulting in
a subtle bug.

This CL reduces the risk by escapsulating the cache key generation and the input
configuration to the GEMV emitters in a single class.

 * In the sense that two different dot operations with the same M,K,N will share
   a single LLVM IR function body.

PiperOrigin-RevId: 197628423

6 years ago[TF:XLA] Add a helper to update HLO reachability.
A. Unique TensorFlower [Tue, 22 May 2018 21:52:36 +0000 (14:52 -0700)]
[TF:XLA] Add a helper to update HLO reachability.

This can be used if the user does not care if reachability changed after an
update.

PiperOrigin-RevId: 197628007

6 years ago[TF:XLA] Roll back the functionality change of cl/197458260 to unbreak test.
Dimitris Vardoulakis [Tue, 22 May 2018 21:39:47 +0000 (14:39 -0700)]
[TF:XLA] Roll back the functionality change of cl/197458260 to unbreak test.

PiperOrigin-RevId: 197625888

6 years ago[TF:XLA] make miscomparison error messages more readable
Nick Desaulniers [Tue, 22 May 2018 21:08:57 +0000 (14:08 -0700)]
[TF:XLA] make miscomparison error messages more readable

PiperOrigin-RevId: 197620560

6 years ago[XLA] Skip BF16 output conversion folding when CRS is the root.
Yuanzhong Xu [Tue, 22 May 2018 20:59:48 +0000 (13:59 -0700)]
[XLA] Skip BF16 output conversion folding when CRS is the root.

PiperOrigin-RevId: 197618934

6 years agoCollective Ops Part 7
A. Unique TensorFlower [Tue, 22 May 2018 20:49:08 +0000 (13:49 -0700)]
Collective Ops Part 7

Complete just enough of the core implementation to run
multi-device collectives locally within a single process.
Interfaces are still private and not availble for general use.

PiperOrigin-RevId: 197617132

6 years agoMove executor_test.cc to tensorflow/core/common_runtime/.
Derek Murray [Tue, 22 May 2018 20:14:18 +0000 (13:14 -0700)]
Move executor_test.cc to tensorflow/core/common_runtime/.

PiperOrigin-RevId: 197611583

6 years agoFix memory leak when going from the fast path to the slow path in eager
Akshay Modi [Tue, 22 May 2018 19:46:30 +0000 (12:46 -0700)]
Fix memory leak when going from the fast path to the slow path in eager

Fixes #19385

PiperOrigin-RevId: 197607384

6 years agoDetect unknown batch size in predictions dict
Jianwei Xie [Tue, 22 May 2018 19:36:35 +0000 (12:36 -0700)]
Detect unknown batch size in predictions dict

PiperOrigin-RevId: 197606059

6 years ago[XLA:GPU] Emit fused reduces from batchnorm expander
Benjamin Kramer [Tue, 22 May 2018 19:34:51 +0000 (12:34 -0700)]
[XLA:GPU] Emit fused reduces from batchnorm expander

This is an intermediate step until we have working multi-output fusion. Once
we have it, this change should be reverted as it might interfere with fusion.

PiperOrigin-RevId: 197605814

6 years ago[XLA:GPU] Add lowering for input fusions with multiple reduce outputs
Benjamin Kramer [Tue, 22 May 2018 18:52:51 +0000 (11:52 -0700)]
[XLA:GPU] Add lowering for input fusions with multiple reduce outputs

This is limited to reduces that have the same shapes and reduced dimensions.
Most of the code is making the individual emission code emit multiple reduction
in the same loop. This requires multi-output fusion to provide a speedup.

PiperOrigin-RevId: 197599248

6 years agoActually return the value from train_and_evaluate.
A. Unique TensorFlower [Tue, 22 May 2018 18:44:52 +0000 (11:44 -0700)]
Actually return the value from train_and_evaluate.

PiperOrigin-RevId: 197597953

6 years ago* Remove the bias centering graph if it is turned off.
A. Unique TensorFlower [Tue, 22 May 2018 18:02:30 +0000 (11:02 -0700)]
* Remove the bias centering graph if it is turned off.
* Create consts once. Otherwise each time the constant is passed to an Op, a new Const op is created.
* Speed up the graph construction by using a functions to build splits.

PiperOrigin-RevId: 197590220

6 years agoAdding stop request capability to CheckpointSaverListener. An example usage of it...
Mustafa Ispir [Tue, 22 May 2018 17:42:31 +0000 (10:42 -0700)]
Adding stop request capability to CheckpointSaverListener. An example usage of it is stopping training based on evaluation metrics. Example usage is as follows:

my-estimator = tf.estimator.DNNClassifier(...)
stopper = StopTrainingBasedOnEvaluateMetrics(my-estimator)
my-estimator.train(..., saving_listeners=[stopper])

where:

class StopTrainingBasedOnEvaluateMetrics(tf.train.CheckpointSaverListener):
  """A saver listener to run evaluate with every checkpoint."""
  def __init__(self, estimator):
    self._estimator = estimator

  def after_save(self, session, global_step_value):
    eval_results = self._estimator.evaluate(...)
    if stop-if-started-overfitting(eval_results):
      return True

PiperOrigin-RevId: 197586515

6 years agoMake init_scope preserve the inner device stack when lifting into a graph.
Akshay Agrawal [Tue, 22 May 2018 17:26:00 +0000 (10:26 -0700)]
Make init_scope preserve the inner device stack when lifting into a graph.

Eager execution doesn't implement device stacks and in particular it doesn't support device functions (which determine the device on a per-op basis), so in general it's not possible to do the same when lifting into the eager context.

PiperOrigin-RevId: 197583446

6 years agoSpecial case the 'dict' call, which trips other mechanisms for built-ins.
Dan Moldovan [Tue, 22 May 2018 16:43:06 +0000 (09:43 -0700)]
Special case the 'dict' call, which trips other mechanisms for built-ins.

PiperOrigin-RevId: 197576297

6 years ago[TF:XLA] Fix xla_interpreter_device build
Benjamin Kramer [Tue, 22 May 2018 16:08:06 +0000 (09:08 -0700)]
[TF:XLA] Fix xla_interpreter_device build

PiperOrigin-RevId: 197571618

6 years agoContributing guidelines, style guide and README updates
A. Unique TensorFlower [Tue, 22 May 2018 15:18:11 +0000 (08:18 -0700)]
Contributing guidelines, style guide and README updates

PiperOrigin-RevId: 197564905

6 years agoUpdate calls to addPassesToEmitFile
A. Unique TensorFlower [Tue, 22 May 2018 15:14:49 +0000 (08:14 -0700)]
Update calls to addPassesToEmitFile

PiperOrigin-RevId: 197564506