Commit Graph

90124 Commits

Author SHA1 Message Date
Christian Sigg
f3bbee405a
Improve ROCm's sqrt and rsqrt for std::complex. 2020-07-11 07:24:15 +02:00
A. Unique TensorFlower
f3b556a903 [XLA:SPMD] Use subgroup AllToAll for resharding
Reshard from tile [2,2,1] to [1,2,2] can be done by a subgroup all-to-all between dimensions 0 and 2.

PiperOrigin-RevId: 320726161
Change-Id: Ied51f29d67c2f29f6a5aaf03fc07c44ddaecb809
2020-07-10 21:45:52 -07:00
Mingming Liu
43b19c184e In shared batch scheduler, rename 'max_batch_size' to 'input_batch_size_limit'.
PiperOrigin-RevId: 320725389
Change-Id: I10979f6e225498b52ec3c20b6d5e91b3322b442d
2020-07-10 21:33:13 -07:00
Yuanzhong Xu
b597319553 [XLA:SPMD] Use subgroup AllToAll for resharding
Reshard from tile [2,2,1] to [1,2,2] can be done by a subgroup all-to-all between dimensions 0 and 2.

PiperOrigin-RevId: 320720720
Change-Id: I1b63ba731b830610596c77697c5577fa9e2e0f79
2020-07-10 20:28:07 -07:00
Dan Moldovan
63e31d9508 Load source code of lambdas in a way that works in interactive shells like Jupyter.
PiperOrigin-RevId: 320717062
Change-Id: I0a33bd2da3e0acb2879bf6cc5784f1be11dd2619
2020-07-10 19:41:56 -07:00
Dan Moldovan
dfae6ae7b7 Execute globals() and locals() in the correct context in converted code.
PiperOrigin-RevId: 320716956
Change-Id: If1eae7e65edbfb965edf73fa27d21bfc7bea8f18
2020-07-10 19:34:22 -07:00
A. Unique TensorFlower
5ede317276 Add legalization for FusedBatchNormV2.
PiperOrigin-RevId: 320716791
Change-Id: I79c5592873ca0dd2a521bb7a549154d3df06a267
2020-07-10 19:27:29 -07:00
Tomer Kaftan
08d78e5b92 Updates a number of Keras tests to pass when kerastensors are enabled. Most of these changes are just updates to the tests themselves when the exact errors being raised/internal checks the test should be making may have changed in a way that does not affect behavior.
The one behavior fix is for metrics: In head, when calling a metric on a symbolic keras input the current metric value is eagerly returned and no update is applied. W/ kerastensors before this cl a messy stack trace was raised. This cl fixes KerasTensors so they act in the same way as symbolic inputs in head: return the current metric value w/o applying any updates.

In the future we may want to revisit this & make the behavior of metrics more consistent w/ standard keras layers: If a metric sees a symbolic input, return a symbolic output that represents the value of the metric. If a functional model is built from those symbolic inputs/outputs, the metric will be included as a layer that applies the update & returns the metric result at the point when it's run.

PiperOrigin-RevId: 320714741
Change-Id: Ie535d8b8dcb35e65ced20d28a0e1b6d59c4c9b83
2020-07-10 19:01:17 -07:00
Feng Liu
35526c1ae5 Migrate the fixed output range trait to op interface
PiperOrigin-RevId: 320713636
Change-Id: I117b34e62b07d7eb46bbdd3caa662ced12b5126d
2020-07-10 18:51:42 -07:00
Xiao Yu
c51da68e1d Pluggable device/op_handler support in c_api_tfrt. And it starts to reuse device name (e.g. /device:CPU:0) borrowed from TensorFlow. It also allows creating different op handler for different GPU devices.
PiperOrigin-RevId: 320713554
Change-Id: Id554249713fe7571e29e8f2f36fc0986ee44e9ec
2020-07-10 18:45:49 -07:00
Wenhao Jia
484fc676b3 Fix a comment typo.
PiperOrigin-RevId: 320712223
Change-Id: I0103a005fede57bfa3bfe3ee2ceb8d02e6d741a0
2020-07-10 18:35:29 -07:00
Kibeom Kim
428be958c1 Internal change
PiperOrigin-RevId: 320708573
Change-Id: I180e7122da55d564e32e9c8a4be87b05249dc19b
2020-07-10 17:59:52 -07:00
Mihai Maruseac
ac6b4535c3 Rollback PR #35985
PiperOrigin-RevId: 320707414
Change-Id: I3261a877344d83ae62b86a6e30dbe93631d476d6
2020-07-10 17:53:53 -07:00
Karim Nosir
2d7b48cec7 Add section about supported ops in the inference / overview page that links to details about supported ops and ops limitations.
PiperOrigin-RevId: 320707226
Change-Id: Icaadbefbe70b52054dcf48fcc4f04f3e23dbcebb
2020-07-10 17:48:12 -07:00
Kibeom Kim
6ffe7a2ecd Disable flaky test //third_party/tensorflow/core/grappler/optimizers:remapper_test_gpu FuseConv2DWithBiasAndActivationOnGPU
PiperOrigin-RevId: 320706567
Change-Id: I7cd8c82204a07f84ca0f65dfa22568944b3c8e07
2020-07-10 17:41:45 -07:00
TensorFlower Gardener
926d2f2484 Merge pull request #41210 from dnguyen28061:kernel_extension
PiperOrigin-RevId: 320706473
Change-Id: I3179e5feda8ced41be594366c138a6803780eaa1
2020-07-10 17:37:12 -07:00
Xiao Yu
dea810d4e3 Refactor SelectDevice method to allow us to reuse this method for TFRT device placement. This can allow TFRT to make the same decision as current TF.
Remove a few unit test, since it is harder to write unit tests using the new SelectDevice method. However, device_placement_test should provide better coverage than the unit test.

