Commit Graph

104463 Commits

Author SHA1 Message Date
Mihai Maruseac
4e4684cf87 Add missing files 2021-02-09 12:50:12 -08:00
Mihai Maruseac
fb3d8d64d8 Start llvm-bazel integration 2021-02-09 10:00:38 -08:00
TensorFlower Gardener
e4f72eb72f Merge pull request from rsun-bdti:cast_zeros_like_micro_build
PiperOrigin-RevId: 356520941
Change-Id: Id5c7377df1f1fd24ed55eb4f87c2e6ed5e1626f3
2021-02-09 09:44:02 -08:00
TensorFlower Gardener
890f7164b7 Merge pull request from yongtang:46900-tf.strings.substr
PiperOrigin-RevId: 356520125
Change-Id: Ifd11ff02aa51023007201dccfa02eb8213c08f7a
2021-02-09 09:39:39 -08:00
A. Unique TensorFlower
431217856a Integrate LLVM at llvm/llvm-project@a5222aa085
Updates LLVM usage to match
[a5222aa0858a](https://github.com/llvm/llvm-project/commit/a5222aa0858a)

PiperOrigin-RevId: 356515740
Change-Id: I3868a5871dadab43ef23e23e13b8d30b32eb8046
2021-02-09 09:20:39 -08:00
Dan Moldovan
385b8f50bf Write the example in a more TF-friendly fashion.
PiperOrigin-RevId: 356499216
Change-Id: I70710b504c1dc2eef41c2efd64b8e05bed1f52a2
2021-02-09 07:45:35 -08:00
Raman Sarokin
03773a81bd Added ConverterToConvWeights unit tests for OpenCL & Metal.
PiperOrigin-RevId: 356489082
Change-Id: I9d0aa4e6ddf084744e7cba5466d25a4cb761c142
2021-02-09 06:41:45 -08:00
Benjamin Kramer
cb9da9e776 [mlir][kernelgen] Test ops that can return NaN with the default set of inputs
NaNs no longer break comparisons, so it's safe to test them now. I also want to
put a NaN into the default set of inputs eventually, but right now that
uncovers some bugs in both Eigen and generated kernels.

PiperOrigin-RevId: 356473399
Change-Id: I2d39f0906ccbcbabb8d0bef48e0d23f6f58da620
2021-02-09 04:42:16 -08:00
Stephan Herhut
8b2448df19 Add appropriate preprocessor defines to avoid building Eigen kernels when building with kernel generator enabled.
PiperOrigin-RevId: 356464517
Change-Id: I21c8f0a287585b9a9da6acd0a1adbc1955eb965d
2021-02-09 03:29:44 -08:00
Benjamin Kramer
1b41b5a30d Make NaNs equal for testing
The default behavior is that NaN != NaN, making it impossible to check
values against known good values that contains NaN. Change the behavior
so NaN is equal (and close) to just NaN. While this is incompatible with
IEEE 754, it makes writing tests much easier.

PiperOrigin-RevId: 356463179
Change-Id: Iad2bd77708eb21e86398413425f77423442de5ad
2021-02-09 03:19:22 -08:00
A. Unique TensorFlower
5eac5b75b4 Update GraphDef version to 672.
PiperOrigin-RevId: 356446788
Change-Id: Ia5e3a1af5b9793e695dcd0b23ac2569d07f4d539
2021-02-09 01:13:29 -08:00
A. Unique TensorFlower
3d159a6acf compat: Update forward compatibility horizon to 2021-02-09
PiperOrigin-RevId: 356446785
Change-Id: Ib5b02bcb1b595c688fa6cf32494b2e7687e68684
2021-02-09 01:06:16 -08:00
A. Unique TensorFlower
d5a6c5259d Add space for reporting memory bandwidth statistics
PiperOrigin-RevId: 356439798
Change-Id: Ifd17237136c02e68b2d432a12409c4d467d22c8c
2021-02-09 00:08:28 -08:00
Terry Heo
792639b6e6 cmake: Update absl.cmake
Use Find<module>.cmake instead of <module>config.cmake to remove absl_DIR hack.

PiperOrigin-RevId: 356438974
Change-Id: I5de67e21c2e55cad20ce3da002260acdd98c06b3
2021-02-08 23:59:15 -08:00
Ron Shapiro
aae0fc015b Support uint32 and uint64 in tf.get_static_value() from within a tf.function()
Attempting to do so without this change raises an exception:

```
File ".../tensorflow/python/ops/check_ops.py", line 672, in assert_equal
  data, summarize, message, name)
File ".../tensorflow/python/ops/check_ops.py", line 369, in _binary_assert
  x_static = tensor_util.constant_value(x)
File ".../tensorflow/python/framework/tensor_util.py", line 876, in constant_value
  ret = _ConstantValue(tensor, partial)
File ".../tensorflow/python/framework/tensor_util.py", line 681, in _ConstantValue
  return MakeNdarray(tensor.op.get_attr("value"))
File ".../tensorflow/python/framework/tensor_util.py", line 641, in MakeNdarray
  raise TypeError("Unsupported tensor type: %s" % tensor.dtype)
TypeError: Unsupported tensor type: 23
```
PiperOrigin-RevId: 356437863
Change-Id: I51d9adf8727bcf01ac3a862a608fa93e2cb6a88d
2021-02-08 23:51:41 -08:00
Hyeonjong Ryu
f47acb1257 Internal change on model loading.
PiperOrigin-RevId: 356429530
Change-Id: I1416414927aed1ff12ab3491e66140da1a8defde
2021-02-08 22:28:22 -08:00
Frank Chen
81e97f2832 Add space for reporting memory bandwidth statistics
PiperOrigin-RevId: 356421433
Change-Id: I52f9d8db3a2fc8209a247f300e79287fd9fa2555
2021-02-08 21:28:28 -08:00
Isha Arkatkar
6fd9628434 Add a protected getter for host_name field in GrpcServer
PiperOrigin-RevId: 356420826
Change-Id: I461be80631878ace47ca107fee304957df12837e
2021-02-08 21:24:14 -08:00
A. Unique TensorFlower
a0b5d0bacb Internal change
PiperOrigin-RevId: 356417008
Change-Id: If13d7ebaf8a66cb8fbc9296cd5dc92b75e528a34
2021-02-08 20:51:44 -08:00
A. Unique TensorFlower
d61b9211bc [tf.lite] Mark the tensor # as the tensor name for testing
For synthetic kernel tests, use the tensor index # as the tensor name to
simplify debugging.

PiperOrigin-RevId: 356411736
Change-Id: Id43f80f8d2416437e271bc3f72f5db42424a677a
2021-02-08 20:01:09 -08:00
Yunxing Dai
d3e7ce26d9 Implement implicit broadcast for binary operation of dynamic shapes.
- This cl instructs dynamic padder to insert implicit broadcasts into the graph when a binary operation is performed on two dynamic tensors.
- Optimization : The implicit broadcast is only inserted when we can't proof two dynamic dimensions are the same.
- Optimization : Added a simplification pass that allows us to simplify operations on dynamic dimensions, this opens up more opportunities for optimization 

PiperOrigin-RevId: 356407626
Change-Id: I980477ee6f3ccb42342226afaab03b4b09549360
2021-02-08 19:27:55 -08:00
George Karpenkov
969371e28f [NFC][Stack Traces] Do not build a functor where we can use the translation map directly
PiperOrigin-RevId: 356403200
Change-Id: I6ae0231a08bcc24b103f3fa8f95233aa2116a952
2021-02-08 18:49:32 -08:00
George Karpenkov
2c596172d2 [TF2XLA] Attach Python stack trace to all INVALID_ARGUMENT Status objects created from the bridge
PiperOrigin-RevId: 356400325
Change-Id: I1b8fc2a771bcb6492ccde5fbeb14844154b38791
2021-02-08 18:28:58 -08:00
Jared Duke
dac302eeed [tf.lite] Mark the tensor # as the tensor name for testing
For synthetic kernel tests, use the tensor index # as the tensor name to
simplify debugging.

PiperOrigin-RevId: 356391830
Change-Id: I0f52876c2080a68574b550cfb8ec90cf3c776a7a
2021-02-08 17:40:12 -08:00
Xiao Yu
6df72f44ff Move custom device placement from eager/execute.cc to c_api.cc. Then it can be reused by TFRT.
PiperOrigin-RevId: 356389689
Change-Id: Ibd3df16e2a4bd0607389edbd42d01cd04d24d0aa
2021-02-08 17:30:34 -08:00
TensorFlower Gardener
063eb2465f Merge pull request from ktaebum:shape-fix
PiperOrigin-RevId: 356388605
Change-Id: If0de8b1c1ada5781b57bb7098797eb04bce37b52
2021-02-08 17:24:42 -08:00
A. Unique TensorFlower
777b088450 [XLA] Move HLO instruction OpMetadata dummy names to a new field.
PiperOrigin-RevId: 356388571
Change-Id: I2282ef5a236ffd651c588f717cdab13f09c7e8ac
2021-02-08 17:19:21 -08:00
Allen Lavoie
358a61ab90 Parallel device: Minor rename+slight generalization to make it easier to create literal/constant parallel tensors
PiperOrigin-RevId: 356387020
Change-Id: I0c0b88f8eccaf9b0b4fed90390295f44c0c11388
2021-02-08 17:12:35 -08:00
Jay Shi
655dde4d59 [tf.data] Add the optimization to enable batch parallelization.
PiperOrigin-RevId: 356384660
Change-Id: I00024090fefa9410ab2da9ea62bca71f2934b8da
2021-02-08 17:08:02 -08:00
TensorFlower Gardener
a4e0b87e64 Merge pull request from WindQAQ:fold-strided-slice-from-shape
PiperOrigin-RevId: 356384032
Change-Id: Ie275c0e9f89542c7690faf14ff4dd5b19074b4a1
2021-02-08 16:59:33 -08:00
A. Unique TensorFlower
c29aa443ec Integrate LLVM at llvm/llvm-project@2fa4186d4e
Updates LLVM usage to match
[2fa4186d4e1c](https://github.com/llvm/llvm-project/commit/2fa4186d4e1c)

PiperOrigin-RevId: 356383544
Change-Id: Ie6e1f60198b8aa62a279e755e0234ee00854868d
2021-02-08 16:53:15 -08:00
A. Unique TensorFlower
b757b8a8db Getting initialized value from the same device as the original variable,
when creating EMA variables.

PiperOrigin-RevId: 356380269
Change-Id: I09d330dc4f321396a082abd8fda02ebc5199f5b0
2021-02-08 16:35:52 -08:00
TensorFlower Gardener
e920f7a7ea Merge pull request from yongtang:deprecate-hdfs
PiperOrigin-RevId: 356378740
Change-Id: Iba3ed688bcbe56c9506fdf9e5842efefe948c4c0
2021-02-08 16:27:59 -08:00
Yuanzhong Xu
18f2dd4262 Allow more sharding propagation from broadcast operands
MaybeImproveInstructionSharding() already checks that it needs to be compatible with existing tiled sharding (if any).

PiperOrigin-RevId: 356375771
Change-Id: Ic5e65e00cea0a25cec2cf93027632c4c7783a20e
2021-02-08 16:13:46 -08:00
Xiao Yu
324ab95fb0 Register VariableShapeOp for TPU.
PiperOrigin-RevId: 356370389
Change-Id: I23679fdbc05f02a6d3a6203a77ed7a374cdcb4fb
2021-02-08 15:50:16 -08:00
TensorFlower Gardener
21ec8483b2 Merge pull request from jackd:bm-main-argv
PiperOrigin-RevId: 356369458
Change-Id: Ie89c8552a44dc6c42802ba9ecaf21bded401708c
2021-02-08 15:45:09 -08:00
Takayoshi Koizumi
885c55ca95 PR : micro: Add Sony Spresense board target
Imported from GitHub PR https://github.com/tensorflow/tensorflow/pull/46195

Add build terget on Sony Spresense board.
To build it, Spresense SDK is required.
And hello_world, micro_speech and preson_detection are added for the board.

The related issue is 
Copybara import of the project:

--
bff4913f03be75a368c6845c448fdd2fe5624bb1 by Takayoshi Koizumi <takayoshi.koizumi@gmail.com>:

Add Sony Spresense board target

Add build terget on Sony Spresense board.
To build it, Spresense SDK is required.
And hello_world, micro_speech and preson_detection are added for the
board.

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tensorflow/pull/46195 from takayoshi-k:add_spresense_target bff4913f03be75a368c6845c448fdd2fe5624bb1
PiperOrigin-RevId: 356357681
Change-Id: I4b62059ef27b47775431168536da563a56343a6d
2021-02-08 14:49:54 -08:00
Thomas O'Malley
236369d651 KPL - Implement Normalization with new APIs.
PiperOrigin-RevId: 356351476
Change-Id: I66f061a36cf096239fe2b0f2aaa380dba55a7569
2021-02-08 14:21:29 -08:00
Andrew Audibert
2cc0ab3c0c [tf.data service] Skip round robin rounds when data isn't ready.
PiperOrigin-RevId: 356348715
Change-Id: I8ac227a098d49bd8a3fd6c96b93ac855df80a121
2021-02-08 14:13:47 -08:00
TensorFlower Gardener
0092ebe4c7 Merge pull request from nluehr:tf32-fixes
PiperOrigin-RevId: 356348412
Change-Id: I7df8f2d191fede578d54db4ec38b7a6a6ae11865
2021-02-08 14:08:55 -08:00
Ce Zheng
bdd28bfb0c [XLA] Add a variant of WhileLoopInvariantCodeMotion pass to hoist groups of loop expensive invariant HLOs out of while if they are not size-inflating as a whole.
PiperOrigin-RevId: 356334931
Change-Id: I9b933654926897fa12a99b8e9050c57db60fdd23
2021-02-08 13:13:32 -08:00
Michael Gester
5ac570fa43 Update TF op descriptions
PiperOrigin-RevId: 356333928
Change-Id: I5b0e74c0bd0ec6695bd87d77016e73af88d25b4f
2021-02-08 13:07:37 -08:00
Tzu-Wei Sung
e159982568 Fold StridedSliceOp when input is defined by ShapeOp.
The pattern is common is TF python library like height = tf.shape(x)[1].
When x has some dynamic dimensions (typically batch dim), tf.shape can not be constant folded so height cannot be inferred as a constant.
This PR folds this kind of patterns to improve sub-shape constant folding.

Rename some testcases

Correctly handle negative strides

Add testcases for out of bound begin and end

clang-format

Address comments

Fix Windows build. Templated Lambda is not supported in MSVC.

Fix shrink_axis_mask with negative begin

Use canonicalization pattern instead of folder to better support unranked and dynamic output

Switch back to folder
2021-02-08 12:44:57 -08:00
Amit Patankar
4f663d4b8f Allowlist certain data types to avoid a seg fault.
PiperOrigin-RevId: 356326671
Change-Id: I23b65b52e93798cb5a6744632d31b0f88c6b6b31
2021-02-08 12:37:40 -08:00
TensorFlower Gardener
f0e867da82 Merge pull request from AdamHillier:patch-1
PiperOrigin-RevId: 356325340
Change-Id: I8ede595095da68c722aa95bc5bce03aac3482391
2021-02-08 12:28:48 -08:00
Stephan Herhut
2a76e6eeb2 Alias the Add and AddV2 operations in kernel generator generated kernels.
They have the same semantics except for strings.

PiperOrigin-RevId: 356322598
Change-Id: Ibb0aafb9faabaf0bc8ca8c375b6a183065e37493
2021-02-08 12:24:18 -08:00
Rahul Joshi
d7992c051e [XLA] Disallow empty replica groups when use_global_device_ids() == true
- Extend this check from AllGather to all other instruction that have use_global_device_ids

PiperOrigin-RevId: 356318717
Change-Id: Ib5397454eed6f212e71e0aab45f52ad83e870715
2021-02-08 12:19:11 -08:00
TensorFlower Gardener
879fd3bc67 Merge pull request from TomWildenhain-Microsoft:patch-1
PiperOrigin-RevId: 356317758
Change-Id: Ie1e790c288c5a3200fde3d8a6483b0e287af2888
2021-02-08 12:11:20 -08:00
Mehdi Amini
80375c5b11 Minor tweak to shape inference to avoid an extra always-true comparison (NFC)
The loop is comparing every elements to the first one in the range, we can drop_front()
from the range since the first element does not need to compare to iself.

PiperOrigin-RevId: 356317270
Change-Id: Ieb54a4308e86bf9b510d81fa7bc46a32a361589c
2021-02-08 12:05:28 -08:00
Amit Patankar
05fb0863d3 Add a method for choosing a random TF dtype while ignoring a list of invalid ones.
PiperOrigin-RevId: 356317131
Change-Id: I4ef98c116d92d91e3fa8bfcb96b3f56a8b235469
2021-02-08 12:00:06 -08:00