PiperOrigin-RevId: 320704318
Change-Id: I9bee9b508d4eba714f68b8c7464d818091224fdc
2020-07-10 17:26:08 -07:00
Marat Dukhan
98db6af79d Support 1x1 Max/Average Pooling with 1x1 stride in XNNPACK delegate
PiperOrigin-RevId: 320703905
Change-Id: Id9787ba836b7d50f34dcad82033553d0e70b1ac9
2020-07-10 17:19:40 -07:00
Michael Gester
d0ae0f8c70 Fix legalization of SparseMatMul to MatMul
1) Previously, SparseMatMul legalization didn't work correctly for operands with different
element types which is fixed now.
2) Forbidden element types are now correctly checked.
3) Added more unit tests for SparseMatMul legalization.

PiperOrigin-RevId: 320696400
Change-Id: I7376b2cf06027ab6153da0831e2f7d39498ee210
2020-07-10 16:27:54 -07:00
Mihai Maruseac
38f980d3d7 Fix ram_file_block_cache_test on Windows.
When I imported #41235 I followed the linter warnings for Linux but this inadvertendly broke Windows

```
tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache_test.cc(230): error C3493: 'file_size' cannot be implicitly captured because no default capture mode has been specified

tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache_test.cc(237): error C2664: 'tf_gcs_filesystem::RamFileBlockCache::RamFileBlockCache(const tf_gcs_filesystem::RamFileBlockCache &)': cannot convert argument 4 from 'int' to 'tf_gcs_filesystem::RamFileBlockCache::BlockFetcher'

tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache_test.cc(238): note: No constructor could take the source type, or constructor overload resolution was ambiguous

.\tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache.h(52): note: see declaration of 'tf_gcs_filesystem::RamFileBlockCache::RamFileBlockCache'

tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache_test.cc(532): error C3493: 'block_size' cannot be implicitly captured because no default capture mode has been specified

tensorflow/c/experimental/filesystem/plugins/gcs/ram_file_block_cache_test.cc(568): error C3493: 'block_size' cannot be implicitly captured because no default capture mode has been specified
```

PiperOrigin-RevId: 320695991
Change-Id: Ib2cd1c9ed37c92702e8341c0309819373bae7445
2020-07-10 16:22:46 -07:00
Gaurav Jain
1956f5ad87 Make sparse_to_dense_op_py_test v2 friendly
* Change op runtime error string to match with graph construction.
* Remove session scopes
* Fix invalid argument tests to be eager friendly by constructing and
  evaluating in the same line.

PiperOrigin-RevId: 320693166
Change-Id: I42ee0c4a4e141074863a366aef55f9960f0ea806
2020-07-10 16:05:14 -07:00
Saurabh Saxena
f085449f2b Enable importing graph with tf.function nested in a while body inside a tf.function and computing its gradient.
PiperOrigin-RevId: 320691209
Change-Id: I77c88ec90bf8d1e242e31d49196e3abc3d8f9e9b
2020-07-10 15:59:58 -07:00
Yanhui Liang
9b1ac5cd54 Rollback #41144 as #40554 was rolled back only, resulting in keras_cpu_benchmark_test test failing due to a missing dependency.
PiperOrigin-RevId: 320688468
Change-Id: Id1d8641a89719e86b3fb9ffc7a229abbe67101d1
2020-07-10 15:52:15 -07:00
Nat Jeffries
26e1142f90 Modify benchmark runner and benchmarks to use simpler API.
PiperOrigin-RevId: 320688205
Change-Id: Ib99fcc60b75487c72d8ebc0e54ccf7cb7fd8b257
2020-07-10 15:45:15 -07:00
Yanhui Liang
520604fb0b Rollback of PRs #40554 and #41144 as they break nightly builds
PiperOrigin-RevId: 320688173
Change-Id: I7f569d42a504dc5ff4f2b3befc68095fc889f8be
2020-07-10 15:37:47 -07:00
Tim Shen
5bbf4a1d11 [XLA/GPU] Remove uses of Thunk::hlo_instruction() for profiling.
This CL consists of two steps:
* First, refactor all Thunks to take an ThunkInfo instead of const HloInstruction*. This will benefit future extensions to ThunkInfo as we move away from HloInstruction*.
* Secondly, change the data pipeline from:
    Emitter -> Thunk* -> hlo_instruction() -> profiler(HloInstruction*)
  to:
    Emitter -> Thunk with profile indices

The profile doesn't really depend on HloInstruction*, but just its pointer
identity. Removing the dependency on HloInstruction helps with MLIR migration.

PiperOrigin-RevId: 320687291
Change-Id: I7027d4c032f73ed615e5b520e01f3740781735be
2020-07-10 15:31:01 -07:00
Ran Chen
aa47bcc6f1 Make a V2 default strategy
PiperOrigin-RevId: 320683877
Change-Id: Ic6dbecec0e04ce1171d4c8927e58a151e5f41df5
2020-07-10 15:12:53 -07:00
Saurabh Saxena
02e3cb289c First pass at implementing a C++ API for gradients built on top of abstract interfaces.
`gradients.h` has the public headers.
`gradients_internals.h` has some helpers for testing, while we figure out how to hook this into the AbstractOperation itself.

PiperOrigin-RevId: 320682374
Change-Id: I53e1c76f3c0897ff66f2563501806c425de69f24
2020-07-10 15:03:08 -07:00
Marat Dukhan
37d20f87f3 Support RESHAPE operator in XNNPACK delegate
PiperOrigin-RevId: 320678814
Change-Id: I5229605df654b35c84a968db3eef8afd498487e9
2020-07-10 14:46:56 -07:00
Chuanhao Zhuge
9060253512 Use StatusOr to propagate detailed lowering error.
PiperOrigin-RevId: 320677957
Change-Id: Ic95be20f14f960b006d1d47972de07decfca3b77
2020-07-10 14:40:45 -07:00
Mihai Maruseac
d49636eeea Rollback PR #40962: [INTEL MKL] Replace tensorflow::bfloat16 with Eigen::bfloat16
Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/40962

This PR mainly changes tensorflow::bfloat16 to Eigen::bfloat16 to get benefit from its vectorization
Copybara import of the project:

--
3451f21c1e by ShengYang1 <yang.sheng@intel.com>:

Replace tensorflow::bfloat16 with Eigen::bfloat16

PiperOrigin-RevId: 320674736
Change-Id: If4a1347142260f784a75d0bcec95cf8a42698a8d
2020-07-10 14:29:07 -07:00
Revan Sopher
598672134b Use the shape property over the get_shape() method.
get_shape() is an alias, and not implemented on RaggedTensor.

PiperOrigin-RevId: 320669349
Change-Id: I2c2c6d36894fe2c76d9492b73cae01d009a303fb
2020-07-10 14:01:38 -07:00
TensorFlower Gardener
e77d208f1d Merge pull request #41215 from grasskin:master
PiperOrigin-RevId: 320669068
Change-Id: I18e790f5e9036e98571edf3094a4c5b47cb87874
2020-07-10 13:57:27 -07:00
Yunxing Dai
5abbeeec7e [XLA] Update dynamic dimension inference when replacing a node.
Otherwise dynamic dimension inference won't have the latest view of the graph.

PiperOrigin-RevId: 320667881
Change-Id: I75f8e993904385fc516f046c96343fe54419e27f
2020-07-10 13:48:43 -07:00
TensorFlower Gardener
49750fb8ac Merge pull request #35985 from wwwind:addsub_16x8
PiperOrigin-RevId: 320664868
2020-07-10 13:37:43 -07:00
Ken Franko
a4eadffe2d Add outside compilation tests for control flow on host and gradients on host.
PiperOrigin-RevId: 320664808
Change-Id: I41dac6e90bbe998ee6815055dd4a5edc04854767
2020-07-10 13:33:12 -07:00
Tomer Kaftan
14d1e13d4e Give KerasTensor op lambda layers a name matching the tf api symbol
PiperOrigin-RevId: 320662277
Change-Id: I15b033ef3be5484bc6c68e115023b923a4691180
2020-07-10 13:26:44 -07:00
Haoyu Zhang
639364e73f Improve documentation and clean up code for cluster FLR.
PiperOrigin-RevId: 320661639
Change-Id: I430d485c50eb2d6bed0cd4f2c93b02f6f1b1908f
2020-07-10 13:21:42 -07:00
Marissa Ikonomidis
c1921df0e2 Allow the TF_XLA_FLAGS tf_mlir_enable_mlir_bridge to still enable the experimental mlir bridge
for TensorFlow V1 even when the user overrides Session's default ConfigProto.

In TensorFlow V1, when the user doesn't override Session's default ConfigProto, the ConfigProto
uses the value from TF_XLA_FLAGS (via context.config). However, when the user passes in their
own ConfigProto, enable_mlir_bridge is defaulted to false.

PiperOrigin-RevId: 320661288
Change-Id: I5deacb4e12b6551a57c2496c35830ac3af25fe28
2020-07-10 13:18:18 -07:00
TensorFlower Gardener
3adc7cf2c9 Merge pull request #39543 from wwwind:op_tests_16x8
PiperOrigin-RevId: 320661178
2020-07-10 13:14:01 -07:00
Ran Chen
b70a86f269 Add a test for known issues with saved model
PiperOrigin-RevId: 320656309
Change-Id: I6f749752b9d29a3cb474d0e0930e8cbec293ce2d
2020-07-10 12:53:02 -07:00
Mihai Maruseac
195c91d7ba Rollback PR #39429: [ROCm] Fixing and enabling TopK
PiperOrigin-RevId: 320655274
Change-Id: Ie7c4bfa6bdef5120f8fe4afd4cc26cb84efa39c0
2020-07-10 12:48:54 -07:00
George Karpenkov
08c65909e3 [XLA:Docs] Describe the aliasing semantics
PiperOrigin-RevId: 320654953
Change-Id: I765f140dd5ab88c34d916cd0fe429d50c56edd02
2020-07-10 12:42:49 -07:00
Chuan He
d4a0544a49 Reject quantized type tensor with zero scales in flatbuffer importer.
PiperOrigin-RevId: 320648545
Change-Id: If31a8b3ae8598fbd06129f052211fbf8d4583990
2020-07-10 12:23:41 -07:00
Smit Hinsu
fc0b3b42ea Auto generated TensorFlow SelfAdjointEigV2 op
PiperOrigin-RevId: 320648488
Change-Id: I719b3cd44392e7699f80c697c9c64a75cdf6ac15
2020-07-10 12:17:06 -07:00
A. Unique TensorFlower
63cb494e94 Internal change
PiperOrigin-RevId: 320647339
Change-Id: Ibd925006f1a1abd5c09ea815ec9e6d62ac7982c6
2020-07-10 12:11:40 -07:00
TensorFlower Gardener
c299f3f6f7 Merge pull request #40962 from Intel-tensorflow:yang/eigen-bf16
PiperOrigin-RevId: 320645237
Change-Id: I08702860e9d71149a01565293dbdb1fc29443833
2020-07-10 12:06:14 -07:00
Dan Moldovan
5b95d3dce5 Update the mini-tutorial and move specialized to the proper class.
PiperOrigin-RevId: 320644195
Change-Id: I4b3fc1c06e3fc9e9a5d5731f1100ae6ae801598c
2020-07-10 12:00:10 -07:00
Rahul Joshi
41b4e2f098 [MLIR] Adopt NoRegionArguments trait for IfRegion.
- Eliminate custom checks for checking no region arguments in IfRegion
  verification.
- update expected error messages in IfRegion unit tests.

PiperOrigin-RevId: 320643657
Change-Id: I982ea71cf3bffe9811773724d75a79bb98cd35b7
2020-07-10 11:53:58 -07:00
Sachin Joglekar
9a9bceedf5 Wrap the new padded NMS implementation into a composite function, and convert it to the NMSv4 TFLite op if there are no batches.
PiperOrigin-RevId: 320643078
Change-Id: I8afb0edd7e384bad36d686c910dd183c843678e5
2020-07-10 11:49:15 -07:00